1

I want to uninstall the previously installed application and its associated files and folders before installing the new one.

I referred this solution Detect and uninstall old version of application in Inno Setup using its version number stored in registry – this is working fine, but not removing files and folders which was created by previously installed version.

Example: User has the old version in c:\test\my program and now if he changes the location directly into c. Then it should delete the old files and folders which are present in c:\test. Any way to do that?

Martin Prikryl
  • 167,268
  • 50
  • 405
  • 846
Trang D
  • 313
  • 4
  • 13

1 Answers1

0

If you want your installer to delete additional files, use [InstallDelete] section.


Obviously better would be if the uninstaller deleted those. So if it is still feasible to fix your uninstaller, use [UninstallDelete] section. Refer to the installation path using the {app} constant.

[UninstallDelete]
Type: files; Name: "{app}\MyProgram.ini"
Martin Prikryl
  • 167,268
  • 50
  • 405
  • 846