Inno Setup: Do not overwrite settings file, when installing an update

冷暖自知 提交于 2020-04-10 05:26:12

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!