1
votes

Hello, I want my Inno Setup Script to detect if my program's Setup is running before trying to Uninstall my program using unins000.exe.

If my program's Setup is already running when a user trying to Uninstall my program , the Uninstaller should warn user by popping a message box with a message like Setup is running. Please install using it before uninstalling. Really want to Continue? and with two buttons Yes and No.

  • If user presses No, the Uninstaller (unins000.exe) must close.

  • If user presses Yes, the uninstaller (unins000.exe) must kill the process of my program's installer (Setup.exe) and continue with Uninstalling.

How can I do this without any instability?

Thank You for your Help.

1

1 Answers

0
votes

There's no way to cleanly abort the installation. I would not try to kill it. Let it finish.

[Setup]
SetupMutex=MySetupsMutexName

[Code]

function InitializeUninstall(): Boolean;
begin
  while CheckForMutexes('MySetupsMutexName') then
  begin
    MsgBox('Installer is still running', mbError, MB_OK);
  end;
end;