I am trying to configure Inno setup for my software (this is a C# software). I plan to release many versions of my software, I would like to change the Inno setup installer interface if an older version of my application is already installed on the computer. In this case, the user shouldn't be able to change the install directory.
There are four cases:
First case: this is the first installation of my product, Inno setup should proceed normally.
Second case: the product is already installed AND the installer contains a newer version. The user cannot choose the destination folder. He can just run the update.
Third case: If the installer contains an older version than the installed one, the update will be disabled and a message should be displayed.
Fourth case: The installer version is the same than the installed version. The user can repair his actual version if needed.
Is it possible to do that with InnoSetup?
If you want to have some feedback for user you can try something like that. First of all, your update should have the same
AppId
name as your Main App. Then you can set some checks, that will display messages to inform user about the state.Inno Setup already handles cases 1, 2, and 4 automatically if your
AppID
is kept the same for the life of the application.You can also hide the directory and group pages using the following
[Setup]
directives:See this ISXKB article for more details.
For case 3, assuming your files are versioned correctly, Inno won't downgrade anything, but it won't actually warn the user. To do that, you will need to add code to check this, most likely in the
InitializeSetup()
event function.