I've got the following script...
[Files]
Source: "extractor.prop"; DestDir: "{app}"
How can I say, if extractor.prop
already exists, rename it to extractor.prop.old
and install this one? By default at the moment it just deletes the old file so I don't want to erase the file if it's currently in use on a customer's site.
Inno Setup is a free software script-driven installation system created in Delphi by Jordan Russell. The first version was released in 1997.
Go to Menu, Project, then Compile to compile and create the setup file. This will create a complete installer. Run the Setup and your application will be installed correctly. Innosetup offers an awesome alternative to create great looking Installers for free.
Inno Setup's [Code] section uses Pascal (or Pascal Script to be more exact, thanks to TLama), likely because Inno Setup itself is written in Pascal Delphi.
You don't have to manually create checkboxes for that. The standard way to let the user choose what to install is to use the [Types] and [Components] sections of your script file. Take a look at the Components. iss script located in your Inno Setup install folder\examples.
Use another [Files]
entry with the external
flag:
[Files]
Source: "{app}\extractor.prop"; DestDir: "{app}"; DestName: "extractor.prop.old"; Flags: external skipifsourcedoesntexist
This is what external
does:
external
This flag instructs Inno Setup not to statically compile the file specified by the Source parameter into the installation files, but instead copy from an existing file on the distribution media or the user's system. See the Source parameter description for more information.
(source)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With