function InitializeSetup():boolean;
var
MykeynotExist:boolean;
ResultCode: Integer;
uicmd: String;
begin
MykeynotExist:= true;
if RegQueryStringValue(HKEY_LOCAL_MACHINE, 'SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{B7F653CF-1BE5-4F40-BA4A-E3BBC6869116}', 'UninstallString', uicmd) then
begin
MyKeynotExist:= false;
MsgBox('安装程序检测到您的系统中已经安装了官方的 {#AppName} '#10#10'你最好先卸载此 {#AppName} 再安装本 {#AppName}',mbInformation,MB_OK)
Exec(ExpandConstant('{pf}\InstallShield Installation Information\{{B7F653CF-1BE5-4F40-BA4A-E3BBC6869116}\Setup.exe'), '', '', SW_Show, ewNoWait, ResultCode);
end;
Result:= MykeynotExist
if RegQueryStringValue(HKEY_LOCAL_MACHINE, 'SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{49D79F54-D485-4011-83FE-FFC938F3DB86}_is1', 'UninstallString', uicmd) then
begin
MyKeynotExist:= false;
Exec(RemoveQuotes(uicmd), '', '', SW_SHOW, ewWaitUntilTerminated, ResultCode);
end;
Result:= MykeynotExist
end;
|