|
Oops, use this one bro.
Test it first on your PC the if it works for 64-bit, upload it then I will test for 32-Bit. I wrote this using notepad, and it is not tested.
function GetUninstallerPath: string;
var
RegStr: string;
begin
RegQueryStringValue(HKEY_LOCAL_MACHINE, 'SOFTWARE\LogrimInstaller\' + '{#AppName}', 'InstallString', RegStr);
Result:=RegStr;
end;
function GetUninstallerExe: string;
var
RegStr: string;
begin
RegQueryStringValue(HKEY_LOCAL_MACHINE, 'SOFTWARE\LogrimInstaller\' + '{#AppName}', 'UninstallString', RegStr);
Result:=RegStr;
end;
function InitializeSetup:boolean;
var
ResultCode: Integer;
begin
if GetUninstallerExe <> '' then begin
case ShowMyPreviusInstall of
mrRepair:Result:=True;
mrUninstall:
begin
Result:=False;
if not Exec(GetUninstallerExe '/Silent', '', SW_HIDE, ewNoWait, ResultCode) then
MsgBox(FmtMessage(SetupMessage(msgUninstallOpenErr or), [GetUninstallerExe]), mbError, MB_OK);
end;
else
Result := False;
end;
end;
end;
procedure CurStepChanged(CurStep: TSetupStep);
begin
if CurStep = ssDone then
begin
RegWriteStringValue(HKLM, 'SOFTWARE\LogrimInstaller\' + '{#AppName}', 'InstallString', ExpandConstant('{app}'));
RegWriteStringValue(HKLM, 'SOFTWARE\LogrimInstaller\' + '{#AppName}', 'UninstallString', ExpandConstant('{uninstallexe}'));
end;
end;
procedure CurUninstallStepChanged(CurUninstallStep: TUninstallStep);
begin
if CurUninstallStep = usUninstall then
RegDeleteKeyIncludingSubkeys(HKLM, 'SOFTWARE\LogrimInstaller\' + '{#AppName}');
end;
|