2016-07-06 99 views
1

您好,我希望我的Inno安装脚本检测我的程序的安装程序是否正在运行,然后尝试使用unins000.exe卸载我的程序。Inno Setup:检测试图卸载时安装程序是否正在运行

如果我的程序的安装已在运行时尝试卸载我的程序用户,卸载程序应该弹出一个消息框,像Setup is running. Please install using it before uninstalling. Really want to Continue?一条消息,有两个按钮YesNo警告用户。

  • 如果用户按No,卸载程序(unins000.exe)必须关闭。

  • 如果用户按Yes,卸载程序(unins000.exe)必须终止程序安装程序(Setup.exe)的进程并继续进行卸载。

我该如何做到这一点没有任何不稳定?

感谢您的帮助。

回答

0

无法完全中止安装。我不会试图杀死它。让它结束。

[Setup] 
SetupMutex=MySetupsMutexName 

[Code] 

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

谢谢你的工作。 – flavalee

相关问题