I have an application written in Delphi that has several versions that contain binaries and database (MDB) with catalog data.
During the product life cycle fixes/enhancements are either in database file or in some binary files.
Version are preserved in Registry.
Users might have different versions of the program when new patch is available.
Now users have different versions how to implement following scenario in Inno Setup:
What is the correct way to implement this in Inno setup?
I am not sure if it is the correct way to do it, but you can use the [code] section and the BeforeInstall Flags
like so
[Files]
Source: "MYPROG.EXE"; DestDir: "{app}"; BeforeInstall: MyBeforeInstall('{app}')
Source: "MYFILE.EXE"; DestDir: "{app}"; BeforeInstall: MyBeforeInstall('{app}')
Source: "MYDB.MDB"; DestDir: "{app}"; BeforeInstall: MyBeforeInstall('{app}')
[Code]
function MyBeforeInstall(InstallPath): Boolean;
begin
Result:= FALSE;
//Check if this file is ok to install
MsgBox(CurrentFileName , mbInformation, MB_OK);
end;
Then use CurrentFileName to determine if the file can be installed, I am not sure if it will just quit the installer if the result is false, or skip the individual file.
You can also use the [Types]/[Components] section to determine what files will be installed, but I don't know if there is a way to auto select that.
Inno will look at file version information by default. So if your patch just needs to only update a file when the version in the patch is newer, do nothing; Inno already behaves that way.
If, on the other hand, your patch needs to replace a file with the same version (or there is no version information in the file), use the replacesameversion flag. This causes Inno to compare the contents of the file, and replace it if it is different. See the help for Files for more information on this flag.
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