Rename an existing file before replacing it in the Inno setup

I have the following script ...

[files] Source: "extractor.prop"; DestDir: "{app}"

How can I tell if extractor.prop already exists, rename it to extractor.prop.old and install it? By default, for now, it just deletes the old file, so I don’t want to erase the file if it is currently being used on the client’s site.

+6
source share
1 answer

Use a different [Files] entry with the external flag:

 [Files] Source: "{app}\extractor.prop"; DestDir: "{app}"; DestName: "extractor.prop.old"; Flags: external skipifsourcedoesntexist 
+12
source

Source: https://habr.com/ru/post/901732/


All Articles