/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

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

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2008-08-14 17:25:43 UTC
  • mfrom: (3620.2.2 rules.disable)
  • Revision ID: pqm@pqm.ubuntu.com-20080814172543-nl22gdcodusa8rt0
(robertc) Disable .bzrrules from being read from the WT

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
; Script for Inno Setup installer
 
2
; [[[cog cog.outl('; This script created by Cog from bzr.iss.cog source') ]]]
 
3
; [[[end]]]
 
4
; Cog is http://www.nedbatchelder.com/code/cog/
 
5
 
 
6
[Setup]
 
7
AppName=Bazaar
 
8
 
 
9
; [[[cog
 
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
;
 
18
; import bzrlib
 
19
; try: 
 
20
;     VERSION = bzrlib.__version__
 
21
;     AppVerName = 'Bazaar %s' % VERSION
 
22
;     OutputBaseFilename = 'bzr-setup-%s' % VERSION
 
23
; except:
 
24
;     VERSION = ''
 
25
;     AppVerName = 'Bazaar'
 
26
;     OutputBaseFilename = 'bzr-setup'
 
27
;
 
28
; cog.outl('AppVerName=%s' % AppVerName)
 
29
; cog.outl('OutputBaseFilename=%s' % OutputBaseFilename)
 
30
; ]]]
 
31
AppVerName=Bazaar
 
32
OutputBaseFilename=bzr-setup
 
33
; [[[end]]]
 
34
 
 
35
DefaultDirName={pf}\Bazaar
 
36
DefaultGroupName=Bazaar
 
37
 
 
38
SolidCompression=yes
 
39
 
 
40
OutputDir="..\"
 
41
SourceDir="..\..\win32_bzr.exe"
 
42
 
 
43
SetupIconFile="..\bzr.ico"
 
44
InfoBeforeFile="..\tools\win32\info.txt"
 
45
InfoAfterFile="..\tools\win32\survey.txt"
 
46
 
 
47
VersionInfoCompany="Canonical Ltd."
 
48
VersionInfoCopyright="Canonical Ltd., 2005-2008"
 
49
VersionInfoDescription="Windows installer for Bazaar"
 
50
; [[[cog
 
51
; import bzrlib
 
52
; version_number = []
 
53
; for i in bzrlib.version_info[:3]:
 
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
 
 
73
AppComments="Bazaar: Friendly distributed version control system"
 
74
AppPublisher="Canonical Ltd."
 
75
AppPublisherURL="http://www.bazaar-vcs.org"
 
76
AppSupportURL="http://www.bazaar-vcs.org/BzrSupport"
 
77
AppUpdatesURL="http://www.bazaar-vcs.org/WindowsDownloads"
 
78
; [[[cog cog.outl('AppVersion=%s' % VERSION) ]]]
 
79
; [[[end]]]
 
80
 
 
81
ChangesEnvironment=yes
 
82
; MARKH: PrivilegesRequired=none means it can't be installed by a non-admin
 
83
; user - but sadly we still need admin - eg, tortoise overlays, installing
 
84
; into "\Program Files", installing COM objects etc all must be done by an
 
85
; admin.
 
86
PrivilegesRequired=admin
 
87
 
 
88
[Files]
 
89
; Tortoise files - these are at the top as we use 'ExtractTemporaryFile' on
 
90
; the TortoiseOverlays MSI, and inno documents such files should be at the
 
91
; start for best performance.
 
92
; [[[cog
 
93
; if "TBZR" in os.environ: # we need a more formal way of controlling this...
 
94
;     tovmsi = os.environ["TORTOISE_OVERLAYS_MSI_WIN32"] # point at TortoiseOverlays .msi
 
95
;     cog.outl('Source: "%s"; Flags: dontcopy ignoreversion ; Components: tortoise' % tovmsi)
 
96
;     cog.outl('Source: "tbzrcache.exe"; DestDir: "{app}"; Flags: ignoreversion restartreplace uninsrestartdelete; Components: tortoise')
 
97
;     cog.outl('Source: "tbzrcachew.exe"; DestDir: "{app}"; Flags: ignoreversion restartreplace uninsrestartdelete; Components: tortoise')
 
98
;     cog.outl('Source: "tbzrcommand.exe"; DestDir: "{app}"; Flags: ignoreversion restartreplace uninsrestartdelete; Components: tortoise')
 
99
;     cog.outl('Source: "tbzrcommandw.exe"; DestDir: "{app}"; Flags: ignoreversion restartreplace uninsrestartdelete; Components: tortoise')
 
100
;     cog.outl('Source: "tbzr_tracer.exe"; DestDir: "{app}"; Flags: ignoreversion restartreplace uninsrestartdelete; Components: debug')
 
101
;     # Note 'regserver' here appears to run regsvr32 without elevation, which
 
102
;     # is no good for us - so we have a [run] entry below.
 
103
;     cog.outl('Source: "tbzr.dll"; DestDir: "{app}"; Flags: ignoreversion regserver restartreplace uninsrestartdelete; Components: tortoise')
 
104
;     cog.outl(r'Source: "plugins\qbzr\*"; DestDir: "{app}\plugins\qbzr"; Flags: createallsubdirs ignoreversion recursesubdirs restartreplace uninsrestartdelete; Components: tortoise')
 
105
;
 
106
;     cog.outl('Source: "%s\\doc\\index.html"; DestDir: "{app}\\doc\\tbzr"; Flags: ignoreversion; Components: tortoise' % os.environ['TBZR'])
 
107
; ]]]
 
108
; [[[end]]]
 
109
 
 
110
; We can't say '*.*' due to optional components.
 
111
Source: "plugins\*.*"; DestDir: "{app}\\plugins"; Flags: createallsubdirs ignoreversion recursesubdirs restartreplace uninsrestartdelete; Components: plugins
 
112
Source: "*.bat"; DestDir: "{app}"; Flags: ignoreversion restartreplace uninsrestartdelete;
 
113
Source: "*.url"; DestDir: "{app}"; Flags: ignoreversion restartreplace uninsrestartdelete;
 
114
Source: "msvc*.dll"; DestDir: "{app}"; Flags: ignoreversion restartreplace uninsrestartdelete;
 
115
Source: "bz*.exe"; DestDir: "{app}"; Flags: ignoreversion restartreplace uninsrestartdelete;
 
116
Source: "Python*.dll"; DestDir: "{app}"; Flags: ignoreversion restartreplace uninsrestartdelete;
 
117
Source: "lib\*.*"; DestDir: "{app}\lib"; Flags: createallsubdirs ignoreversion recursesubdirs restartreplace uninsrestartdelete;
 
118
Source: "doc\*.*"; DestDir: "{app}\doc"; Flags: createallsubdirs ignoreversion recursesubdirs restartreplace uninsrestartdelete;
 
119
; [[[cog
 
120
; try:
 
121
;     import pycurl
 
122
; except ImportError:
 
123
;     ca_path = None
 
124
; else:
 
125
;     supported = pycurl.version_info()[8]
 
126
;     if 'https' in supported:
 
127
;         from bzrlib.transport.http.ca_bundle import get_ca_path
 
128
;         ca_path = get_ca_path()
 
129
;         if ca_path:
 
130
;             cog.outl('Source: "%s"; DestDir: "{app}"; Components: cabundle' % ca_path)
 
131
;         else:
 
132
;             cog.msg('You have pycurl with SSL support, '
 
133
;                     'but CA Bundle (curl-ca-bundle.crt) not found!')
 
134
; ]]]
 
135
; [[[end]]]
 
136
 
 
137
[Types]
 
138
Name: "typical"; Description: "A typical installation"
 
139
Name: "full"; Description: "Full Installation (typical installation plus test utilities)"
 
140
Name: "compact"; Description: "Compact installation"
 
141
Name: "custom"; Description: "Custom installation"; Flags: iscustom
 
142
 
 
143
[Components]
 
144
Name: "main"; Description: "Main Files"; Types: full typical compact custom; Flags: fixed
 
145
Name: "plugins"; Description: "Default plugins"; Types: full typical custom;
 
146
; [[[cog
 
147
; if ca_path:
 
148
;     cog.outl('Name: "cabundle"; '
 
149
;              'Description: "CA certificates for SSL support"; '
 
150
;              'Types: full typical custom')
 
151
; if "TBZR" in os.environ: # we need a more formal way of controlling this...
 
152
;     cog.outl('Name: "tortoise"; Description: "Windows Shell Extensions (TortoiseBZR) - EXPERIMENTAL"; Types: full typical custom;')
 
153
;     cog.outl('Name: "debug"; Description: "Test, diagnostic and debugging utilities"; Types: full custom;')
 
154
;
 
155
; ]]]
 
156
; [[[end]]]
 
157
 
 
158
[Dirs]
 
159
Name: "{userappdata}\bazaar\2.0"
 
160
Name: "{app}\plugins"; Flags: uninsalwaysuninstall
 
161
 
 
162
 
 
163
[Icons]
 
164
Name: "{group}\Documentation index"; Filename: "{app}\doc\index.html"; WorkingDir: "{app}\doc";
 
165
Name: "{group}\Bazaar Home Page"; Filename: "{app}\bazaar.url"; Comment: "http://www.bazaar-vcs.org";
 
166
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";
 
167
; NOTE: Intent is to change the log file location - the line below will need to change to reflect that.
 
168
Name: "{group}\Open Bzr log file"; Filename: "notepad.exe"; Parameters: "{userdocs}\.bzr.log"; Comment: "Launch notepad to view the bzr log file";
 
169
 
 
170
; [[[cog
 
171
; if "TBZR" in os.environ:
 
172
;     cog.outl(r'Name: "{group}\TortoiseBZR documentation"; Filename: "{app}\doc\tbzr\index.html"; Comment: "Launch TortoiseBZR documentation";')
 
173
; ]]]
 
174
; [[[end]]]
 
175
; No Uninstall here - Control Panel will do
 
176
 
 
177
 
 
178
[Tasks]
 
179
Name: Path; Description: "Add {app} directory to PATH environment variable"
 
180
Name: Shell; Description: "Add Bzr context menu to shell"; Flags: unchecked
 
181
; [[[cog
 
182
; if "TBZR" in os.environ:
 
183
;     cog.outl('Name: TBZRReadme; Description: "View the TortoiseBZR Readme"; Components: tortoise')
 
184
; ]]]
 
185
; [[[end]]]
 
186
 
 
187
 
 
188
[Registry]
 
189
Root: HKLM; Subkey: "SOFTWARE\Bazaar"; Flags: noerror uninsdeletekey
 
190
Root: HKLM; Subkey: "SOFTWARE\Bazaar"; ValueName: "InstallPath"; ValueType: string; ValueData: "{app}"; Flags: noerror
 
191
; Don't write stuff that can be implied
 
192
;Root: HKLM; Subkey: "SOFTWARE\Bazaar"; ValueName: "BzrlibPath"; ValueType: string; ValueData: "{app}\lib\library.zip\bzrlib"; Flags: noerror
 
193
;Root: HKLM; Subkey: "SOFTWARE\Bazaar"; ValueName: "PluginsPath"; ValueType: string; ValueData: "{app}\plugins"; Flags: noerror
 
194
;Root: HKLM; Subkey: "SOFTWARE\Bazaar"; ValueName: "PythonPath"; ValueType: string; ValueData: "{app}\lib\library.zip"; Flags: noerror
 
195
; [[[cog cog.outl('Root: HKLM; Subkey: "SOFTWARE\Bazaar"; ValueName: "Version"; ValueType: string; ValueData: "%s"; Flags: noerror' % VERSION) ]]]
 
196
; [[[end]]]
 
197
 
 
198
 
 
199
[Run]
 
200
Filename: "{app}\bzr_postinstall.exe"; Parameters: "--start-bzr"; Flags: skipifdoesntexist runhidden;
 
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;
 
203
; [[[cog
 
204
; if "TBZR" in os.environ:
 
205
;     cog.outl('Filename: "regsvr32.exe"; Parameters: "/s tbzr.dll"; WorkingDir: "{app}"; Components: tortoise; Description: "Registering Tortoise"; StatusMsg: "Registering Tortoise"')
 
206
;     cog.outl(r'Filename: "{app}\doc\tbzr\index.html"; Tasks: TBZRReadme; Flags: shellexec')
 
207
; ]]]
 
208
; [[[end]]]
 
209
 
 
210
 
 
211
[UninstallRun]
 
212
; [[[cog
 
213
; if "TBZR" in os.environ:
 
214
;     cog.outl('Filename: "regsvr32.exe"; Parameters: "/u /s tbzr.dll"; WorkingDir: "{app}"; Components: tortoise; StatusMsg: "Unregistering Tortoise"; Flags: skipifdoesntexist')
 
215
; ]]]
 
216
; [[[end]]]
 
217
 
 
218
[Code]
 
219
const
 
220
  SHCNF_IDLIST = $0000;
 
221
  SHCNE_ASSOCCHANGED = $08000000;
 
222
  WM_QUIT = 18;
 
223
 
 
224
procedure SHChangeNotify(wEventId, uFlags, dwItem1, dwItem2: Integer);
 
225
 external 'SHChangeNotify@shell32.dll stdcall';
 
226
 
 
227
procedure ShutdownTBZR;
 
228
var
 
229
    hwnd: HWND;
 
230
begin
 
231
// [[[cog
 
232
// if "TBZR" not in os.environ:
 
233
//     cog.outl('        Exit;  // No TSVN set - exit this procedure.')
 
234
// ]]]
 
235
// [[[end]]]
 
236
    // ask the cache process to shut-down.
 
237
    hwnd := FindWindowByClassName('TBZRCache_Taskbar');
 
238
    if hwnd <> 0 then
 
239
        PostMessage(hwnd, WM_QUIT, 1, 0);
 
240
end;
 
241
 
 
242
procedure CurStepChanged(CurStep: TSetupStep);
 
243
var
 
244
    S, tovmsi, fqtovmsi, params: String;
 
245
    ErrorCode: Integer;
 
246
begin
 
247
    if CurStep=ssInstall then begin
 
248
        ShutdownTBZR;
 
249
    end;
 
250
 
 
251
    if CurStep=ssPostInstall then begin
 
252
        // a couple of post-install tasks
 
253
        if IsComponentSelected('tortoise') then begin
 
254
            // Need to execute:
 
255
            // msiexec /i TortoiseOverlays-1.X.X.XXXX-win32.msi /qn /norestart
 
256
// [[[cog
 
257
// if "TBZR" in os.environ:
 
258
//     import os
 
259
//     cog.outl("tovmsi := '%s';" % os.path.basename(os.environ["TORTOISE_OVERLAYS_MSI_WIN32"]))
 
260
// else:
 
261
//     cog.outl("tovmsi := '';")
 
262
// ]]]
 
263
// [[[end]]]
 
264
            ExtractTemporaryFile(tovmsi);
 
265
            fqtovmsi := AddBackslash(ExpandConstant('{tmp}')) + tovmsi;
 
266
            params := '/i "' + fqtovmsi + '" /qn /norestart';
 
267
            if not ShellExec('', 'msiexec.exe', params, '', SW_HIDE,
 
268
                             ewWaitUntilTerminated, ErrorCode) then
 
269
                MsgBox('Failed to install TortoiseOverlays: ' + SysErrorMessage(ErrorCode),
 
270
                        mbInformation, MB_OK);
 
271
            // Ideally we could be bzr_postinstall.exe this way too, but
 
272
            // its needed at uninstall time.
 
273
        end;
 
274
        // cause explorer to re-fetch handlers.
 
275
        SHChangeNotify(SHCNE_ASSOCCHANGED, SHCNF_IDLIST, 0, 0);
 
276
    end;
 
277
end;
 
278
 
 
279
 
 
280
function InitializeUninstall(): Boolean; 
 
281
begin
 
282
    ShutdownTBZR;
 
283
    result := True;
 
284
end;