root/branches/gajim_0.11/gajim.iss

Revision 7992, 2.8 kB (checked in by asterix, 1 year ago)

--

Line 
1 [Setup]
2 AppName=Gajim
3 AppVerName=Gajim version 0.11.1+gtk-1
4 OutputBaseFilename=gajim-0.11.1+gtk-1
5 DefaultDirName={pf}\Gajim
6 DefaultGroupName=Gajim
7 UninstallDisplayIcon={app}\src\Gajim.exe
8 Compression=lzma
9 SolidCompression=yes
10 SetupIconFile=data\pixmaps\gajim.ico
11
12 [Components]
13 Name: "main"; Description: "Main Files"; Types: full compact custom; Flags: fixed
14
15 [Tasks]
16 Name: desktopicon; Description: "Create a &desktop icon"; GroupDescription: "Additional icons:"; Components: main
17 Name: removeprevious; Description: "Remove previously installed version"; GroupDescription: "Previous install:"; Components: main; Check: IsAlreadyInstalled('Gajim');
18
19 [Files]
20 Source: "dist\*.pyd"; DestDir: "{app}\src"
21 Source: "dist\*.dll"; DestDir: "{app}\src"
22 Source: "dist\*.zip"; DestDir: "{app}\src"
23 Source: "COPYING"; DestDir: "{app}"
24 Source: "THANKS"; DestDir: "{app}"
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 Source: "gtk\*"; DestDir: "{app}\src\gtk"; Flags: recursesubdirs
31
32 [Icons]
33 Name: "{group}\Gajim"; Filename: "{app}\src\Gajim.exe"; WorkingDir: "{app}\src"
34 Name: "{group}\History Manager"; Filename: "{app}\src\history_manager.exe"; WorkingDir: "{app}\src"
35 Name: "{group}\Uninstall Gajim"; Filename: "{app}\unins000.exe"; WorkingDir: "{app}"
36 Name: "{userdesktop}\Gajim"; Filename: "{app}\src\gajim.exe"; WorkingDir: "{app}\src"; IconFilename: "{app}\data\pixmaps\gajim.ico"; Components: main; Tasks: desktopicon
37
38 [Run]
39 Filename: "{app}\src\gajim.exe"; Description: "Launch application"; Flags: postinstall nowait skipifsilent
40
41 [Code]
42
43 function GetUninstallPath( AppID: String ): String;
44 var
45    sPrevPath: String;
46 begin
47   sPrevPath := '';
48   if not RegQueryStringValue( HKLM,
49     'Software\Microsoft\Windows\CurrentVersion\Uninstall\'+AppID+'_is1',
50     'UninstallString', sPrevpath) then
51     RegQueryStringValue( HKCU, 'Software\Microsoft\Windows\CurrentVersion\Uninstall\'+AppID+'_is1' ,
52       'UninstallString', sPrevpath);
53
54   Result := sPrevPath;
55 end;
56
57 function IsAlreadyInstalled( AppID: String ): Boolean;
58 var
59         sPrevPath: String;
60 begin
61   sPrevPath := GetUninstallPath( AppID );
62
63
64   if ( Length(sPrevPath) > 0 ) then
65     Result:=true
66   else
67     Result:=false;
68  end;
69
70 procedure CurStepChanged(CurStep: TSetupStep);
71 var
72         sUninstPath: String;
73         sPrevID: String;
74         ResultCode: Integer;
75 begin
76   if CurStep = ssInstall then
77   begin
78     sPrevID := 'Gajim';
79     sUninstPath := GetUninstallPath( sprevID );
80
81     if ( Length(sUninstPath) > 0 ) then
82     begin
83       sUninstPath := RemoveQuotes(sUninstPath);
84       Exec( RemoveQuotes(sUninstPath), '/silent', '', SW_SHOW, ewWaitUntilTerminated, ResultCode);
85     end;
86   end;
87 end;
Note: See TracBrowser for help on using the browser.