~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to tools/win32/bzr.iss.cog

  • Committer: Tarmac
  • Author(s): Vincent Ladeuil
  • Date: 2017-01-30 14:42:05 UTC
  • mfrom: (6620.1.1 trunk)
  • Revision ID: tarmac-20170130144205-r8fh2xpmiuxyozpv
Merge  2.7 into trunk including fix for bug #1657238 [r=vila]

Show diffs side-by-side

added added

removed removed

Lines of Context:
16
16
; #/Python 2.5 compatibility code
17
17
;
18
18
; import bzrlib
19
 
; try: 
 
19
; try:
20
20
;     VERSION = bzrlib.__version__
21
21
;     AppVerName = 'Bazaar %s' % VERSION
22
 
;     OutputBaseFilename = 'bzr-setup-%s' % VERSION
 
22
;     OutputBaseFilename = 'bzr-%s-setup' % VERSION
23
23
; except:
24
24
;     VERSION = ''
25
25
;     AppVerName = 'Bazaar'
71
71
 
72
72
AppComments="Bazaar: Friendly distributed version control system"
73
73
AppPublisher="Canonical Ltd."
74
 
AppPublisherURL="http://www.bazaar-vcs.org"
75
 
AppSupportURL="http://www.bazaar-vcs.org/BzrSupport"
76
 
AppUpdatesURL="http://www.bazaar-vcs.org/WindowsDownloads"
 
74
AppPublisherURL="http://bazaar.canonical.com"
 
75
AppSupportURL="http://wiki.bazaar.canonical.com/BzrSupport"
 
76
AppUpdatesURL="http://wiki.bazaar.canonical.com/WindowsDownloads"
77
77
; [[[cog cog.outl('AppVersion=%s' % VERSION) ]]]
78
78
; [[[end]]]
79
79
 
90
90
; start for best performance.
91
91
; [[[cog
92
92
; if "TBZR" in os.environ: # we need a more formal way of controlling this...
93
 
;     tovmsi = os.environ["TORTOISE_OVERLAYS_MSI_WIN32"] # point at TortoiseOverlays .msi
94
 
;     cog.outl('Source: "%s"; Flags: dontcopy ignoreversion ; Components: tortoise' % tovmsi)
 
93
;     tovmsi32 = os.environ["TORTOISE_OVERLAYS_MSI_WIN32"] # point at the 32bit TortoiseOverlays .msi
 
94
;     tovmsi64 = os.environ["TORTOISE_OVERLAYS_MSI_X64"] # point at the 64bit TortoiseOverlays .msi
 
95
;     cog.outl('Source: "%s"; Flags: dontcopy ignoreversion ; Components: tortoise' % tovmsi32)
 
96
;     cog.outl('Source: "%s"; Flags: dontcopy ignoreversion ; Components: tortoise' % tovmsi64)
95
97
;     cog.outl('Source: "tbzrcache.exe"; DestDir: "{app}"; Flags: ignoreversion restartreplace uninsrestartdelete; Components: tortoise')
96
98
;     cog.outl('Source: "tbzrcachew.exe"; DestDir: "{app}"; Flags: ignoreversion restartreplace uninsrestartdelete; Components: tortoise')
97
99
;     cog.outl('Source: "tbzrcommand.exe"; DestDir: "{app}"; Flags: ignoreversion restartreplace uninsrestartdelete; Components: tortoise')
98
100
;     cog.outl('Source: "tbzrcommandw.exe"; DestDir: "{app}"; Flags: ignoreversion restartreplace uninsrestartdelete; Components: tortoise')
99
 
;     cog.outl('Source: "tbzr_tracer.exe"; DestDir: "{app}"; Flags: ignoreversion restartreplace uninsrestartdelete; Components: debug')
 
101
;     cog.outl('Source: "tbzrtrace.exe"; DestDir: "{app}"; Flags: ignoreversion restartreplace uninsrestartdelete; Components: debug')
100
102
;     # Note 'regserver' here appears to run regsvr32 without elevation, which
101
103
;     # is no good for us - so we have a [run] entry below.
102
 
;     cog.outl('Source: "tbzr.dll"; DestDir: "{app}"; Flags: ignoreversion regserver restartreplace uninsrestartdelete; Components: tortoise')
 
104
;     cog.outl('Source: "tbzr_old.dll"; DestDir: "{app}"; Flags: ignoreversion restartreplace uninsrestartdelete; Components: tortoise')
 
105
;     cog.outl('Source: "tbzrshellext_x86.dll"; DestDir: "{app}"; Flags: ignoreversion restartreplace uninsrestartdelete; Components: tortoise')
 
106
;     cog.outl('Source: "tbzrshellext_x64.dll"; DestDir: "{app}"; Flags: ignoreversion restartreplace uninsrestartdelete; Components: tortoise; Check: IsWin64;')
103
107
;     cog.outl(r'Source: "plugins\qbzr\*"; DestDir: "{app}\plugins\qbzr"; Flags: createallsubdirs ignoreversion recursesubdirs restartreplace uninsrestartdelete; Components: tortoise')
104
108
;
105
 
;     cog.outl('Source: "%s\\doc\\index.html"; DestDir: "{app}\\doc\\tbzr"; Flags: ignoreversion; Components: tortoise' % os.environ['TBZR'])
 
109
;     cog.outl('Source: "%s\\doc\\*.html"; DestDir: "{app}\\doc\\tbzr"; Flags: ignoreversion; Components: tortoise' % os.environ['TBZR'])
106
110
; ]]]
107
111
; [[[end]]]
108
112
 
133
137
; ]]]
134
138
; [[[end]]]
135
139
 
 
140
; imageformats plugins for PyQt4
 
141
; [[[cog
 
142
; plug_dir = os.path.join(os.path.dirname(cog.inFile), # $(bzr_src_root)/tools/win32
 
143
;                         '..', '..', 'win32_bzr.exe', 'imageformats')
 
144
; if os.path.isdir(plug_dir):
 
145
;     cog.outl('Source: "imageformats\\*.*"; DestDir: "{app}\\imageformats"; '
 
146
;              'Flags: createallsubdirs ignoreversion recursesubdirs restartreplace uninsrestartdelete;')
 
147
; else:
 
148
;     cog.msg('imageformats plugins for PyQt4 not found')
 
149
; ]]]
 
150
; [[[end]]]
 
151
 
136
152
[Types]
137
153
Name: "typical"; Description: "A typical installation"
138
154
Name: "full"; Description: "Full Installation (typical installation plus test utilities)"
148
164
;              'Description: "CA certificates for SSL support"; '
149
165
;              'Types: full typical custom')
150
166
; if "TBZR" in os.environ: # we need a more formal way of controlling this...
151
 
;     cog.outl('Name: "tortoise"; Description: "Windows Shell Extensions (TortoiseBZR) - EXPERIMENTAL"; Types: full typical custom;')
 
167
;     cog.outl('Name: "tortoise"; Description: "Windows Shell Extensions (TortoiseBZR)"; Types: full typical custom;')
152
168
;     cog.outl('Name: "debug"; Description: "Test, diagnostic and debugging utilities"; Types: full custom;')
153
169
;
154
170
; ]]]
161
177
 
162
178
[Icons]
163
179
Name: "{group}\Documentation index"; Filename: "{app}\doc\index.html"; WorkingDir: "{app}\doc";
164
 
Name: "{group}\Bazaar Home Page"; Filename: "{app}\bazaar.url"; Comment: "http://www.bazaar-vcs.org";
 
180
Name: "{group}\Bazaar Home Page"; Filename: "{app}\bazaar.url"; Comment: "http://bazaar.canonical.com";
165
181
Name: "{group}\Start Bzr in cmd shell"; Filename: "{cmd}"; Parameters: "/K start_bzr.bat"; WorkingDir: "{app}"; IconFilename: "{app}\bzr.exe"; Comment: "Open new Bzr session";
166
182
; NOTE: Intent is to change the log file location - the line below will need to change to reflect that.
167
183
Name: "{group}\Open Bzr log file"; Filename: "notepad.exe"; Parameters: "{userdocs}\.bzr.log"; Comment: "Launch notepad to view the bzr log file";
199
215
Filename: "{app}\bzr_postinstall.exe"; Parameters: "--add-path"; Tasks: Path; Flags: skipifdoesntexist skipifsilent runhidden;
200
216
; [[[cog
201
217
; if "TBZR" in os.environ:
202
 
;     cog.outl('Filename: "regsvr32.exe"; Parameters: "/s tbzr.dll"; WorkingDir: "{app}"; Components: tortoise; Description: "Registering Tortoise"; StatusMsg: "Registering Tortoise"')
 
218
;     cog.outl('Filename: "regsvr32.exe"; Parameters: "/s /i: /n tbzrshellext_x86.dll"; WorkingDir: "{app}"; Components: tortoise; Description: "Registering Tortoise"; StatusMsg: "Registering Tortoise"')
 
219
;     cog.outl('Filename: "regsvr32.exe"; Parameters: "/s /i: /n tbzrshellext_x64.dll"; WorkingDir: "{app}"; Components: tortoise; Description: "Registering Tortoise"; StatusMsg: "Registering Tortoise"; Check: IsWin64')
203
220
;     cog.outl(r'Filename: "{app}\doc\tbzr\index.html"; Tasks: TBZRReadme; Flags: shellexec')
204
221
; ]]]
205
222
; [[[end]]]
206
223
 
207
224
 
208
225
[UninstallRun]
209
 
Filename: "{app}\bzr_postinstall.exe"; Parameters: "--delete-path --delete-shell-menu --silent"; Flags: skipifdoesntexist runhidden; 
 
226
Filename: "{app}\bzr_postinstall.exe"; Parameters: "--delete-path --delete-shell-menu --silent"; Flags: skipifdoesntexist runhidden;
210
227
; [[[cog
211
228
; if "TBZR" in os.environ:
212
 
;     cog.outl('Filename: "regsvr32.exe"; Parameters: "/u /s tbzr.dll"; WorkingDir: "{app}"; Components: tortoise; StatusMsg: "Unregistering Tortoise"; Flags: skipifdoesntexist')
 
229
;     cog.outl('Filename: "regsvr32.exe"; Parameters: "/u /s /i: tbzrshellext_x86.dll"; WorkingDir: "{app}"; Components: tortoise; StatusMsg: "Unregistering Tortoise"; Flags: skipifdoesntexist')
 
230
;     cog.outl('Filename: "regsvr32.exe"; Parameters: "/u /s /i: tbzrshellext_x64.dll"; WorkingDir: "{app}"; Components: tortoise; StatusMsg: "Unregistering Tortoise"; Flags: skipifdoesntexist; Check: IsWin64')
213
231
; ]]]
214
232
; [[[end]]]
215
233
 
219
237
  SHCNF_IDLIST = $0000;
220
238
  SHCNE_ASSOCCHANGED = $08000000;
221
239
  WM_QUIT = 18;
 
240
  MOVEFILE_DELAY_UNTIL_REBOOT    = 4;
222
241
 
223
242
procedure SHChangeNotify(wEventId, uFlags, dwItem1, dwItem2: Integer);
224
243
 external 'SHChangeNotify@shell32.dll stdcall';
225
244
 
 
245
function MoveFileEx(lpExistingFileName, lpNewFileName: String; dwFlags: Cardinal): Integer;
 
246
 external 'MoveFileExA@kernel32.dll stdcall';
 
247
 
 
248
procedure DeleteFileNowOrLater(filename: string);
 
249
var
 
250
  rc : Integer;
 
251
begin
 
252
    if FileExists(filename) and not DeleteFile(filename) then
 
253
        // can't work out to pass NULL to the API, but an empty string
 
254
        // seems to work OK.
 
255
        MoveFileEx(filename, '', MOVEFILE_DELAY_UNTIL_REBOOT);
 
256
end;
 
257
 
226
258
procedure ShutdownTBZR;
227
259
var
228
260
    hwnd: HWND;
245
277
begin
246
278
    if CurStep=ssInstall then begin
247
279
        ShutdownTBZR;
 
280
        // In case the user hasn't uninstalled the old version before
 
281
        // upgrading, we unregister and delete some obsolete files
 
282
        // (regsvr32 remains silent even if the file doesn't exist)
 
283
        Exec('regsvr32.exe', '/s /u "' + ExpandConstant('{app}\tbzr.dll') + '"',
 
284
             '', SW_HIDE, ewWaitUntilTerminated, ErrorCode);
 
285
        DeleteFileNowOrLater(ExpandConstant('{app}\tbzr.dll'));
 
286
        DeleteFileNowOrLater(ExpandConstant('{app}\tbzrtest.exe'));
 
287
        DeleteFileNowOrLater(ExpandConstant('{app}\tbzr_tracer.exe'));
248
288
    end;
249
289
 
250
290
    if CurStep=ssPostInstall then begin
252
292
        if IsComponentSelected('tortoise') then begin
253
293
            // Need to execute:
254
294
            // msiexec /i TortoiseOverlays-1.X.X.XXXX-win32.msi /qn /norestart
 
295
// 64bit notes:
 
296
// We are still primarily a 32bit application - the only 64bit binary is the
 
297
// shell extension, but even then, we need to install the 32bit version too.
 
298
// Thus, we keep tortoise in 32bit "install mode" - meaning we are installed
 
299
// to "\Program Files (x86)".  We don't bother trying to install our single
 
300
// 64bit DLL into "\Program Files" - we use a different DLL name for 32 and
 
301
// 64 bit versions, so nothing will conflict.
 
302
// Note however that on a 64bit OS, we only need the 64bit TortoiseOverlays -
 
303
// the 32bit apps using shell extensions still work fine with that.
255
304
// [[[cog
256
305
// if "TBZR" in os.environ:
257
306
//     import os
258
 
//     cog.outl("tovmsi := '%s';" % os.path.basename(os.environ["TORTOISE_OVERLAYS_MSI_WIN32"]))
 
307
//     cog.outl("if IsWin64 then")
 
308
//     cog.outl("  tovmsi := '%s'" % os.path.basename(os.environ["TORTOISE_OVERLAYS_MSI_X64"]))
 
309
//     cog.outl("else")
 
310
//     cog.outl("  tovmsi := '%s'" % os.path.basename(os.environ["TORTOISE_OVERLAYS_MSI_WIN32"]))
259
311
// else:
260
312
//     cog.outl("tovmsi := '';")
261
313
// ]]]
276
328
end;
277
329
 
278
330
 
279
 
function InitializeUninstall(): Boolean; 
 
331
function InitializeUninstall(): Boolean;
280
332
begin
281
333
    ShutdownTBZR;
282
334
    result := True;