~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

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

  • Committer: Mark Hammond
  • Date: 2008-12-18 22:15:22 UTC
  • mto: (3932.1.1 prepare-1.11)
  • mto: This revision was merged to the branch mainline in revision 3937.
  • Revision ID: mhammond@skippinet.com.au-20081218221522-yizpnx890yywc2uk
remerge setup changes

Show diffs side-by-side

added added

removed removed

Lines of Context:
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
109
;     cog.outl('Source: "%s\\doc\\index.html"; DestDir: "{app}\\doc\\tbzr"; Flags: ignoreversion; Components: tortoise' % os.environ['TBZR'])
148
152
;              'Description: "CA certificates for SSL support"; '
149
153
;              'Types: full typical custom')
150
154
; 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;')
 
155
;     cog.outl('Name: "tortoise"; Description: "Windows Shell Extensions (TortoiseBZR)"; Types: full typical custom;')
152
156
;     cog.outl('Name: "debug"; Description: "Test, diagnostic and debugging utilities"; Types: full custom;')
153
157
;
154
158
; ]]]
199
203
Filename: "{app}\bzr_postinstall.exe"; Parameters: "--add-path"; Tasks: Path; Flags: skipifdoesntexist skipifsilent runhidden;
200
204
; [[[cog
201
205
; 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"')
 
206
;     cog.outl('Filename: "regsvr32.exe"; Parameters: "/s /i: /n tbzrshellext_x86.dll"; WorkingDir: "{app}"; Components: tortoise; Description: "Registering Tortoise"; StatusMsg: "Registering Tortoise"')
 
207
;     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
208
;     cog.outl(r'Filename: "{app}\doc\tbzr\index.html"; Tasks: TBZRReadme; Flags: shellexec')
204
209
; ]]]
205
210
; [[[end]]]
209
214
Filename: "{app}\bzr_postinstall.exe"; Parameters: "--delete-path --delete-shell-menu --silent"; Flags: skipifdoesntexist runhidden; 
210
215
; [[[cog
211
216
; 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')
 
217
;     cog.outl('Filename: "regsvr32.exe"; Parameters: "/u /s /i: tbzrshellext_x86.dll"; WorkingDir: "{app}"; Components: tortoise; StatusMsg: "Unregistering Tortoise"; Flags: skipifdoesntexist')
 
218
;     cog.outl('Filename: "regsvr32.exe"; Parameters: "/u /s /i: tbzrshellext_x64.dll"; WorkingDir: "{app}"; Components: tortoise; StatusMsg: "Unregistering Tortoise"; Flags: skipifdoesntexist; Check: IsWin64')
213
219
; ]]]
214
220
; [[[end]]]
215
221
 
219
225
  SHCNF_IDLIST = $0000;
220
226
  SHCNE_ASSOCCHANGED = $08000000;
221
227
  WM_QUIT = 18;
 
228
  MOVEFILE_DELAY_UNTIL_REBOOT    = 4;
222
229
 
223
230
procedure SHChangeNotify(wEventId, uFlags, dwItem1, dwItem2: Integer);
224
231
 external 'SHChangeNotify@shell32.dll stdcall';
225
232
 
 
233
function MoveFileEx(lpExistingFileName, lpNewFileName: String; dwFlags: Cardinal): Integer;
 
234
 external 'MoveFileExA@kernel32.dll stdcall';
 
235
 
 
236
procedure DeleteFileNowOrLater(filename: string);
 
237
var
 
238
  rc : Integer;
 
239
begin
 
240
    if FileExists(filename) and not DeleteFile(filename) then
 
241
        // can't work out to pass NULL to the API, but an empty string
 
242
        // seems to work OK.
 
243
        MoveFileEx(filename, '', MOVEFILE_DELAY_UNTIL_REBOOT);
 
244
end;
 
245
 
226
246
procedure ShutdownTBZR;
227
247
var
228
248
    hwnd: HWND;
245
265
begin
246
266
    if CurStep=ssInstall then begin
247
267
        ShutdownTBZR;
 
268
        // Incase the user hasn't uninstalled the old version before
 
269
        // upgrading, we unregister and delete some obsolete files
 
270
        // (regsvr32 remains silent even if the file doesn't exist)
 
271
        Exec('regsvr32.exe', '/s /u "' + ExpandConstant('{app}\tbzr.dll') + '"',
 
272
             '', SW_HIDE, ewWaitUntilTerminated, ErrorCode);
 
273
        DeleteFileNowOrLater(ExpandConstant('{app}\tbzr.dll'));
 
274
        DeleteFileNowOrLater(ExpandConstant('{app}\tbzrtest.exe'));
 
275
        DeleteFileNowOrLater(ExpandConstant('{app}\tbzr_tracer.exe'));
248
276
    end;
249
277
 
250
278
    if CurStep=ssPostInstall then begin
252
280
        if IsComponentSelected('tortoise') then begin
253
281
            // Need to execute:
254
282
            // msiexec /i TortoiseOverlays-1.X.X.XXXX-win32.msi /qn /norestart
 
283
// 64bit notes:
 
284
// We are still primarily a 32bit application - the only 64bit binary is the
 
285
// shell extension, but even then, we need to install the 32bit version too.
 
286
// Thus, we keep tortoise in 32bit "install mode" - meaning we are installed
 
287
// to "\Program Files (x86)".  We don't bother trying to install our single
 
288
// 64bit DLL into "\Program Files" - we use a different DLL name for 32 and
 
289
// 64 bit versions, so nothing will conflict.
 
290
// Note however that on a 64bit OS, we only need the 64bit TortoiseOverlays -
 
291
// the 32bit apps using shell extensions still work fine with that.
255
292
// [[[cog
256
293
// if "TBZR" in os.environ:
257
294
//     import os
258
 
//     cog.outl("tovmsi := '%s';" % os.path.basename(os.environ["TORTOISE_OVERLAYS_MSI_WIN32"]))
 
295
//     cog.outl("if IsWin64 then")
 
296
//     cog.outl("  tovmsi := '%s'" % os.path.basename(os.environ["TORTOISE_OVERLAYS_MSI_X64"]))
 
297
//     cog.outl("else")
 
298
//     cog.outl("  tovmsi := '%s'" % os.path.basename(os.environ["TORTOISE_OVERLAYS_MSI_WIN32"]))
259
299
// else:
260
300
//     cog.outl("tovmsi := '';")
261
301
// ]]]