INNO SETUP #DESINSTALACAO
Citação:[code]
/////////////////////////////////////////////////////////////////////
function GetUninstallString(): String;
var
sUnInstPath: String;
sUnInstallString: String;
begin
sUnInstPath := ExpandConstant([ô]Software\Microsoft\Windows\CurrentVersion\Uninstall\{#emit SetupSetting([Ô]AppId[Ô])}_is1[ô]);
sUnInstallString := [ô][ô];
if not RegQueryStringValue(HKLM, sUnInstPath, [ô]UninstallString[ô], sUnInstallString) then
RegQueryStringValue(HKCU, sUnInstPath, [ô]UninstallString[ô], sUnInstallString);
Result := sUnInstallString;
end;
/////////////////////////////////////////////////////////////////////
function IsUpgrade(): Boolean;
begin
Result := (GetUninstallString() <> [ô][ô]);
end;
/////////////////////////////////////////////////////////////////////
function UnInstallOldVersion(): Integer;
var
sUnInstallString: String;
iResultCode: Integer;
begin
// Return Values:
// 1 - uninstall string is empty
// 2 - error executing the UnInstallString
// 3 - successfully executed the UnInstallString
// default return value
Result := 0;
// get the uninstall string of the old app
sUnInstallString := GetUninstallString();
if sUnInstallString <> [ô][ô] then begin
sUnInstallString := RemoveQuotes(sUnInstallString);
if Exec(sUnInstallString, [ô]/SILENT /NORESTART /SUPPRESSMSGBOXES[ô],[ô][ô], SW_HIDE, ewWaitUntilTerminated, iResultCode) then
Result := 3
else
Result := 2;
end else
Result := 1;
end;
/////////////////////////////////////////////////////////////////////
procedure CurStepChanged(CurStep: TSetupStep);
begin
if (CurStep=ssInstall) then
begin
if (IsUpgrade()) then
begin
UnInstallOldVersion();
end;
end;
end;
Essa linha
Citação:simplesmente faiz tudo pois ela busca o id app da minha instalação no windows e manda ele mesmo desinstala, ai o único cuidade que devo ter é não perde o AppId da minha primeira instalação, sebre sobrescrever ela mas mesmo assim muito obrigado!sUnInstPath := ExpandConstant([ô]Software\Microsoft\Windows\CurrentVersion\Uninstall\{#emit SetupSetting([Ô]AppId[Ô])}_is1[ô]);