views:

329

answers:

1

I use Inno Setup for my product's installer/uninstaller. My software has auto-update capabilities during which time it may not only change existing binaries but may also add new ones. These are additional product files that are placed into the product's installation directory - not data files.

The Inno Setup uninstaller only knows to uninstall files by name that it originally put there at install time. Since an automatic update doesn't change either the unins000.exe or unins000.dat files that make up the uninstaller, what would be the appropriate way to delete these new product files at uninstall time?

+1  A: 

The easiest way I see is to have a batch file in your program dir that deletes all files that were added after the installation and is executed on uninstall:

 [UninstallRun]
Filename: cleanup.cmd; WorkingDir: {app}; Flags: shellexec runminimized

UninstallRun commands are executed as the first step of the uninstallation, so this should work fine. If you are bothered by the idea of running a batch script, you can easily create your own cleanup.exe that deletes the files.

When you perform the auto update, you must also update the cleanup file, so that it includes all files that were added with the current update.

Treb
I went with a similar solution. I have a custom DLL the uninstaller calls and export from. I can modify the contents of this exported DLL as update time while maintaining the prototype. The code deletes all the files added by the update.
Charles