You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
//修改前
function InitializeSetup():boolean;
var
IsAppRunning: boolean;
IsAppRunning1: boolean;
ResultStr: String;
ResultCode: Integer;
begin
Result := true;
// 第二步,安装时判断客户端是否正在运行
begin
Result:= true;//安装程序继续
IsAppRunning:= IsModuleLoaded('YNote.exe');
IsAppRunning1:= IsModuleLoaded('YNote_1.exe');
while IsAppRunning or IsAppRunning1 do
begin
if MsgBox('Detects that "YNote" or "YNote_1" is running' #13#13 'You must close it first and then click "OK" to continue the installation, or you can "Cancel" out!', mbConfirmation, MB_OKCANCEL) = IDOK then
begin
IsAppRunning:= IsModuleLoaded('YNote.exe')
IsAppRunning1:= IsModuleLoaded('YNote_1.exe');
//if RegQueryStringValue(HKLM, 'SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{#MyAppName}_is1', 'UninstallString', ResultStr) then
begin
ResultStr := RemoveQuotes(ResultStr);
Exec(ResultStr, '', '', SW_HIDE, ewWaitUntilTerminated, ResultCode);
end
result := true;
end else begin
IsAppRunning:= false;
Result:= false;//安装程序退出
Exit;
end;
end;
end;
end;
//修改后
function InitializeSetup():boolean;
var
IsAppRunning: boolean;
IsAppRunning1: boolean;
ResultStr: String;
ResultCode: Integer;
begin
Result := true;
// 第二步,安装时判断客户端是否正在运行
begin
Result:= true;//安装程序继续
IsAppRunning:= IsModuleLoaded('{#MyAppProcessName}.exe');
IsAppRunning1:= IsModuleLoaded('{#MyAppProcessName}_1.exe');
while IsAppRunning or IsAppRunning1 do
begin
if MsgBox('九狐-云电销应用程序正在运行,请先关闭程序后安装', mbConfirmation, MB_OKCANCEL) = IDOK then
begin
IsAppRunning:= IsModuleLoaded('{#MyAppProcessName}.exe')
IsAppRunning1:= IsModuleLoaded('{#MyAppProcessName}_1.exe');
end else begin
IsAppRunning:= false;
Result:= false;//安装程序退出
Exit;
end;
end;
end;
if RegQueryStringValue(HKLM, 'SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{#MyAppName}_is1', 'UninstallString', ResultStr) then
begin
ResultStr := RemoveQuotes(ResultStr);
Exec(ResultStr, '', '', SW_HIDE, ewWaitUntilTerminated, ResultCode);
if ResultCode = 1 then
begin
IsAppRunning:= false;
Result:= false;//安装程序退出
Exit;
end;
end
result := true;
end;
关于应用程序名也做了修改。
The text was updated successfully, but these errors were encountered:
说明
在InitializeSetup中有执行卸载的程序,但无法生效,原因是卸载的代码放在了while 判断运行中的循环中,如果没有运行中程序将不会执行卸载程序。
关于应用程序名也做了修改。
The text was updated successfully, but these errors were encountered: