I'm trying to solve the issue where InnoSetup doesn't delete no-longer-used files on upgrade. That is, you install version v1.0 of your application which installs a file that is not used v1.1. During the upgrade to v1.1, the unused files is left behind. Meanwhile, the uninstaller for version v1.0 will remove all of 1.0s files and the uninstaller for 1.1 removes all of 1.1s files. A suggested fix is to programmatically launch the uninstaller for v1.0 during the upgrade.
There's a couple of ways of doing this. One is to use a procedure named CurStepChanged(CurStep: TSetupStep)
. In the procedure you can watch for the ssInstall
step and start the uninstaller there during upgrades. I was having some problems with this, and instead tried using the the BeforeInstall parameter to launch the uninstaller if an upgrade is detected.
Unfortunately, whenever I try this, the installer fails at the very end with a generic
Setup cannot find the specified file
Anyone experienced this and know the cause or have suggestions for further troubleshooting?