(Example: DEPLOYFOX DEMO APP FULL SCRIPT.ISS)
Now that you created a basic script with the script wizard and added the VFP runtime files, your script is nearly complete. Before compiling it, however, there are a number of optional entries you can add that will improve the installation both functionally and appearance-wise.
All but one of the enhancements we mention here are made to the Setup section of the script. Listing 3 is the completed Setup section for the demo app ‚ s install script. We added several entries not generated by the script wizard. We won ‚ t mention all of them individually ‚ if you want to you can compare the code in Listing 3 with the Setup section code in Listing 1 to see which entries have been added. Most of the new entries are self-explanatory, but a few deserve special mention.
An AppID forms a link between various versions of the same application for uninstall purposes. To avoid creating a new uninstall registry key for each update, use a common AppID for all versions of the same application.
An AppMutex can be used to prevent a user from installing or uninstalling the application while the application is running. This helps avoid problems when users are installing updates.
Note ‚ | Note that AppMutex only works if your app creates a mutex by that name when it ‚ s running. Information on how to create a mutex in a VFP application can be found in George Tasker ‚ s article ‚“Creating Single Instance Applications ‚½ in the November 1998 issue of FoxPro Advisor magazine. This article is available online at http://www.advisor.com/doc/05263 . |
The SourceDir directive specifies the location for files referenced in the Setup and Files sections of the script. The default location for these files is in the directory where the script itself is located. If your files are located elsewhere and you use SourceDir to specify their location, you do not have to include the full drive and path information. This makes your script more readable and easier to maintain.
MinVersion specifies the minimum Windows version for your application. The first value is the minimum version for Windows 95/98/Me. The second value is the minimum version for Windows NT, which also encompasses Windows 2000 and Windows XP. The Inno Setup Help file has a list of these values and the version of Windows they pertain to.
WindowVisible=No tells the installer not to display a full-screen gradient-colored background during installation. With this setting, there is no special background and the setup wizard appears on top of whatever is beneath it, which would typically be the user ‚ s desktop if no other applications are running. This is now the accepted standard, and in fact WindowVisible=No is the default in Inno Setup version 4.0. If you do want a full screen background you can use WindowVisible=Yes, but if you do, be aware the Inno Setup documentation says it ‚ s considered a legacy feature that will probably be removed in some future release.
The final change we want to make to the setup script before compiling is to specify a working directory for the application ‚ s shortcuts. Do this by adding a WorkingDir parameter to the appropriate entries in the Icons section. This parameter can accept a constant as its value, so we use WorkingDir = {app} to specify the working directory for the application is the directory where the application is installed.
The value of the WorkingDir parameter determines the drive and pathname the installer inserts into the ‚Start In ‚ field on the shortcut ‚ s property sheet. Two shortcuts can launch the application in our setup script, so we need this parameter to both of them. The Icons section of the script now looks like this:
[Icons] Name: {group}\DeployFox Demo App; Filename: {app}\demoapp.exe; WorkingDir: {app} Name: {group}\Uninstall DeployFox Demo App; Filename: {uninstallexe} Name: {userdesktop}\DeployFox Appendix D Demo App; Filename: {app}\demoapp.exe; WorkingDir: {app}; Tasks: desktopicon
On The Web ‚ | The complete script for the demo app is included in the source code for this appendix as DEPLOYFOX DEMO APP FULL SCRIPT.ISS. The script in this file includes the enhancements discussed here |
[Setup] AppID=DeployFox Demo App AppName=DeployFox Demo App AppVerName=DeployFox Demo App 1.0 AppCopyright=Copyright 2003 Information Technology Associates AppMutex=DeployFox AppPublisher=Information Technology Associates AppPublisherURL=http://www.ita-software.com AppSupportURL=http://www.ita-software.com AppUpdatesURL=http://www.ita-software.com DefaultDirName={pf}\DeployFox\AppendixD\DemoApp DirExistsWarning=yes DefaultGroupName=DeployFox\AppendixD SourceDir=C:\DeployFox\DemoApp OutputDir=C:\DeployFox\DemoApp\Output OutputBaseFilename=DeployFox Demo App Setup LicenseFile=C:\DeployFox\AppendixD\license.rtf InfoBeforeFile=C:\DeployFox\AppendixD\InfoBefore.rtf InfoAfterFile=C:\DeployFox\AppendixD\InfoAfter.rtf MinVersion=4.01.1998,4.00.1381sp4 WindowVisible=no WizardImageFile=compiler:images\WizModernImage13.bmp WizardSmallImageFile=compiler:images\WizModernSmallImage13.bmp DisableStartupPrompt=yes