How to use InstallerFX

Since InstallerFX will be used with the Installer program we need to start and control the InstallerFX from the installer script.

In the Installer script we will do the following steps in this order:

  1. Cleanup at end or at error/abort.
  2. Copy the first picture
  3. Start InstallerFX.
  4. Change InstallerFX pictures and placement.
  5. End InstallerFX and the Installer script

If the Installer script is made correct, there will be no problems with InstallerFX and the picture files the program uses.

1. Cleanup Script

At the start of the Installer script it can look like this. If an error or the user select abort, this part of the Installer script will remove the InstallerFX picture. So this is the end and the cleanup.

; Installer script start.
(onerror (CLEANUP))
; Cleanup any temporary mess we created
(procedure CLEANUP
    ; Nothing to cleanup
    (delete "t:installerpic")
    (delete "t:installerpic.prefs")
) ; CLEANUP

If you are using several InstallerFX programs at once you also need to remove the other InstallerFX files.

2. Copy picture for InstallerFX

Before we can start InstallerFX we need a picture in for example t:. We need to copy the picture from the installer package and to the destination and we need to change the name of the file. This can be done like this:

(copyfiles
    (source "InstallerFX/Pic1.iff")
    (dest "t:")
    (newname "InstallerPic")
)
(copyfiles
    (source "InstallerFX/pic1.prefs")
    (dest "t:")
    (newname "InstallerPic.prefs")
)

In this example we copy both the InstallerFX picture and the prefsfile. The script is changing the name of the destination file with the command "newname". The prefs file must have the same name as the picture+.prefs. If this is not correct the InstallerFX will not find the prefsfile and will use the default settings.

3. Starting the InstallerFX.

After copying the pictures to t: we can start the InstallerFX program, this is done like this:

(run "run InstallerFX/InstallerFX t:installerpic")

We need to use run in the command because InstallerFX does NOT detach when we are starting the program. We also need to give the path and the filename of the picture we want InstallerFX to use.

4. Change InstallerFX pictures and placement.

After you have installed some files, you may want to change the InstallerFX picture, when for example the user need to insert the next disk.

(copyfiles
    (source "InstallerFX/Pic2.iff")
    (dest "t:")
    (newname "InstallerPic")
)
(copyfiles
    (source "InstallerFX/pic2.prefs")
    (dest "t:")
    (newname "InstallerPic.prefs")
)

In this example we replace the pic1.iff with the pic2.iff, but we rename the destination file to the same as above "InstallerPic". You can also change the position of the InstallerFX windows and the Installer window if you have some changes in the prefs file. If you do not want to change the positions you can skip copy the prefs file again.

5. End InstallerFX and the Installer script

At the end of the installer script we need to quit InstallerFX and the Installer program. When we call the CLEANUP procedure the picture InstallerFX uses will be removed. Since InstallerFX have a filenotify on this file it will quit if the file is missing after the notify.

(complete 100)
(CLEANUP)
(exit)