/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar
1821.1.1 by Alexander Belchenko
win32 installer for bzr.dev.0.9
1
; Script for Inno Setup installer
6622.1.18 by Jelmer Vernooij
Rename some windows stuff.
2
; [[[cog cog.outl('; This script created by Cog from brz.iss.cog source') ]]]
1821.1.1 by Alexander Belchenko
win32 installer for bzr.dev.0.9
3
; [[[end]]]
4
; Cog is http://www.nedbatchelder.com/code/cog/
5
6
[Setup]
6622.1.18 by Jelmer Vernooij
Rename some windows stuff.
7
AppName=Breezy
1821.1.1 by Alexander Belchenko
win32 installer for bzr.dev.0.9
8
9
; [[[cog
2231.1.1 by Alexander Belchenko
Python 2.5 fixes for win32 installer
10
; # Python 2.5 compatibility code
11
; import os
12
; import sys
13
; cwd = os.getcwd()
14
; if cwd not in sys.path:
15
;     sys.path.insert(0, cwd)
16
; #/Python 2.5 compatibility code
17
;
6622.1.34 by Jelmer Vernooij
Rename brzlib => breezy.
18
; import breezy
4580.5.16 by John Arbash Meinel
Change the all-in-one installer name.
19
; try:
6622.1.34 by Jelmer Vernooij
Rename brzlib => breezy.
20
;     VERSION = breezy.__version__
6622.1.18 by Jelmer Vernooij
Rename some windows stuff.
21
;     AppVerName = 'Breezy %s' % VERSION
22
;     OutputBaseFilename = 'brz-%s-setup' % VERSION
1821.1.1 by Alexander Belchenko
win32 installer for bzr.dev.0.9
23
; except:
24
;     VERSION = ''
6622.1.18 by Jelmer Vernooij
Rename some windows stuff.
25
;     AppVerName = 'Breezy'
26
;     OutputBaseFilename = 'brz-setup'
1821.1.1 by Alexander Belchenko
win32 installer for bzr.dev.0.9
27
;
28
; cog.outl('AppVerName=%s' % AppVerName)
29
; cog.outl('OutputBaseFilename=%s' % OutputBaseFilename)
30
; ]]]
6622.1.18 by Jelmer Vernooij
Rename some windows stuff.
31
AppVerName=Breezy
32
OutputBaseFilename=brz-setup
1821.1.1 by Alexander Belchenko
win32 installer for bzr.dev.0.9
33
; [[[end]]]
34
6622.1.18 by Jelmer Vernooij
Rename some windows stuff.
35
DefaultDirName={pf}\Breezy
36
DefaultGroupName=Breezy
1821.1.1 by Alexander Belchenko
win32 installer for bzr.dev.0.9
37
38
SolidCompression=yes
39
40
OutputDir="..\"
6622.1.18 by Jelmer Vernooij
Rename some windows stuff.
41
SourceDir="..\..\win32_brz.exe"
1821.1.1 by Alexander Belchenko
win32 installer for bzr.dev.0.9
42
6622.1.18 by Jelmer Vernooij
Rename some windows stuff.
43
; TODO(jelmer): Add brz.ico
44
; SetupIconFile="..\brz.ico"
2070.2.2 by Alexander Belchenko
win32 installer: make short info page instead of full GPL license text
45
InfoBeforeFile="..\tools\win32\info.txt"
1821.1.1 by Alexander Belchenko
win32 installer for bzr.dev.0.9
46
6622.1.18 by Jelmer Vernooij
Rename some windows stuff.
47
; VersionInfoCompany="Canonical Ltd."
48
VersionInfoCopyright="Canonical Ltd. et al"
49
VersionInfoDescription="Windows installer for Breezy"
1821.1.1 by Alexander Belchenko
win32 installer for bzr.dev.0.9
50
; [[[cog
6622.1.34 by Jelmer Vernooij
Rename brzlib => breezy.
51
; import breezy
1821.1.1 by Alexander Belchenko
win32 installer for bzr.dev.0.9
52
; version_number = []
6622.1.34 by Jelmer Vernooij
Rename brzlib => breezy.
53
; for i in breezy.version_info[:3]:
1821.1.1 by Alexander Belchenko
win32 installer for bzr.dev.0.9
54
;     try:
55
;         i = int(i)
56
;     except ValueError:
57
;         i = 0
58
;     version_number.append(i)
59
; # incremental build number
60
; from tools.win32.file_version import *
61
; try:
62
;     version_prev = get_file_version(OutputBaseFilename + '.exe')
63
; except (FileNotFound, VersionNotAvailable):
64
;     pass
65
; else:
66
;     if version_number == list(version_prev[:3]):
67
;         version_number.append((version_prev[-1]+1) % 65536)
68
; version_str = '.'.join(str(i) for i in version_number)
69
; cog.outl('VersionInfoVersion="%s"' % version_str)
70
; ]]]
71
; [[[end]]]
72
6622.1.18 by Jelmer Vernooij
Rename some windows stuff.
73
AppComments="Breezy: Friendly distributed version control system"
74
AppPublisher="Breezy Developers"
6650.1.1 by Jelmer Vernooij
Update homepage URL.
75
AppPublisherURL="https://www.breezy-vcs.org/"
7527 by Gustav Hartvigsson
Start removing Bazaar referencen.
76
AppSupportURL="https://www.breezy-vcs.org/pages/support.html"
77
AppUpdatesURL=""
78
1821.1.1 by Alexander Belchenko
win32 installer for bzr.dev.0.9
79
; [[[cog cog.outl('AppVersion=%s' % VERSION) ]]]
80
; [[[end]]]
81
82
ChangesEnvironment=yes
3565.5.2 by Mark Hammond
merge inno script changes
83
; MARKH: PrivilegesRequired=none means it can't be installed by a non-admin
84
; user - but sadly we still need admin - eg, tortoise overlays, installing
85
; into "\Program Files", installing COM objects etc all must be done by an
86
; admin.
87
PrivilegesRequired=admin
1821.1.1 by Alexander Belchenko
win32 installer for bzr.dev.0.9
88
89
[Files]
3565.5.2 by Mark Hammond
merge inno script changes
90
; Tortoise files - these are at the top as we use 'ExtractTemporaryFile' on
91
; the TortoiseOverlays MSI, and inno documents such files should be at the
92
; start for best performance.
93
; [[[cog
94
; if "TBZR" in os.environ: # we need a more formal way of controlling this...
3871.1.6 by Mark Hammond
remerge setup changes
95
;     tovmsi32 = os.environ["TORTOISE_OVERLAYS_MSI_WIN32"] # point at the 32bit TortoiseOverlays .msi
96
;     tovmsi64 = os.environ["TORTOISE_OVERLAYS_MSI_X64"] # point at the 64bit TortoiseOverlays .msi
97
;     cog.outl('Source: "%s"; Flags: dontcopy ignoreversion ; Components: tortoise' % tovmsi32)
98
;     cog.outl('Source: "%s"; Flags: dontcopy ignoreversion ; Components: tortoise' % tovmsi64)
3565.5.7 by Mark Hammond
install all files with 'restartreplace uninsrestartdelete' and close
99
;     cog.outl('Source: "tbzrcache.exe"; DestDir: "{app}"; Flags: ignoreversion restartreplace uninsrestartdelete; Components: tortoise')
100
;     cog.outl('Source: "tbzrcachew.exe"; DestDir: "{app}"; Flags: ignoreversion restartreplace uninsrestartdelete; Components: tortoise')
101
;     cog.outl('Source: "tbzrcommand.exe"; DestDir: "{app}"; Flags: ignoreversion restartreplace uninsrestartdelete; Components: tortoise')
102
;     cog.outl('Source: "tbzrcommandw.exe"; DestDir: "{app}"; Flags: ignoreversion restartreplace uninsrestartdelete; Components: tortoise')
3871.1.6 by Mark Hammond
remerge setup changes
103
;     cog.outl('Source: "tbzrtrace.exe"; DestDir: "{app}"; Flags: ignoreversion restartreplace uninsrestartdelete; Components: debug')
3565.5.2 by Mark Hammond
merge inno script changes
104
;     # Note 'regserver' here appears to run regsvr32 without elevation, which
105
;     # is no good for us - so we have a [run] entry below.
3871.1.6 by Mark Hammond
remerge setup changes
106
;     cog.outl('Source: "tbzr_old.dll"; DestDir: "{app}"; Flags: ignoreversion restartreplace uninsrestartdelete; Components: tortoise')
107
;     cog.outl('Source: "tbzrshellext_x86.dll"; DestDir: "{app}"; Flags: ignoreversion restartreplace uninsrestartdelete; Components: tortoise')
108
;     cog.outl('Source: "tbzrshellext_x64.dll"; DestDir: "{app}"; Flags: ignoreversion restartreplace uninsrestartdelete; Components: tortoise; Check: IsWin64;')
3565.5.7 by Mark Hammond
install all files with 'restartreplace uninsrestartdelete' and close
109
;     cog.outl(r'Source: "plugins\qbzr\*"; DestDir: "{app}\plugins\qbzr"; Flags: createallsubdirs ignoreversion recursesubdirs restartreplace uninsrestartdelete; Components: tortoise')
3565.5.2 by Mark Hammond
merge inno script changes
110
;
3932.6.1 by Mark Hammond
Include all .html files from the tortoise doc directory.
111
;     cog.outl('Source: "%s\\doc\\*.html"; DestDir: "{app}\\doc\\tbzr"; Flags: ignoreversion; Components: tortoise' % os.environ['TBZR'])
3565.5.2 by Mark Hammond
merge inno script changes
112
; ]]]
113
; [[[end]]]
114
115
; We can't say '*.*' due to optional components.
3565.5.7 by Mark Hammond
install all files with 'restartreplace uninsrestartdelete' and close
116
Source: "plugins\*.*"; DestDir: "{app}\\plugins"; Flags: createallsubdirs ignoreversion recursesubdirs restartreplace uninsrestartdelete; Components: plugins
117
Source: "*.bat"; DestDir: "{app}"; Flags: ignoreversion restartreplace uninsrestartdelete;
118
Source: "*.url"; DestDir: "{app}"; Flags: ignoreversion restartreplace uninsrestartdelete;
119
Source: "msvc*.dll"; DestDir: "{app}"; Flags: ignoreversion restartreplace uninsrestartdelete;
120
Source: "bz*.exe"; DestDir: "{app}"; Flags: ignoreversion restartreplace uninsrestartdelete;
121
Source: "Python*.dll"; DestDir: "{app}"; Flags: ignoreversion restartreplace uninsrestartdelete;
122
Source: "lib\*.*"; DestDir: "{app}\lib"; Flags: createallsubdirs ignoreversion recursesubdirs restartreplace uninsrestartdelete;
123
Source: "doc\*.*"; DestDir: "{app}\doc"; Flags: createallsubdirs ignoreversion recursesubdirs restartreplace uninsrestartdelete;
2321.2.7 by Alexander Belchenko
win32 standalone installer improvements:
124
; [[[cog
125
; try:
126
;     import pycurl
127
; except ImportError:
128
;     ca_path = None
129
; else:
130
;     supported = pycurl.version_info()[8]
131
;     if 'https' in supported:
6622.1.34 by Jelmer Vernooij
Rename brzlib => breezy.
132
;         from breezy.transport.http.ca_bundle import get_ca_path
2321.2.7 by Alexander Belchenko
win32 standalone installer improvements:
133
;         ca_path = get_ca_path()
134
;         if ca_path:
135
;             cog.outl('Source: "%s"; DestDir: "{app}"; Components: cabundle' % ca_path)
136
;         else:
137
;             cog.msg('You have pycurl with SSL support, '
138
;                     'but CA Bundle (curl-ca-bundle.crt) not found!')
139
; ]]]
140
; [[[end]]]
141
4584.1.1 by Alexander Belchenko
Bundle imageformats plugins for PyQt4 into bzr.exe installer to enable support of many image formats in QBzr.
142
; imageformats plugins for PyQt4
143
; [[[cog
144
; plug_dir = os.path.join(os.path.dirname(cog.inFile), # $(bzr_src_root)/tools/win32
145
;                         '..', '..', 'win32_bzr.exe', 'imageformats')
146
; if os.path.isdir(plug_dir):
147
;     cog.outl('Source: "imageformats\\*.*"; DestDir: "{app}\\imageformats"; '
148
;              'Flags: createallsubdirs ignoreversion recursesubdirs restartreplace uninsrestartdelete;')
149
; else:
150
;     cog.msg('imageformats plugins for PyQt4 not found')
151
; ]]]
152
; [[[end]]]
153
3565.5.2 by Mark Hammond
merge inno script changes
154
[Types]
155
Name: "typical"; Description: "A typical installation"
156
Name: "full"; Description: "Full Installation (typical installation plus test utilities)"
157
Name: "compact"; Description: "Compact installation"
158
Name: "custom"; Description: "Custom installation"; Flags: iscustom
2321.2.7 by Alexander Belchenko
win32 standalone installer improvements:
159
160
[Components]
3565.5.2 by Mark Hammond
merge inno script changes
161
Name: "main"; Description: "Main Files"; Types: full typical compact custom; Flags: fixed
162
Name: "plugins"; Description: "Default plugins"; Types: full typical custom;
2321.2.7 by Alexander Belchenko
win32 standalone installer improvements:
163
; [[[cog
164
; if ca_path:
165
;     cog.outl('Name: "cabundle"; '
166
;              'Description: "CA certificates for SSL support"; '
3565.5.2 by Mark Hammond
merge inno script changes
167
;              'Types: full typical custom')
168
; if "TBZR" in os.environ: # we need a more formal way of controlling this...
3871.1.6 by Mark Hammond
remerge setup changes
169
;     cog.outl('Name: "tortoise"; Description: "Windows Shell Extensions (TortoiseBZR)"; Types: full typical custom;')
3565.5.2 by Mark Hammond
merge inno script changes
170
;     cog.outl('Name: "debug"; Description: "Test, diagnostic and debugging utilities"; Types: full custom;')
171
;
2321.2.7 by Alexander Belchenko
win32 standalone installer improvements:
172
; ]]]
173
; [[[end]]]
174
1821.1.1 by Alexander Belchenko
win32 installer for bzr.dev.0.9
175
[Dirs]
7527 by Gustav Hartvigsson
Start removing Bazaar referencen.
176
Name: "{userappdata}\breezy\3.0"
3010.4.3 by Alexander Belchenko
teach uninstaller to delete plugins subdirectory; NEWS entry.
177
Name: "{app}\plugins"; Flags: uninsalwaysuninstall
1821.1.1 by Alexander Belchenko
win32 installer for bzr.dev.0.9
178
2321.2.7 by Alexander Belchenko
win32 standalone installer improvements:
179
1821.1.1 by Alexander Belchenko
win32 installer for bzr.dev.0.9
180
[Icons]
2666.2.1 by Alexander Belchenko
change generated documentation extension from htm to html
181
Name: "{group}\Documentation index"; Filename: "{app}\doc\index.html"; WorkingDir: "{app}\doc";
6650.1.1 by Jelmer Vernooij
Update homepage URL.
182
Name: "{group}\Breezy Home Page"; Filename: "{app}\breezy.url"; Comment: "https://www.breezy-vcs.org/";
2245.4.9 by Alexander Belchenko
Inno Setup script: using {cmd} macro instead of env varibale substitution (%COMSPEC%)
183
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";
3565.5.2 by Mark Hammond
merge inno script changes
184
; NOTE: Intent is to change the log file location - the line below will need to change to reflect that.
185
Name: "{group}\Open Bzr log file"; Filename: "notepad.exe"; Parameters: "{userdocs}\.bzr.log"; Comment: "Launch notepad to view the bzr log file";
186
187
; [[[cog
188
; if "TBZR" in os.environ:
189
;     cog.outl(r'Name: "{group}\TortoiseBZR documentation"; Filename: "{app}\doc\tbzr\index.html"; Comment: "Launch TortoiseBZR documentation";')
190
; ]]]
191
; [[[end]]]
192
; No Uninstall here - Control Panel will do
1821.1.1 by Alexander Belchenko
win32 installer for bzr.dev.0.9
193
2321.2.7 by Alexander Belchenko
win32 standalone installer improvements:
194
1821.1.1 by Alexander Belchenko
win32 installer for bzr.dev.0.9
195
[Tasks]
3565.5.2 by Mark Hammond
merge inno script changes
196
Name: Path; Description: "Add {app} directory to PATH environment variable"
197
; [[[cog
198
; if "TBZR" in os.environ:
199
;     cog.outl('Name: TBZRReadme; Description: "View the TortoiseBZR Readme"; Components: tortoise')
200
; ]]]
201
; [[[end]]]
2321.2.7 by Alexander Belchenko
win32 standalone installer improvements:
202
3010.4.2 by Alexander Belchenko
Windows standalone installer write to the registry some useful info about paths and bzr version
203
[Registry]
6622.1.18 by Jelmer Vernooij
Rename some windows stuff.
204
Root: HKLM; Subkey: "SOFTWARE\Breezy"; Flags: noerror uninsdeletekey
205
Root: HKLM; Subkey: "SOFTWARE\Breezy"; ValueName: "InstallPath"; ValueType: string; ValueData: "{app}"; Flags: noerror
3565.5.2 by Mark Hammond
merge inno script changes
206
; Don't write stuff that can be implied
6622.1.34 by Jelmer Vernooij
Rename brzlib => breezy.
207
;Root: HKLM; Subkey: "SOFTWARE\Breezy"; ValueName: "breezyPath"; ValueType: string; ValueData: "{app}\lib\library.zip\breezy"; Flags: noerror
6622.1.18 by Jelmer Vernooij
Rename some windows stuff.
208
;Root: HKLM; Subkey: "SOFTWARE\Breezy"; ValueName: "PluginsPath"; ValueType: string; ValueData: "{app}\plugins"; Flags: noerror
209
;Root: HKLM; Subkey: "SOFTWARE\Breezy"; ValueName: "PythonPath"; ValueType: string; ValueData: "{app}\lib\library.zip"; Flags: noerror
210
; [[[cog cog.outl('Root: HKLM; Subkey: "SOFTWARE\Breezy"; ValueName: "Version"; ValueType: string; ValueData: "%s"; Flags: noerror' % VERSION) ]]]
3010.4.2 by Alexander Belchenko
Windows standalone installer write to the registry some useful info about paths and bzr version
211
; [[[end]]]
212
213
1821.1.1 by Alexander Belchenko
win32 installer for bzr.dev.0.9
214
[Run]
6622.1.18 by Jelmer Vernooij
Rename some windows stuff.
215
Filename: "{app}\brz_postinstall.exe"; Parameters: "--start-brz"; Flags: skipifdoesntexist runhidden;
216
Filename: "{app}\brz_postinstall.exe"; Parameters: "--add-path"; Tasks: Path; Flags: skipifdoesntexist skipifsilent runhidden;
3565.5.2 by Mark Hammond
merge inno script changes
217
; [[[cog
218
; if "TBZR" in os.environ:
3871.1.6 by Mark Hammond
remerge setup changes
219
;     cog.outl('Filename: "regsvr32.exe"; Parameters: "/s /i: /n tbzrshellext_x86.dll"; WorkingDir: "{app}"; Components: tortoise; Description: "Registering Tortoise"; StatusMsg: "Registering Tortoise"')
220
;     cog.outl('Filename: "regsvr32.exe"; Parameters: "/s /i: /n tbzrshellext_x64.dll"; WorkingDir: "{app}"; Components: tortoise; Description: "Registering Tortoise"; StatusMsg: "Registering Tortoise"; Check: IsWin64')
3565.5.2 by Mark Hammond
merge inno script changes
221
;     cog.outl(r'Filename: "{app}\doc\tbzr\index.html"; Tasks: TBZRReadme; Flags: shellexec')
222
; ]]]
223
; [[[end]]]
1821.1.1 by Alexander Belchenko
win32 installer for bzr.dev.0.9
224
2321.2.7 by Alexander Belchenko
win32 standalone installer improvements:
225
1821.1.1 by Alexander Belchenko
win32 installer for bzr.dev.0.9
226
[UninstallRun]
4580.5.16 by John Arbash Meinel
Change the all-in-one installer name.
227
Filename: "{app}\bzr_postinstall.exe"; Parameters: "--delete-path --delete-shell-menu --silent"; Flags: skipifdoesntexist runhidden;
3565.5.2 by Mark Hammond
merge inno script changes
228
; [[[cog
229
; if "TBZR" in os.environ:
3871.1.6 by Mark Hammond
remerge setup changes
230
;     cog.outl('Filename: "regsvr32.exe"; Parameters: "/u /s /i: tbzrshellext_x86.dll"; WorkingDir: "{app}"; Components: tortoise; StatusMsg: "Unregistering Tortoise"; Flags: skipifdoesntexist')
231
;     cog.outl('Filename: "regsvr32.exe"; Parameters: "/u /s /i: tbzrshellext_x64.dll"; WorkingDir: "{app}"; Components: tortoise; StatusMsg: "Unregistering Tortoise"; Flags: skipifdoesntexist; Check: IsWin64')
3565.5.2 by Mark Hammond
merge inno script changes
232
; ]]]
233
; [[[end]]]
234
3638.1.1 by Alexander Belchenko
remove out-of-date options from Windows standalone installer.
235
3565.5.2 by Mark Hammond
merge inno script changes
236
[Code]
237
const
238
  SHCNF_IDLIST = $0000;
239
  SHCNE_ASSOCCHANGED = $08000000;
240
  WM_QUIT = 18;
3871.1.6 by Mark Hammond
remerge setup changes
241
  MOVEFILE_DELAY_UNTIL_REBOOT    = 4;
3565.5.2 by Mark Hammond
merge inno script changes
242
243
procedure SHChangeNotify(wEventId, uFlags, dwItem1, dwItem2: Integer);
244
 external 'SHChangeNotify@shell32.dll stdcall';
245
3871.1.6 by Mark Hammond
remerge setup changes
246
function MoveFileEx(lpExistingFileName, lpNewFileName: String; dwFlags: Cardinal): Integer;
247
 external 'MoveFileExA@kernel32.dll stdcall';
248
249
procedure DeleteFileNowOrLater(filename: string);
250
var
251
  rc : Integer;
252
begin
253
    if FileExists(filename) and not DeleteFile(filename) then
254
        // can't work out to pass NULL to the API, but an empty string
255
        // seems to work OK.
256
        MoveFileEx(filename, '', MOVEFILE_DELAY_UNTIL_REBOOT);
257
end;
258
3565.5.7 by Mark Hammond
install all files with 'restartreplace uninsrestartdelete' and close
259
procedure ShutdownTBZR;
260
var
261
    hwnd: HWND;
262
begin
263
// [[[cog
264
// if "TBZR" not in os.environ:
265
//     cog.outl('        Exit;  // No TSVN set - exit this procedure.')
266
// ]]]
267
// [[[end]]]
268
    // ask the cache process to shut-down.
269
    hwnd := FindWindowByClassName('TBZRCache_Taskbar');
270
    if hwnd <> 0 then
271
        PostMessage(hwnd, WM_QUIT, 1, 0);
272
end;
273
3565.5.2 by Mark Hammond
merge inno script changes
274
procedure CurStepChanged(CurStep: TSetupStep);
275
var
276
    S, tovmsi, fqtovmsi, params: String;
277
    ErrorCode: Integer;
278
begin
279
    if CurStep=ssInstall then begin
3565.5.7 by Mark Hammond
install all files with 'restartreplace uninsrestartdelete' and close
280
        ShutdownTBZR;
3932.1.1 by Martin Pool
Merge Mark's Support for tbzr c++ implemented shell extension and fix typo
281
        // In case the user hasn't uninstalled the old version before
3871.1.6 by Mark Hammond
remerge setup changes
282
        // upgrading, we unregister and delete some obsolete files
283
        // (regsvr32 remains silent even if the file doesn't exist)
284
        Exec('regsvr32.exe', '/s /u "' + ExpandConstant('{app}\tbzr.dll') + '"',
285
             '', SW_HIDE, ewWaitUntilTerminated, ErrorCode);
286
        DeleteFileNowOrLater(ExpandConstant('{app}\tbzr.dll'));
287
        DeleteFileNowOrLater(ExpandConstant('{app}\tbzrtest.exe'));
288
        DeleteFileNowOrLater(ExpandConstant('{app}\tbzr_tracer.exe'));
3565.5.2 by Mark Hammond
merge inno script changes
289
    end;
290
291
    if CurStep=ssPostInstall then begin
292
        // a couple of post-install tasks
293
        if IsComponentSelected('tortoise') then begin
294
            // Need to execute:
295
            // msiexec /i TortoiseOverlays-1.X.X.XXXX-win32.msi /qn /norestart
3871.1.6 by Mark Hammond
remerge setup changes
296
// 64bit notes:
297
// We are still primarily a 32bit application - the only 64bit binary is the
298
// shell extension, but even then, we need to install the 32bit version too.
299
// Thus, we keep tortoise in 32bit "install mode" - meaning we are installed
300
// to "\Program Files (x86)".  We don't bother trying to install our single
301
// 64bit DLL into "\Program Files" - we use a different DLL name for 32 and
302
// 64 bit versions, so nothing will conflict.
303
// Note however that on a 64bit OS, we only need the 64bit TortoiseOverlays -
304
// the 32bit apps using shell extensions still work fine with that.
3565.5.2 by Mark Hammond
merge inno script changes
305
// [[[cog
306
// if "TBZR" in os.environ:
307
//     import os
3871.1.6 by Mark Hammond
remerge setup changes
308
//     cog.outl("if IsWin64 then")
309
//     cog.outl("  tovmsi := '%s'" % os.path.basename(os.environ["TORTOISE_OVERLAYS_MSI_X64"]))
310
//     cog.outl("else")
311
//     cog.outl("  tovmsi := '%s'" % os.path.basename(os.environ["TORTOISE_OVERLAYS_MSI_WIN32"]))
3565.5.2 by Mark Hammond
merge inno script changes
312
// else:
313
//     cog.outl("tovmsi := '';")
314
// ]]]
315
// [[[end]]]
316
            ExtractTemporaryFile(tovmsi);
317
            fqtovmsi := AddBackslash(ExpandConstant('{tmp}')) + tovmsi;
318
            params := '/i "' + fqtovmsi + '" /qn /norestart';
319
            if not ShellExec('', 'msiexec.exe', params, '', SW_HIDE,
320
                             ewWaitUntilTerminated, ErrorCode) then
321
                MsgBox('Failed to install TortoiseOverlays: ' + SysErrorMessage(ErrorCode),
322
                        mbInformation, MB_OK);
323
            // Ideally we could be bzr_postinstall.exe this way too, but
324
            // its needed at uninstall time.
325
        end;
326
        // cause explorer to re-fetch handlers.
327
        SHChangeNotify(SHCNE_ASSOCCHANGED, SHCNF_IDLIST, 0, 0);
328
    end;
329
end;
330
3565.5.7 by Mark Hammond
install all files with 'restartreplace uninsrestartdelete' and close
331
4580.5.16 by John Arbash Meinel
Change the all-in-one installer name.
332
function InitializeUninstall(): Boolean;
3565.5.7 by Mark Hammond
install all files with 'restartreplace uninsrestartdelete' and close
333
begin
334
    ShutdownTBZR;
335
    result := True;
336
end;