![](/uploads/1/2/6/6/126685198/911883116.jpg)
.Inno Setup CompilerDownload and install Inno Setup.To install it, click on 'Run Inno Setup'Creating the installerUpon launching the software, a window appears to ask you what you want to do, in our case select 'create a new script file using the Script Wizard.'
If this is set to yes, Setup will not show the Select Destination Location wizard page. If this is set to auto, at startup Setup will look in the registry to see if the same application is already installed, and if so, it will not show the Select Destination Location wizard page. If the Select Destination Location wizard page is not shown, it will always use the default directory name.
14 Mar 2018CPOL
Does your app create extra files post install? Now clean them up!
Introduction
Within its lifecycle, an app can create files and folders which may not be of any value to the user once uninstalled. Common practice is to simply ignore the extras and just uninstall what has been installed. Some of the pitfalls of proceeding any further are mentioned in the comments to this answer, yet the code at ISXKB prompted this author to further expand upon the scenario.
Requirements
The reader is best served by having or at least intending to build an active installation with Inno Setup. Very friendly and intuitive interface, along with extensive documentation. Determine where and how files relating to your app are created, and what purpose they will have once the user is no longer using your software.
![Setup Setup](/uploads/1/2/6/6/126685198/125693635.png)
Using the Code
Download and paste the code in the code section of the .iss script. The dialog driven script is run when the app is uninstalled.
The chief point of interest is at the bottom of the code where paths containing Inno defined constants can be inserted or removed:
![Inno Inno](http://www.ita-software.com/papers/Borup_InnoSetup_files/image028.jpg)
The following snippet is for a VB compilation:
The Inno Delete Functions work very well, however they only return false on fail, so we can assume in most situations, the reason is either in-use or not accessible.
If an Updater is used (see below), also consider replicating the above code in the Updater, as depending on the Setup & Updater settings, the code can be removed from the setup uninstall binary (typically unins000.exe) when the Updater executes.
Some of the language dialogs were made with Google Translate so any corrections to them are welcome.
Apologies to non Spanish/German/English subscribers, as those languages were the only ones on offer at ISXKB.
Addendum
The following section is for anyone interested using Inno to update an application. An updater is a separate iss script typically run from {tmp} (inno's temp sub-directory for MyApp prefixed is-.) to update the installation {App} from an external source -e.g. an http server.
Updaters do not have an uninstall as such as they are defined to operate on
MyApp
only, but each time an updater is run from {tmp}, any temporary files related to the install session are created in that folder.In the usual course of installation, these temporary folders are removed after install, but in the case of updating MyApp, Inno (5.59) generates an (Abort-Ignore-Retry) error when attempting to remove an Updater {srcexe} from {tmp} in the
ssPostInstall
step with the deleteafterinstall flag thus:So here's a method to silently remove it after reboot:
![](/uploads/1/2/6/6/126685198/911883116.jpg)