root/branches/gajim_0.9/gajim.iss

Revision 4290, 2.5 kB (checked in by nk, 3 years ago)

typo

Line 
1[Setup]
2AppName=Gajim
3AppVerName=Gajim version 0.9
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: "dist\gajim.exe"; DestDir: "{app}\src"; components: main
24Source: "dist\*.glade"; DestDir: "{app}\src"
25Source: "data\*"; DestDir: "{app}\data"; Flags: recursesubdirs
26Source: "po\*.mo"; DestDir: "{app}\po"; Flags: recursesubdirs
27
28[Icons]
29Name: "{group}\Gajim"; Filename: "{app}\src\Gajim.exe"; WorkingDir: "{app}\src"
30Name: "{group}\Uninstall Gajim"; Filename: "{app}\unins000.exe"; WorkingDir: "{app}"
31Name: "{userdesktop}\Gajim"; Filename: "{app}\src\gajim.exe"; WorkingDir: "{app}\src"; IconFilename: "{app}\data\pixmaps\gajim.ico"; Components: main; Tasks: desktopicon
32
33[Run]
34Filename: "{app}\src\gajim.exe"; Description: "Launch application"; Flags: postinstall nowait skipifsilent
35
36[Code]
37
38function GetUninstallPath( AppID: String ): String;
39var
40   sPrevPath: String;
41begin
42  sPrevPath := '';
43  if not RegQueryStringValue( HKLM,
44    'Software\Microsoft\Windows\CurrentVersion\Uninstall\'+AppID+'_is1',
45    'UninstallString', sPrevpath) then
46    RegQueryStringValue( HKCU, 'Software\Microsoft\Windows\CurrentVersion\Uninstall\'+AppID+'_is1' ,
47      'UninstallString', sPrevpath);
48
49  Result := sPrevPath;
50end;
51
52function IsAlreadyInstalled( AppID: String ): Boolean;
53var
54        sPrevPath: String;
55begin
56  sPrevPath := GetUninstallPath( AppID );
57
58
59  if ( Length(sPrevPath) > 0 ) then
60    Result:=true
61  else
62    Result:=false;
63 end;
64
65procedure CurStepChanged(CurStep: TSetupStep);
66var
67        sUninstPath: String;
68        sPrevID: String;
69        ResultCode: Integer;
70begin
71  if CurStep = ssInstall then
72  begin
73    sPrevID := 'Gajim';
74    sUninstPath := GetUninstallPath( sprevID );
75
76    if ( Length(sUninstPath) > 0 ) then
77    begin
78      sUninstPath := RemoveQuotes(sUninstPath);
79      Exec( RemoveQuotes(sUninstPath), '/silent', '', SW_SHOW, ewWaitUntilTerminated, ResultCode);
80    end;
81  end;
82end;
Note: See TracBrowser for help on using the browser.