Q:

Rename an existing file before replacing it in an Inno setup

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 customers site.

A:

Use another [Files] entry with the external flag:
[Files]
Source: "{app}\extractor.prop"; DestDir: "{app}"; DestName: "extractor.prop.old"; Flags: external skipifsourcedoesntexist

