The first time I run it everything is fine, the second one it should not allow me isntall it since it's already installed. Instead of that it doesn't allow me to select the directory and overwrite the previous install.For what I know if it uses the same App ID (as I do) it should not allow the user to install twice, or at least warn them that they are going to be "repairing" the previous installation.
Seems like Federico wants Inno Setup to mimic Windows Installer (MSI engine) behavior.
On Friday, October 28, 2022, 16:42:50, 'Stainless Games' via innosetup wrote:
Hello everyone, thank you for the feedback. How can I avoid the installer trying to install the same app with the same version number twice? At least prompt the user "You already have this app. Press continue if you want to repair it". because I've been getting a lot of people running the installer over and over thinking it wasn't installed. Since it's a heavy build with a lot of post-install things I want to avoid that from happening unintentionally.
For a start, maybe make it more obvious that the program is installed (unfortunately, many users think the Setup failed if you follow Microsoft's recommendations, and don't put an icon on the desktop)?
Otherwise, use [Code] and put a check in InitializeSetup, something like this:
[Code]
const
UninsKey = 'SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\AppId_is1';
function InitializeSetup(): Boolean;
var Version: String;
begin
Result := True; //allow install by default
if RegQueryStringValue(HKLM, UninsKey, 'DisplayVersion', Version) then
if Version = '{#MyAppVersion}' then
if SuppressibleMsgBox('{#MyAppName} {#MyAppVersion} is already installed. Do you want to reinstall?',mbConfirmation,MB_YESNO,IDYES) = IDNO then
Result := False;
end;