Einzelnen Beitrag anzeigen

trivial

Registriert seit: 17. Okt 2005
18 Beiträge
 
#3

Re: Inno Setup deinstallation hilfe

  Alt 19. Okt 2005, 08:06
Hi das habe ich versuch, aber irgentwie passiert da nichts.

Hier mein Prog.
schau dir das mal an.

[Setup]
AppName=Mobile-Telearbeit
AppVerName=Clientpack MobTel Aug 05
AppVersion= NCP Secure VPN/PKI Client 8.04, ISS Proventia Desktop 8.0.614.4
VersionInfoVersion=0.0.0.1
AppPublisher=LDS NRW
AppPublisherURL=http://telearbeit.nrw.de
AppSupportURL=http://telearbeit.nrw.de
AppUpdatesURL=http://telearbeit.nrw.de
DefaultDirName={pf}\MobTelInet
DisableProgramGroupPage=yes
OutputBaseFilename=setup
Compression=lzma
SolidCompression=yes
WizardImageFile=".\LDS.bmp"
LicenseFile=".\Nutzung.txt"
AlwaysRestart=yes
AppID=Mobile-Telearbeit

[Languages]
Name: "ger"; MessagesFile: "compiler:Languages\German.isl"

[Files]
;Quell Dateien
;Source: ".\SecureClient\*"; DestDir: "{app}\SecureClient\"; Flags: ignoreversion recursesubdirs; Tasks: NCP
Source: ".\cacerts\*"; DestDir: "{app}\cacerts\"; Flags: ignoreversion recursesubdirs; Tasks: Cert
Source: ".\copycacerts.bat"; DestDir: "{app}\"; Flags: ignoreversion recursesubdirs; Tasks: Cert
;Source: ".\agentinstall-675.exe"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs; Tasks: Proventia


[Uninstaller]
;Filename: "{app}\uninstall_fwcontrol.bat"; Flags: runhidden waituntilterminated; StatusMsg: "Deinstalliere FWControl...";

[Run]
FileName: "{app}\SecureClient\Disk1\setup.exe"; Parameters: "-s"; Flags: waituntilterminated skipifdoesntexist; StatusMsg: "Installiere NCP Secure VPN/PKI Client..."; Tasks: NCP
FileName: "{app}\copycacerts.bat"; Flags: waituntilterminated skipifdoesntexist; StatusMsg: "Install Zertifikate"; Tasks: Cert
FileName: "{app}\agentinstall-675.exe"; Flags: waituntilterminated skipifdoesntexist; StatusMsg: "Proventia Desktop Installation"; Tasks: Proventia

[Tasks]
Name: NCP; Description: "Soll der NCP Client installiert werden?";
Name: Cert; Description: "Sollen die dazugehörigen Zertifikate importiert werden?";
Name: Proventia; Description: "Soll der Proventia Desktop installiert werden?";

[CustomMessages]
ger.installiert1=Das Programm ist bereits installiert. Deinstallation wird gestartet.
;eng.installiert1=the program is already installed. Uninstallation is going to start.
apid={80FFBE38-0040-4892-7532-F29F7DBECFF8}
[Code]
function GetPathInstalled( AppID: String ): String;
var
sPrevPath: String;
begin
sPrevPath := '';
if not RegQueryStringValue( HKLM,
'Software\Microsoft\Windows\CurrentVersion\Uninsta ll\'+AppID+'_is1',
'Inno Setup: App Path', sPrevpath) then
RegQueryStringValue( HKCU, 'Software\Microsoft\Windows\CurrentVersion\Uninsta ll\'+AppID+'_is1' ,
'Inno Setup: App Path', sPrevpath);

Result := sPrevPath;
end;

//Setup wird begonnen; Wizard nicht!
function InitializeSetup(): Boolean;
var
sPrevPath: String;
sPrevID: String;
sUninstallPath: String;
iResult: Integer;
begin
sUninstallPath := 'Mobile-Telearbeit';
//hier kommt der AppID Schlüssel hin, der unter [Setup] festgelegt wurde
//wenn keiner festgelegt, der AppName
sPrevID := ExpandConstant('{cm:apid}');

sPrevPath := GetPathInstalled( sPrevID );
Result := false;
if ( Length(sPrevPath) > 0 ) then
begin MsgBox( ExpandConstant('{cm:apid}'),mbInformation, MB_OK );
MsgBox( ExpandConstant('{cm:installiert1}'),mbInformation, MB_OK );
if not RegQueryStringValue( HKLM,
'Software\Microsoft\Windows\CurrentVersion\Uninsta ll\'+sPrevID+'_is1',
'UninstallString', sUninstallPath) then
RegQueryStringValue( HKCU, 'Software\Microsoft\Windows\CurrentVersion\Uninsta ll\'+sPrevID+'_is1' ,
'UninstallString', sUninstallPath);
begin
Delete(sUninstallPath,1,1);
Delete(sUninstallPath,Length(sUninstallPath),1);

if not Exec(sUninstallPath, '', '', SW_SHOWNORMAL, ewNoWait, iResult) then
MsgBox('Execution of ''' + sUninstallPath + ''' failed. ' + SysErrorMessage(iResult) + '.', mbError, MB_OK);
end;
end

else
begin
//zum testen eine Ausgabe
Result := true;
end;

end;
  Mit Zitat antworten Zitat