View Single Post
  #36  
Old 16-11-2014, 06:01
Razor12911's Avatar
Razor12911 Razor12911 is offline
Noob
 
Join Date: Jul 2012
Location: South Africa
Posts: 3,749
Thanks: 2,170
Thanked 11,206 Times in 2,307 Posts
Razor12911 is on a distinguished road
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;
Reply With Quote
The Following User Says Thank You to Razor12911 For This Useful Post:
Logrim (17-11-2014)