简体   繁体   中英

How do I force Inno Setup to make the 'uninsneveruninstall' flag retroactive?

Inno Setup keeps an "Uninstall log" file unins000.dat in the application's install directory. This file contains a list of all the files that are to be uninstalled when the application is removed. When a new version of the app is installed over the old one, Inno Setup just appends any new files to the "Uninstall Log".

An early version of my application removes some user-modified template files when it is uninstalled, because I forgot to include the uninsneveruninstall flag for those files.

In the latest version of the software, the uninsneveruninstall flag is set, and the files don't get removed....... unless the latest version was installed over the broken version. Then, because those files are in the uninstall log without that flag, they get removed upon uninstall!

I can't ask my users to uninstall the old software before upgrading, because then they would lose those files.

Can I force Inno Setup to regenerate the uninstall log from scratch? Or at least remove/overwrite the entries for these files? I want the uninsneveruninstall flag to be retroactive.

You can't change that flag retroactively. Once it's been released, then that's it.

An option though would be, during the setup, to detect the older broken version having been installed (If not by version number, maybe a flag in the registry to say the fix has been applied) and backup the folder in question, perform an uninstall (silently) then restore the folder. The setup can then carry on as normal.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM