80
80
ChangesEnvironment=yes
81
PrivilegesRequired=none
81
; MARKH: PrivilegesRequired=none means it can't be installed by a non-admin
82
; user - but sadly we still need admin - eg, tortoise overlays, installing
83
; into "\Program Files", installing COM objects etc all must be done by an
85
PrivilegesRequired=admin
85
Source: "*.*"; DestDir: "{app}"; Flags: ignoreversion;
86
Source: "lib\*.*"; DestDir: "{app}\lib"; Flags: createallsubdirs ignoreversion recursesubdirs;
87
Source: "doc\*.*"; DestDir: "{app}\doc"; Flags: createallsubdirs ignoreversion recursesubdirs;
88
; Tortoise files - these are at the top as we use 'ExtractTemporaryFile' on
89
; the TortoiseOverlays MSI, and inno documents such files should be at the
90
; start for best performance.
92
; 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)
97
; cog.outl('Source: "tbzrcache.exe"; DestDir: "{app}"; Flags: ignoreversion restartreplace uninsrestartdelete; Components: tortoise')
98
; cog.outl('Source: "tbzrcachew.exe"; DestDir: "{app}"; Flags: ignoreversion restartreplace uninsrestartdelete; Components: tortoise')
99
; cog.outl('Source: "tbzrcommand.exe"; DestDir: "{app}"; Flags: ignoreversion restartreplace uninsrestartdelete; Components: tortoise')
100
; 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')
102
; # Note 'regserver' here appears to run regsvr32 without elevation, which
103
; # 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;')
107
; 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'])
113
; We can't say '*.*' due to optional components.
114
Source: "plugins\*.*"; DestDir: "{app}\\plugins"; Flags: createallsubdirs ignoreversion recursesubdirs restartreplace uninsrestartdelete; Components: plugins
115
Source: "*.bat"; DestDir: "{app}"; Flags: ignoreversion restartreplace uninsrestartdelete;
116
Source: "*.url"; DestDir: "{app}"; Flags: ignoreversion restartreplace uninsrestartdelete;
117
Source: "msvc*.dll"; DestDir: "{app}"; Flags: ignoreversion restartreplace uninsrestartdelete;
118
Source: "bz*.exe"; DestDir: "{app}"; Flags: ignoreversion restartreplace uninsrestartdelete;
119
Source: "Python*.dll"; DestDir: "{app}"; Flags: ignoreversion restartreplace uninsrestartdelete;
120
Source: "lib\*.*"; DestDir: "{app}\lib"; Flags: createallsubdirs ignoreversion recursesubdirs restartreplace uninsrestartdelete;
121
Source: "doc\*.*"; DestDir: "{app}\doc"; Flags: createallsubdirs ignoreversion recursesubdirs restartreplace uninsrestartdelete;
141
Name: "typical"; Description: "A typical installation"
142
Name: "full"; Description: "Full Installation (typical installation plus test utilities)"
143
Name: "compact"; Description: "Compact installation"
144
Name: "custom"; Description: "Custom installation"; Flags: iscustom
108
Name: "main"; Description: "Main Files"; Types: full compact custom; Flags: fixed
147
Name: "main"; Description: "Main Files"; Types: full typical compact custom; Flags: fixed
148
Name: "plugins"; Description: "Default plugins"; Types: full typical custom;
111
151
; cog.outl('Name: "cabundle"; '
112
152
; 'Description: "CA certificates for SSL support"; '
113
; 'Types: full custom')
153
; 'Types: full typical custom')
154
; if "TBZR" in os.environ: # we need a more formal way of controlling this...
155
; cog.outl('Name: "tortoise"; Description: "Windows Shell Extensions (TortoiseBZR)"; Types: full typical custom;')
156
; cog.outl('Name: "debug"; Description: "Test, diagnostic and debugging utilities"; Types: full custom;')
119
162
Name: "{userappdata}\bazaar\2.0"
163
Name: "{app}\plugins"; Flags: uninsalwaysuninstall
123
Name: "{group}\Documentation index"; Filename: "{app}\doc\index.htm"; WorkingDir: "{app}\doc";
167
Name: "{group}\Documentation index"; Filename: "{app}\doc\index.html"; WorkingDir: "{app}\doc";
124
168
Name: "{group}\Bazaar Home Page"; Filename: "{app}\bazaar.url"; Comment: "http://www.bazaar-vcs.org";
125
169
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";
126
Name: "{group}\Uninstall Bazaar"; Filename: "{uninstallexe}"; IconFileName: "{sys}\shell32.dll"; IconIndex: 101; Comment: "Remove Bzr completely";
170
; NOTE: Intent is to change the log file location - the line below will need to change to reflect that.
171
Name: "{group}\Open Bzr log file"; Filename: "notepad.exe"; Parameters: "{userdocs}\.bzr.log"; Comment: "Launch notepad to view the bzr log file";
174
; if "TBZR" in os.environ:
175
; cog.outl(r'Name: "{group}\TortoiseBZR documentation"; Filename: "{app}\doc\tbzr\index.html"; Comment: "Launch TortoiseBZR documentation";')
178
; No Uninstall here - Control Panel will do
130
Name: Path; Description: "Add {app} directory to PATH environment variable";
131
Name: Shell; Description: "Add Bzr context menu to shell"; Flags: unchecked
182
Name: Path; Description: "Add {app} directory to PATH environment variable"
184
; if "TBZR" in os.environ:
185
; cog.outl('Name: TBZRReadme; Description: "View the TortoiseBZR Readme"; Components: tortoise')
191
Root: HKLM; Subkey: "SOFTWARE\Bazaar"; Flags: noerror uninsdeletekey
192
Root: HKLM; Subkey: "SOFTWARE\Bazaar"; ValueName: "InstallPath"; ValueType: string; ValueData: "{app}"; Flags: noerror
193
; Don't write stuff that can be implied
194
;Root: HKLM; Subkey: "SOFTWARE\Bazaar"; ValueName: "BzrlibPath"; ValueType: string; ValueData: "{app}\lib\library.zip\bzrlib"; Flags: noerror
195
;Root: HKLM; Subkey: "SOFTWARE\Bazaar"; ValueName: "PluginsPath"; ValueType: string; ValueData: "{app}\plugins"; Flags: noerror
196
;Root: HKLM; Subkey: "SOFTWARE\Bazaar"; ValueName: "PythonPath"; ValueType: string; ValueData: "{app}\lib\library.zip"; Flags: noerror
197
; [[[cog cog.outl('Root: HKLM; Subkey: "SOFTWARE\Bazaar"; ValueName: "Version"; ValueType: string; ValueData: "%s"; Flags: noerror' % VERSION) ]]]
135
202
Filename: "{app}\bzr_postinstall.exe"; Parameters: "--start-bzr"; Flags: skipifdoesntexist runhidden;
138
; if os.path.isfile('win32_bzr.exe/lib/win32ui.pyd'): # pywin32 mfc wrapper
139
; cog.outl('Filename: "{app}\bzr_postinstall.exe"; '
140
; 'Parameters: "--check-mfc71"; '
141
; 'Flags: skipifdoesntexist skipifsilent runhidden;')
144
203
Filename: "{app}\bzr_postinstall.exe"; Parameters: "--add-path"; Tasks: Path; Flags: skipifdoesntexist skipifsilent runhidden;
145
Filename: "{app}\bzr_postinstall.exe"; Parameters: "--add-shell-menu"; Tasks: Shell; Flags: skipifdoesntexist skipifsilent runhidden;
205
; if "TBZR" in os.environ:
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')
208
; cog.outl(r'Filename: "{app}\doc\tbzr\index.html"; Tasks: TBZRReadme; Flags: shellexec')
149
214
Filename: "{app}\bzr_postinstall.exe"; Parameters: "--delete-path --delete-shell-menu --silent"; Flags: skipifdoesntexist runhidden;
216
; if "TBZR" in os.environ:
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')
225
SHCNF_IDLIST = $0000;
226
SHCNE_ASSOCCHANGED = $08000000;
228
MOVEFILE_DELAY_UNTIL_REBOOT = 4;
230
procedure SHChangeNotify(wEventId, uFlags, dwItem1, dwItem2: Integer);
231
external 'SHChangeNotify@shell32.dll stdcall';
233
function MoveFileEx(lpExistingFileName, lpNewFileName: String; dwFlags: Cardinal): Integer;
234
external 'MoveFileExA@kernel32.dll stdcall';
236
procedure DeleteFileNowOrLater(filename: string);
240
if FileExists(filename) and not DeleteFile(filename) then
241
// can't work out to pass NULL to the API, but an empty string
243
MoveFileEx(filename, '', MOVEFILE_DELAY_UNTIL_REBOOT);
246
procedure ShutdownTBZR;
251
// if "TBZR" not in os.environ:
252
// cog.outl(' Exit; // No TSVN set - exit this procedure.')
255
// ask the cache process to shut-down.
256
hwnd := FindWindowByClassName('TBZRCache_Taskbar');
258
PostMessage(hwnd, WM_QUIT, 1, 0);
261
procedure CurStepChanged(CurStep: TSetupStep);
263
S, tovmsi, fqtovmsi, params: String;
266
if CurStep=ssInstall then begin
268
// In case 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'));
278
if CurStep=ssPostInstall then begin
279
// a couple of post-install tasks
280
if IsComponentSelected('tortoise') then begin
282
// msiexec /i TortoiseOverlays-1.X.X.XXXX-win32.msi /qn /norestart
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.
293
// if "TBZR" in os.environ:
295
// cog.outl("if IsWin64 then")
296
// cog.outl(" tovmsi := '%s'" % os.path.basename(os.environ["TORTOISE_OVERLAYS_MSI_X64"]))
298
// cog.outl(" tovmsi := '%s'" % os.path.basename(os.environ["TORTOISE_OVERLAYS_MSI_WIN32"]))
300
// cog.outl("tovmsi := '';")
303
ExtractTemporaryFile(tovmsi);
304
fqtovmsi := AddBackslash(ExpandConstant('{tmp}')) + tovmsi;
305
params := '/i "' + fqtovmsi + '" /qn /norestart';
306
if not ShellExec('', 'msiexec.exe', params, '', SW_HIDE,
307
ewWaitUntilTerminated, ErrorCode) then
308
MsgBox('Failed to install TortoiseOverlays: ' + SysErrorMessage(ErrorCode),
309
mbInformation, MB_OK);
310
// Ideally we could be bzr_postinstall.exe this way too, but
311
// its needed at uninstall time.
313
// cause explorer to re-fetch handlers.
314
SHChangeNotify(SHCNE_ASSOCCHANGED, SHCNF_IDLIST, 0, 0);
319
function InitializeUninstall(): Boolean;