adding uninsneveruninstall after-the-fact doesn't work

31 views
Skip to first unread message

Reza Hadi Fairuztama

unread,
Apr 9, 2026, 1:04:42 AMApr 9
to inno...@googlegroups.com
Good morning.

We have an application that contains a setting files within it, ones that needs to be added during fresh installs but should never overwritten at all costs, not even deleted when uninstalling. However, until now, we didn't use the "uninsneveruninstall" so the files went away on deletion.

Adding the flag works fine... unless we're reinstalling over the version before we added the flag, in which case the uninstaller still deletes the file anyway. A fresh installation, or reinstalling from a version with the flag works fine, so it seems it was a problem with old uninstaller. Is there a way to force-update the uninstaller within the installer itself?

Innosetup complier is 6.6.0 Non-Commercial.




Martijn Laan

unread,
Apr 9, 2026, 3:09:32 AMApr 9
to inno...@googlegroups.com
Hi,

When the original install was done without the flag, the command to delete the file was stored in the uninstall log. It will stay there until uninstallation, and there is no method to remove it while keeping the rest. It works this way so that the uninstaller can automatically handle any changes in the set of files of your application.

Your best bet is probably to set the [Setup] section directive UninstallLogMode to overwrite. This instructs Setup to overwrite any existing uninstall log from the same application instead of appending to it. That way, if you update using an installer which does have the flag, the old entry will be removed from the log. Note that this does mean you will have to start handling changes in the set of files yourself, for example by adding [InstallDelete] or [UninstallDelete] entries for files which are no longer part of your application.

Another option is to use [Code] to back up the file before uninstall and restore it after.

In general though, installing a file that users are allowed to edit is not a good idea. Consider installing a default, non-editable file instead and having your application copy it to the actual editable settings location when no settings exist yet.

Greetings,
Martijn

Op 9-4-2026 om 04:46 schreef Reza Hadi Fairuztama:
--
You received this message because you are subscribed to the Google Groups "innosetup" group.
To unsubscribe from this group and stop receiving emails from it, send an email to innosetup+...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/innosetup/CACJXiZzO2fYNOEraM3WzUaqy4Abqs1Xttn79yAdbUx129E%2BzPA%40mail.gmail.com.

Reply all
Reply to author
Forward
0 new messages