![]()
|
ScriptMaker TutorialThe [Files] PageThis is where you select the files that you want to include in the installation. Files can be added individually, with separate options set for each file, or several files may be added at once, in which case they will all share the same options. In this tutorial we will assume that you are adding the files individually. Selecting a file to include in the installation can be done, either by typing the full path and filename into the Source File field, or more usually by clicking the "browse" button at the right of the field. Files can also be "dragged" onto the [Files] page from Windows Explorer. If you type the name of the file manually into the Source File field, you can include wildcards (* and ?), but in this case ScriptMaker cannot check that the files exist. Entries like this will appear on a green background in the Files grid. The Destination Filename field lets you set the location where the file will be installed during installation and also, if you wish, to change the name of the installed file. By default ScriptMaker enters {app}\AppName into this field. You will almost always want to keep the same filename, and use Directory Constants such as {app} or {win} in the path. These Directory Constants can be accessed quickly by right-clicking on the Destination Filename field and choosing from the context menu. If you have set up additional directories on the [Dir] page, these will also be available from the context menu.
Adding Complete DirectoriesIf you need to add complete directories of files to the file list, the simplest way is to drag and drop the directory from Windows Explorer. All the files in the directory will be added to the file list as well as any sub-directories and their files.
![]() When the directory is dropped onto the [Files] page a dialog will appear so that you can set the destination directory for each of the directories and sub-directories you have chosen. At the top of the dialog you can alter the root destination directory (initially set to {app} - the directory chosen for the installation by the user. Changing the root directory and clicking the Apply button changes the root for all of the dropped directories and sub-directories. The chosen files are added directly to the files grid (you do not have to click the Add button as you do with files. The installation options, file attributes, etc., for all the files will be those which were set on the [Files] page at the time you dropped the directory onto the page, so these should be chosen before dragging and dropping (see below). If some of the files require different options, see the section on Changing File Properties below. As well as adding the files in the chosen directory and its sub-directories, the [Dirs] page will be updated to include the new directories.
File OptionsFor each file you can set a number of options.
![]() Selecting the Confirm Overwrite option makes Setup ask the user to confirm before copying the file if it already exists. Replace on Restart will usually be used when replacing Windows core files. If the file is in use when the installation takes place, Setup will not be able to replace it. Setup will therefore register the file so that it will be replaced when Windows is next rebooted. The user will be prompted to restart the computer when installation finishes. You should note the following extract from the Inno Setup Help File: "To maintain compatibility with Windows 95/98 and 3.1, long filenames should not be used on an entry with this flag. Only '8.3' filenames are supported. (NT does not have this limitation.) " The Never Uninstall option, if selected, will prevent the file from being uninstalled. It should only be used on rare occasions and is intended to be used when installing a very common shared file such as CTL3DV2.DLL which is used by other applications. This option will usually be used in conjunction with the Only if does not exist copying option. The Shared File option makes Setup use the Windows shared file counting feature. Most files which are installed in the Windows\System folder will need to use this option including .OCX and .DPL files, but it should not be used with MFC DLL's, which should instead use the Only if does not exist copying option. Files using this option which are installed on Windows NT 3.51 systems will never be deleted. For files which need to be "registered" with the OLE server, select the Register Server option. This will make Setup register the file on installation and de-register it when the application is uninstalled. If your project contains a "readme" file, you can use the Is Readme File option. With this option selected, Setup will ask the user whether he/she wants to read the file when installation is complete. Only one file can be marked with this option. Setup will use the default application for the file type in order to display it, and the readme file should therefore normally have an extension like .txt or .doc. The Delete After Installation option can be used to make Setup install the file normally and then delete it after installation is complete. An example of the use of this option might be when certain data is required by an application which is run during installation but is then no longer required. The Compare TimeStamp option is an unusual and rarely used one. Normally, if a file exists on the user's system and has the same version number as the one you are installing, the file will not be overwritten. When this option is selected the timestamps of the two files are also compared and the existing file is overwritten if its timestamp is earlier than the one in your installation. This option has no effect if the copy mode (see below) is not either Copy Normally or Only If Newer. If the file is a Type Library which needs to be registered, check the Register Type Library checkbox. Note that this flag cannot be used in conjunction with the Replace on Restart flag. The External file flag should be used if the file you are adding is not to be compiled into the actual setup file but is to be included as a separate file with the setup. For example, you might have a registration file which is customised for each user and cannot therefore be included in the compiled setup. If an External file cannot be found during installation, Inno Setup will give a warning message. This message can be avoided by using the Skip if ext. file does not exist option. Note that this option only affects external files, it cannot be used with other files. If the file you are adding to the project is a font file you will need to select the Install Font option. When you select this option it will reveal the Font Name field (which is normally hidden) and replace the Source File edit box with a dropdown list of installed fonts. If the font is not a TrueType font, you should also select the Not TrueType option. Selecting a font name in the dropdown list will automatically insert the proper filename and the actual font name in the appropriate edit boxes. It will also set the destination to the {fonts} folder and set the Only if does not exist and Never uninstall flags. Occasionally you may want to add a font which is not actually installed on your machine, in which case it will not appear in the list of fonts. Selecting "(Browse)" in the dropdown list will open the normal "File Open" dialog to allow you to select the font. Remember that you will have to enter the Font Name field yourself in this case (i.e. the name which appears when you double-click the file in the fonts folder). Setup normally asks the user for confirmation before overwriting a read-only file. If the Overwrite Read Only Files checkbox is checked, read-only files will be overwritten without querying.
Marking the Main Executable File and Running the Program after InstallationOne, and only one, executable file may be marked using the Is Main Exe File checkbox. If Check Executable Version Number has been selected on the [Options] page, the marked file will be used when checking the version number. If there is only one executable file in the project, or if the main file name matches the Application Name on the [Initial Setup] page, the correct file will be used anyway, even if it is not marked. However, if the option to Run Exe after install has been chosen on the [Initial Setup] page, it is mandatory to mark the file using the Is Main Exe File checkbox. If the file needs parameters when it is run, these can be added in the Params field.
Copying Modes![]() Most files will be installed using the Copy normally mode. In this mode, if the file being installed already exists on the user's computer and is a later version number, the user will be asked whether it should be replaced or not. The Only if newer mode is similar to the Copy Normally mode except that the user is not asked whether the file should be replaced - it will never be replaced if the existing file is newer than the one being installed. Using the Only if does not exist mode, Setup will only install the file if it does not already exist on the user's computer (regardless of version numbers). The Always overwrite mode forces Setup to install the file even if a newer version already exists on the user's computer.
File Attributes![]() Normally no attributes are assigned to a file when it is installed. However each file can, if you wish, be given one or more of the Read only, Hidden or System attributes when it is installed.
Windows Version
Each file may have a lowest and/or a highest Windows version outside which range it will not be installed. Normally this will be set on the [Initial Setup] page, but individual files may need a different setting. In this case, click the Windows Version button and you will be able to select a Min. Windows Version and Only install if below version for the current file. Note that the same options are also available on the [Dir], [Icons] and [Run] pages. |
||
Member of |
Copyright © 2005
Last major revision: 7 March 2001 at 17:41 BST
Minor revisions: 4 February 2005 at 14:52 BST |