While you can uninstall before upgrading, this is not recommended.
Instead, you should use [InstallDelete] to remove unnecessary files. You need to know what files they are.
[InstallDelete] Type: files; Name: {app}\foo.bar Type: files; Name: {app}\baz\quux.txt
While wildcards can be used, this is not recommended (especially not masks that ignore file extensions), as it may inadvertently delete user files, especially if {app} is unexpected somewhere (they may be installed directly in the Windows folder )
As for your second statement, “If you delete the updated installation, files from the old installations will not be deleted.” This is simply not true. As long as you save the AppId folder and destination folder, the deletion will delete all previously installed files even after updating. To ensure this, make the following settings:
[Setup] DisableDirPage=auto
In addition, provided that you have not yet released this application, you should instead change its DefaultDirName to {userpf}\YourAppName ; This is the best place to install applications for each user. (If you have already released the application, it is still safe to change this value provided that you do not change the AppId value, but you will have to keep in mind that the old installations will remain on the older path.)
Miral
source share