Reputation: 622
I am using the Inno setup to copy some files from the source directory on my desktop to a folder in the destination computer where I run the Inno Setup. However, before I actually start transferring the files, I wish to take the backup of certain files that will eventually be overwritten.
I am using the [Files]
section of Inno setup to set the source and destination location
Source: "{#MyLocalDir}\Controller\bin\Release\*"; \
DestDir: "{app}\Controller"; \
Flags: ignoreversion recursesubdirs createallsubdirs;
This works absolutely fine, however, I wish to take the backup of some files from the destination folder into another directory in the destination folder to perform some audit on the file. I use the below code and it doesn't work
Source: "{app}\Controller\Controller.exe.config"; \
DestDir: "{app}\PrevVersion\Controller\Controller.exe.config"; \
Flags: ignoreversion recursesubdirs createallsubdirs;
It gives the error that the location doesn't exist. Please help
Upvotes: 2
Views: 221
Reputation: 202088
If you want to copy files from the destination machine (as opposite to installing files from the source machine [the machine where you compile the installer]), you have to use external
flag. That also allows you to use constants (such as {app}
) in the Source
parameter.
[Files]
Source: "{app}\Controller\Controller.exe.config"; \
DestDir: "{app}\PrevVersion\Controller\Controller.exe.config"; \
Flags: external ignoreversion recursesubdirs createallsubdirs
Upvotes: 2