问题
I have created an Inno Setup script for a C++ app. The script works fine and consists of the following:
[Files]
Source: "C:\Users\john\Desktop\My_App_setup\my_app.exe"; DestDir: "{app}"; \
Flags: ignoreversion
Source: "C:\Users\john\Desktop\My_App_setup\settings\*"; DestDir: "{app}\settings"; \
Flags: ignoreversion recursesubdirs createallsubdirs
The files are the C++ executable my_app.exe
and a settings text file that is customized by the end user.
What I'd like to do is when I have an new version of my_app.exe
to update just this file and leave the same settings that the user may have changed so far.
What should I try?
回答1:
Just add onlyifdoesntexist flag:
Source: "C:\Users\john\Desktop\My_App_setup\settings\*"; DestDir: "{app}\settings"; \
Flags: ignoreversion recursesubdirs createallsubdirs onlyifdoesntexist
来源:https://stackoverflow.com/questions/45480309/inno-setup-do-not-overwrite-settings-file-when-installing-an-update