gajim.iss 2.9 KB
Newer Older
1 2
[Setup]
AppName=Gajim
3 4
AppVerName=Gajim version 0.11.4
OutputBaseFilename=gajim-0.11.4-1
5 6
DefaultDirName={pf}\Gajim
DefaultGroupName=Gajim
7
UninstallDisplayIcon={app}\src\Gajim.exe
8 9
Compression=lzma
SolidCompression=yes
10
SetupIconFile=data\pixmaps\gajim.ico
11 12 13 14 15 16

[Components]
Name: "main"; Description: "Main Files"; Types: full compact custom; Flags: fixed

[Tasks]
Name: desktopicon; Description: "Create a &desktop icon"; GroupDescription: "Additional icons:"; Components: main
nkour's avatar
nkour committed
17
Name: removeprevious; Description: "Remove previously installed version"; GroupDescription: "Previous install:"; Components: main; Check: IsAlreadyInstalled('Gajim');
18 19

[Files]
20 21 22
Source: "dist\*.pyd"; DestDir: "{app}\src"
Source: "dist\*.dll"; DestDir: "{app}\src"
Source: "dist\*.zip"; DestDir: "{app}\src"
23
Source: "COPYING"; DestDir: "{app}"
24
Source: "THANKS"; DestDir: "{app}"
Yann Leboulanger's avatar
Yann Leboulanger committed
25
Source: "AUTHORS"; DestDir: "{app}"
26
Source: "dist\gajim.exe"; DestDir: "{app}\src"; components: main
27
Source: "dist\history_manager.exe"; DestDir: "{app}\src"; components: main
28
Source: "data\*"; DestDir: "{app}\data"; Flags: recursesubdirs
29
Source: "po\*.mo"; DestDir: "{app}\po"; Flags: recursesubdirs
30 31 32
;Source: "gtk\*"; DestDir: "{app}\src\gtk"; Flags: recursesubdirs
;Source: "gtk\bin\xmlparse.dll"; DestDir: "{app}\src"
;Source: "gtk\bin\xmltok.dll"; DestDir: "{app}\src"
33 34

[Icons]
35
Name: "{group}\Gajim"; Filename: "{app}\src\Gajim.exe"; WorkingDir: "{app}\src"
36
Name: "{group}\History Manager"; Filename: "{app}\src\history_manager.exe"; WorkingDir: "{app}\src"
37
Name: "{group}\Uninstall Gajim"; Filename: "{app}\unins000.exe"; WorkingDir: "{app}"
Yann Leboulanger's avatar
Yann Leboulanger committed
38
Name: "{userdesktop}\Gajim"; Filename: "{app}\src\gajim.exe"; WorkingDir: "{app}\src"; IconFilename: "{app}\data\pixmaps\gajim.ico"; Components: main; Tasks: desktopicon
39 40

[Run]
41
Filename: "{app}\src\gajim.exe"; Description: "Launch application"; Flags: postinstall nowait skipifsilent
42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89

[Code]

function GetUninstallPath( AppID: String ): String;
var
   sPrevPath: String;
begin
  sPrevPath := '';
  if not RegQueryStringValue( HKLM,
    'Software\Microsoft\Windows\CurrentVersion\Uninstall\'+AppID+'_is1',
    'UninstallString', sPrevpath) then
    RegQueryStringValue( HKCU, 'Software\Microsoft\Windows\CurrentVersion\Uninstall\'+AppID+'_is1' ,
      'UninstallString', sPrevpath);

  Result := sPrevPath;
end;

function IsAlreadyInstalled( AppID: String ): Boolean;
var
	sPrevPath: String;
begin
  sPrevPath := GetUninstallPath( AppID );


  if ( Length(sPrevPath) > 0 ) then
    Result:=true
  else
    Result:=false;
 end;

procedure CurStepChanged(CurStep: TSetupStep);
var
	sUninstPath: String;
	sPrevID: String;
	ResultCode: Integer;
begin
  if CurStep = ssInstall then
  begin
    sPrevID := 'Gajim';
    sUninstPath := GetUninstallPath( sprevID );

    if ( Length(sUninstPath) > 0 ) then
    begin
      sUninstPath := RemoveQuotes(sUninstPath);
      Exec( RemoveQuotes(sUninstPath), '/silent', '', SW_SHOW, ewWaitUntilTerminated, ResultCode);
    end;
  end;
end;