I know how to overwrite the files using this method
[Files]
Source: "Project\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs onlyifdoesntexist; Permissions: everyone-full
But when I change the program using the Change option in 'Install Or Change Program' section I want to not overwrite the files.
I create the change option for my installer like this:
[setup]
AppModifyPath="{srcexe}" /modify=1
How do I do this?
First, your code seems wrong. With the
onlyifdoesntexist
flag, the files are never overwritten, contrary to what you claim.Anyway, a solution is to create two
[Files]
entries, one that overwrites and one that does not. And use the Pascal scripting to pick the entry for a respective installation mode.Example of
IsUpgrade
implementation:See also Pascal scripting: Check parameters.