我有一个Inno安装项目,我想检查应用程序是否实际运行,然后卸载它。我尝试了很多方法,但在Windows 7中运行时都会失败。例如,使用psvince.dll
检查notepad.exe
进程的以下脚本始终返回false
,无论记事本是否正在运行。Inno安装程序检查运行过程
我在C#应用程序中使用了psvince.dll
来检查它是否可以在Windows 7下运行,并且没有任何问题。所以我最好的猜测是安装程序无法在启用UAC的情况下正确运行。
[Code]
function IsModuleLoaded(modulename: String): Boolean;
external '[email protected]:psvince.dll stdcall';
function InitializeSetup(): Boolean;
begin
if(Not IsModuleLoaded('ePub.exe')) then
begin
MsgBox('Application is not running.', mbInformation, MB_OK);
Result := true;
end
else
begin
MsgBox('Application is already running. Close it before uninstalling.', mbInformation, MB_OK);
Result := false;
end
end;
我有同样的问题,但AnsiString没有帮助我。 – 2012-03-30 10:37:57