16
16
; #/Python 2.5 compatibility code
20
20
; VERSION = bzrlib.__version__
21
21
; AppVerName = 'Bazaar %s' % VERSION
22
; OutputBaseFilename = 'bzr-%s-setup' % VERSION
22
; OutputBaseFilename = 'bzr-setup-%s' % VERSION
25
25
; AppVerName = 'Bazaar'
43
43
SetupIconFile="..\bzr.ico"
44
44
InfoBeforeFile="..\tools\win32\info.txt"
45
InfoAfterFile="..\tools\win32\survey.txt"
46
47
VersionInfoCompany="Canonical Ltd."
47
48
VersionInfoCopyright="Canonical Ltd., 2005-2008"
90
91
; start for best performance.
92
93
; if "TBZR" in os.environ: # we need a more formal way of controlling this...
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)
94
; tovmsi = os.environ["TORTOISE_OVERLAYS_MSI_WIN32"] # point at TortoiseOverlays .msi
95
; cog.outl('Source: "%s"; Flags: dontcopy ignoreversion ; Components: tortoise' % tovmsi)
97
96
; cog.outl('Source: "tbzrcache.exe"; DestDir: "{app}"; Flags: ignoreversion restartreplace uninsrestartdelete; Components: tortoise')
98
97
; cog.outl('Source: "tbzrcachew.exe"; DestDir: "{app}"; Flags: ignoreversion restartreplace uninsrestartdelete; Components: tortoise')
99
98
; cog.outl('Source: "tbzrcommand.exe"; DestDir: "{app}"; Flags: ignoreversion restartreplace uninsrestartdelete; Components: tortoise')
100
99
; cog.outl('Source: "tbzrcommandw.exe"; DestDir: "{app}"; Flags: ignoreversion restartreplace uninsrestartdelete; Components: tortoise')
101
; cog.outl('Source: "tbzrtrace.exe"; DestDir: "{app}"; Flags: ignoreversion restartreplace uninsrestartdelete; Components: debug')
100
; cog.outl('Source: "tbzr_tracer.exe"; DestDir: "{app}"; Flags: ignoreversion restartreplace uninsrestartdelete; Components: debug')
102
101
; # Note 'regserver' here appears to run regsvr32 without elevation, which
103
102
; # is no good for us - so we have a [run] entry below.
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
; cog.outl('Source: "tbzr.dll"; DestDir: "{app}"; Flags: ignoreversion regserver restartreplace uninsrestartdelete; Components: tortoise')
107
104
; cog.outl(r'Source: "plugins\qbzr\*"; DestDir: "{app}\plugins\qbzr"; Flags: createallsubdirs ignoreversion recursesubdirs restartreplace uninsrestartdelete; Components: tortoise')
109
; cog.outl('Source: "%s\\doc\\*.html"; DestDir: "{app}\\doc\\tbzr"; Flags: ignoreversion; Components: tortoise' % os.environ['TBZR'])
106
; cog.outl('Source: "%s\\doc\\index.html"; DestDir: "{app}\\doc\\tbzr"; Flags: ignoreversion; Components: tortoise' % os.environ['TBZR'])
140
; imageformats plugins for PyQt4
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;')
148
; cog.msg('imageformats plugins for PyQt4 not found')
153
138
Name: "typical"; Description: "A typical installation"
154
139
Name: "full"; Description: "Full Installation (typical installation plus test utilities)"
164
149
; 'Description: "CA certificates for SSL support"; '
165
150
; 'Types: full typical custom')
166
151
; if "TBZR" in os.environ: # we need a more formal way of controlling this...
167
; cog.outl('Name: "tortoise"; Description: "Windows Shell Extensions (TortoiseBZR)"; Types: full typical custom;')
152
; cog.outl('Name: "tortoise"; Description: "Windows Shell Extensions (TortoiseBZR) - EXPERIMENTAL"; Types: full typical custom;')
168
153
; cog.outl('Name: "debug"; Description: "Test, diagnostic and debugging utilities"; Types: full custom;')
194
179
Name: Path; Description: "Add {app} directory to PATH environment variable"
180
Name: Shell; Description: "Add Bzr context menu to shell"; Flags: unchecked
196
182
; if "TBZR" in os.environ:
197
183
; cog.outl('Name: TBZRReadme; Description: "View the TortoiseBZR Readme"; Components: tortoise')
214
200
Filename: "{app}\bzr_postinstall.exe"; Parameters: "--start-bzr"; Flags: skipifdoesntexist runhidden;
215
201
Filename: "{app}\bzr_postinstall.exe"; Parameters: "--add-path"; Tasks: Path; Flags: skipifdoesntexist skipifsilent runhidden;
202
Filename: "{app}\bzr_postinstall.exe"; Parameters: "--add-shell-menu"; Tasks: Shell; Flags: skipifdoesntexist skipifsilent runhidden;
217
204
; if "TBZR" in os.environ:
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')
205
; cog.outl('Filename: "regsvr32.exe"; Parameters: "/s tbzr.dll"; WorkingDir: "{app}"; Components: tortoise; Description: "Registering Tortoise"; StatusMsg: "Registering Tortoise"')
220
206
; cog.outl(r'Filename: "{app}\doc\tbzr\index.html"; Tasks: TBZRReadme; Flags: shellexec')
226
Filename: "{app}\bzr_postinstall.exe"; Parameters: "--delete-path --delete-shell-menu --silent"; Flags: skipifdoesntexist runhidden;
228
213
; if "TBZR" in os.environ:
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')
214
; cog.outl('Filename: "regsvr32.exe"; Parameters: "/u /s tbzr.dll"; WorkingDir: "{app}"; Components: tortoise; StatusMsg: "Unregistering Tortoise"; Flags: skipifdoesntexist')
237
220
SHCNF_IDLIST = $0000;
238
221
SHCNE_ASSOCCHANGED = $08000000;
240
MOVEFILE_DELAY_UNTIL_REBOOT = 4;
242
224
procedure SHChangeNotify(wEventId, uFlags, dwItem1, dwItem2: Integer);
243
225
external 'SHChangeNotify@shell32.dll stdcall';
245
function MoveFileEx(lpExistingFileName, lpNewFileName: String; dwFlags: Cardinal): Integer;
246
external 'MoveFileExA@kernel32.dll stdcall';
248
procedure DeleteFileNowOrLater(filename: string);
252
if FileExists(filename) and not DeleteFile(filename) then
253
// can't work out to pass NULL to the API, but an empty string
255
MoveFileEx(filename, '', MOVEFILE_DELAY_UNTIL_REBOOT);
258
227
procedure ShutdownTBZR;
278
247
if CurStep=ssInstall then begin
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'));
290
251
if CurStep=ssPostInstall then begin
292
253
if IsComponentSelected('tortoise') then begin
293
254
// Need to execute:
294
255
// msiexec /i TortoiseOverlays-1.X.X.XXXX-win32.msi /qn /norestart
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.
305
257
// if "TBZR" in os.environ:
307
// cog.outl("if IsWin64 then")
308
// cog.outl(" tovmsi := '%s'" % os.path.basename(os.environ["TORTOISE_OVERLAYS_MSI_X64"]))
310
// cog.outl(" tovmsi := '%s'" % os.path.basename(os.environ["TORTOISE_OVERLAYS_MSI_WIN32"]))
259
// cog.outl("tovmsi := '%s';" % os.path.basename(os.environ["TORTOISE_OVERLAYS_MSI_WIN32"]))
312
261
// cog.outl("tovmsi := '';")