root/branches/jingle/gajim.iss

Revision 7693, 2.8 kB (checked in by asterix, 2 years ago)

update win installer for 0.11

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