]> git.saurik.com Git - wxWidgets.git/blob - wxPython/distrib/make_installer.py
made main toolbar bitmaps 24x24
[wxWidgets.git] / wxPython / distrib / make_installer.py
1 # -*- coding: iso-8859-1 -*-
2 #----------------------------------------------------------------------
3 # Name: make_installer.py
4 # Purpose: A script to create the wxPython windows installer
5 #
6 # Author: Robin Dunn
7 #
8 # Created: 30-April-2001
9 # RCS-ID: $Id$
10 # Copyright: (c) 2003 by Total Control Software
11 # Licence: wxWindows license
12 #----------------------------------------------------------------------
13
14 """
15 This script will generate a setup script for InnoSetup and then run it
16 to make the installer executable. If all goes right the proper versions
17 of Python and wxWindows (including hybrid/final settings) will all be
18 calculated based on what _core_.pyd imports and an appropriate installer
19 will be created.
20 """
21
22
23 import sys, os, time
24
25 KEEP_TEMPS = False
26 # default InnoSetup installer location
27 ISCC = r"%s\InnoSetup5\ISCC.exe %s"
28
29 if os.environ.has_key("INNO5"):
30 ISCC = os.environ["INNO5"]
31
32
33 #----------------------------------------------------------------------
34
35 ISS_Template = r'''
36
37 [Setup]
38 AppName = wxPython%(SHORTVER)s-%(CHARTYPE)s-%(PYVER)s
39 AppVerName = wxPython %(VERSION)s (%(CHARTYPE)s) for Python %(PYTHONVER)s
40 OutputBaseFilename = wxPython%(SHORTVER)s-win32-%(CHARTYPE)s-%(VERSION)s-%(PYVER)s
41 AppCopyright = Copyright © 2006 Total Control Software
42 DefaultDirName = {code:GetInstallDir|c:\DoNotInstallHere}
43 DefaultGroupName = wxPython %(VERSION)s (%(CHARTYPE)s) for Python %(PYTHONVER)s
44 PrivilegesRequired = none
45 OutputDir = dist
46 DisableStartupPrompt = true
47 Compression = bzip
48 SolidCompression = yes
49 DirExistsWarning = no
50 DisableReadyMemo = true
51 DisableReadyPage = true
52 ;;DisableDirPage = true
53 DisableProgramGroupPage = true
54 UsePreviousAppDir = no
55 UsePreviousGroup = no
56
57 AppPublisher = Total Control Software
58 AppPublisherURL = http://wxPython.org/
59 AppSupportURL = http://wxPython.org/maillist.php
60 AppUpdatesURL = http://wxPython.org/download.php
61 AppVersion = %(VERSION)s-%(CHARTYPE)s
62
63 UninstallFilesDir = {app}\%(PKGDIR)s
64 LicenseFile = licence\licence.txt
65
66
67 ;;------------------------------------------------------------
68
69 [Components]
70 Name: core; Description: "wxPython modules and library"; Types: full custom; Flags: fixed
71 Name: manifest; Description: "Manifest files for XP Themed LnF"; Types: full
72 Name: pthfile; Description: "Make this install be the default wxPython"; Types: full
73
74 ;;------------------------------------------------------------
75
76 [Files]
77 %(RTDLL)s
78 Source: "%(WXDIR)s\lib\vc_dll\wx*%(WXDLLVER)s_*.dll"; DestDir: "{app}\%(PKGDIR)s\wx"; Components: core; Flags: replacesameversion
79 Source: "distrib\msw\gdiplus.dll"; DestDir: "{app}\%(PKGDIR)s\wx"; Components: core; Flags: replacesameversion
80 %(CPPDLL)s
81 %(MSLU)s
82
83 ;; The old way, only installs on pre-XP systems...
84 ;;Source: "distrib\msw\gdiplus.dll"; DestDir: "{app}\%(PKGDIR)s\wx"; Check: OnlyBeforeXP; Flags: sharedfile; Components: core
85
86
87 Source: "wx\_activex.pyd"; DestDir: "{app}\%(PKGDIR)s\wx"; Components: core; Flags: comparetimestamp
88 Source: "wx\_calendar.pyd"; DestDir: "{app}\%(PKGDIR)s\wx"; Components: core; Flags: comparetimestamp
89 Source: "wx\_combo.pyd"; DestDir: "{app}\%(PKGDIR)s\wx"; Components: core; Flags: comparetimestamp
90 Source: "wx\_controls_.pyd"; DestDir: "{app}\%(PKGDIR)s\wx"; Components: core; Flags: comparetimestamp
91 Source: "wx\_core_.pyd"; DestDir: "{app}\%(PKGDIR)s\wx"; Components: core; Flags: comparetimestamp
92 Source: "wx\_gdi_.pyd"; DestDir: "{app}\%(PKGDIR)s\wx"; Components: core; Flags: comparetimestamp
93 Source: "wx\_animate.pyd"; DestDir: "{app}\%(PKGDIR)s\wx"; Components: core; Flags: comparetimestamp
94 Source: "wx\_gizmos.pyd"; DestDir: "{app}\%(PKGDIR)s\wx"; Components: core; Flags: comparetimestamp
95 Source: "wx\_glcanvas.pyd"; DestDir: "{app}\%(PKGDIR)s\wx"; Components: core; Flags: comparetimestamp
96 Source: "wx\_grid.pyd"; DestDir: "{app}\%(PKGDIR)s\wx"; Components: core; Flags: comparetimestamp
97 Source: "wx\_html.pyd"; DestDir: "{app}\%(PKGDIR)s\wx"; Components: core; Flags: comparetimestamp
98 Source: "wx\_media.pyd"; DestDir: "{app}\%(PKGDIR)s\wx"; Components: core; Flags: comparetimestamp
99 Source: "wx\_misc_.pyd"; DestDir: "{app}\%(PKGDIR)s\wx"; Components: core; Flags: comparetimestamp
100 Source: "wx\_stc.pyd"; DestDir: "{app}\%(PKGDIR)s\wx"; Components: core; Flags: comparetimestamp
101 Source: "wx\_webkit.pyd"; DestDir: "{app}\%(PKGDIR)s\wx"; Components: core; Flags: comparetimestamp
102 Source: "wx\_windows_.pyd"; DestDir: "{app}\%(PKGDIR)s\wx"; Components: core; Flags: comparetimestamp
103 Source: "wx\_wizard.pyd"; DestDir: "{app}\%(PKGDIR)s\wx"; Components: core; Flags: comparetimestamp
104 Source: "wx\_xrc.pyd"; DestDir: "{app}\%(PKGDIR)s\wx"; Components: core; Flags: comparetimestamp
105 Source: "wx\_aui.pyd"; DestDir: "{app}\%(PKGDIR)s\wx"; Components: core; Flags: comparetimestamp
106 Source: "wx\_richtext.pyd"; DestDir: "{app}\%(PKGDIR)s\wx"; Components: core; Flags: comparetimestamp
107 ;;Source: "wx\_iewin.pyd"; DestDir: "{app}\%(PKGDIR)s\wx"; Components: core; Flags: comparetimestamp
108 ;;Source: "wx\_ogl.pyd"; DestDir: "{app}\%(PKGDIR)s\wx"; Components: core; Flags: comparetimestamp
109
110
111 Source: "wx\*.py"; DestDir: "{app}\%(PKGDIR)s\wx"; Components: core
112 Source: "wx\build\*.py"; DestDir: "{app}\%(PKGDIR)s\wx\build"; Components: core
113 Source: "wx\lib\*.py"; DestDir: "{app}\%(PKGDIR)s\wx\lib"; Components: core
114 Source: "wx\lib\analogclock\*.py"; DestDir: "{app}\%(PKGDIR)s\wx\lib\analogclock"; Components: core
115 Source: "wx\lib\analogclock\lib_setup\*.py"; DestDir: "{app}\%(PKGDIR)s\wx\lib\analogclock\lib_setup"; Components: core
116 Source: "wx\lib\art\*.py"; DestDir: "{app}\%(PKGDIR)s\wx\lib\art"; Components: core
117 Source: "wx\lib\colourchooser\*.py"; DestDir: "{app}\%(PKGDIR)s\wx\lib\colourchooser"; Components: core
118 Source: "wx\lib\editor\*.py"; DestDir: "{app}\%(PKGDIR)s\wx\lib\editor"; Components: core
119 Source: "wx\lib\editor\*.txt"; DestDir: "{app}\%(PKGDIR)s\wx\lib\editor"; Components: core
120 Source: "wx\lib\mixins\*.py"; DestDir: "{app}\%(PKGDIR)s\wx\lib\mixins"; Components: core
121 Source: "wx\lib\masked\*.py"; DestDir: "{app}\%(PKGDIR)s\wx\lib\masked"; Components: core
122 Source: "wx\lib\ogl\*.py"; DestDir: "{app}\%(PKGDIR)s\wx\lib\ogl"; Components: core
123 Source: "wx\lib\floatcanvas\*.py"; DestDir: "{app}\%(PKGDIR)s\wx\lib\floatcanvas"; Components: core
124 Source: "wx\py\*.py"; DestDir: "{app}\%(PKGDIR)s\wx\py"; Components: core
125 Source: "wx\py\*.txt"; DestDir: "{app}\%(PKGDIR)s\wx\py"; Components: core
126 Source: "wx\py\*.ico"; DestDir: "{app}\%(PKGDIR)s\wx\py"; Components: core
127 Source: "wx\py\*.png"; DestDir: "{app}\%(PKGDIR)s\wx\py"; Components: core
128 Source: "wx\py\tests\*.py"; DestDir: "{app}\%(PKGDIR)s\wx\py\tests"; Components: core
129 Source: "wx\tools\*.py"; DestDir: "{app}\%(PKGDIR)s\wx\tools"; Components: core
130 Source: "wx\tools\XRCed\*.txt"; DestDir: "{app}\%(PKGDIR)s\wx\tools\XRCed"; Components: core
131 Source: "wx\tools\XRCed\sawfishrc"; DestDir: "{app}\%(PKGDIR)s\wx\tools\XRCed"; Components: core
132 Source: "wx\tools\XRCed\*.py"; DestDir: "{app}\%(PKGDIR)s\wx\tools\XRCed"; Components: core
133 Source: "wx\tools\XRCed\*.xrc"; DestDir: "{app}\%(PKGDIR)s\wx\tools\XRCed"; Components: core
134 Source: "wx\tools\XRCed\*.ico"; DestDir: "{app}\%(PKGDIR)s\wx\tools\XRCed"; Components: core
135 Source: "wx\tools\XRCed\*.png"; DestDir: "{app}\%(PKGDIR)s\wx\tools\XRCed"; Components: core
136 Source: "wx\tools\XRCed\*.sh"; DestDir: "{app}\%(PKGDIR)s\wx\tools\XRCed"; Components: core
137 Source: "wx\tools\XRCed\src-images\*.png"; DestDir: "{app}\%(PKGDIR)s\wx\tools\XRCed\src-images"; Components: core
138
139
140 Source: "wxPython\*.py"; DestDir: "{app}\%(PKGDIR)s\wxPython"; Components: core
141 Source: "wxPython\lib\*.py"; DestDir: "{app}\%(PKGDIR)s\wxPython\lib"; Components: core
142 Source: "wxPython\lib\colourchooser\*.py"; DestDir: "{app}\%(PKGDIR)s\wxPython\lib\colourchooser"; Components: core
143 Source: "wxPython\lib\editor\*.py"; DestDir: "{app}\%(PKGDIR)s\wxPython\lib\editor"; Components: core
144 Source: "wxPython\lib\mixins\*.py"; DestDir: "{app}\%(PKGDIR)s\wxPython\lib\mixins"; Components: core
145 Source: "wxPython\tools\*.py"; DestDir: "{app}\%(PKGDIR)s\wxPython\tools"; Components: core
146
147
148 Source: "src\winxp.manifest"; DestDir: "{code:GetPythonDir}"; DestName: "python.exe.manifest"; Flags: sharedfile; Components: manifest
149 Source: "src\winxp.manifest"; DestDir: "{code:GetPythonDir}"; DestName: "pythonw.exe.manifest"; Flags: sharedfile; Components: manifest
150 Source: "wxversion\wxversion.py"; DestDir: "{app}"; Flags: sharedfile; Components: core
151 Source: "wxaddons\*.py"; DestDir: "{app}\wxaddons"; Flags: sharedfile; Components: core
152 Source: "src\wx.pth"; DestDir: "{app}"; Flags: sharedfile; Components: pthfile
153
154 %(LOCALE)s
155
156
157 Source: "scripts\*.py"; DestDir: "{code:GetPythonDir}\Scripts"; Flags: sharedfile; Components: core
158 Source: "scripts\helpviewer"; DestDir: "{code:GetPythonDir}\Scripts"; Flags: sharedfile; Components: core
159 Source: "scripts\img2png"; DestDir: "{code:GetPythonDir}\Scripts"; Flags: sharedfile; Components: core
160 Source: "scripts\img2py"; DestDir: "{code:GetPythonDir}\Scripts"; Flags: sharedfile; Components: core
161 Source: "scripts\img2xpm"; DestDir: "{code:GetPythonDir}\Scripts"; Flags: sharedfile; Components: core
162 Source: "scripts\pyalacarte"; DestDir: "{code:GetPythonDir}\Scripts"; Flags: sharedfile; Components: core
163 Source: "scripts\pyalamode"; DestDir: "{code:GetPythonDir}\Scripts"; Flags: sharedfile; Components: core
164 Source: "scripts\pyshell"; DestDir: "{code:GetPythonDir}\Scripts"; Flags: sharedfile; Components: core
165 Source: "scripts\pycrust"; DestDir: "{code:GetPythonDir}\Scripts"; Flags: sharedfile; Components: core
166 Source: "scripts\pywrap"; DestDir: "{code:GetPythonDir}\Scripts"; Flags: sharedfile; Components: core
167 Source: "scripts\pywxrc"; DestDir: "{code:GetPythonDir}\Scripts"; Flags: sharedfile; Components: core
168 Source: "scripts\xrced"; DestDir: "{code:GetPythonDir}\Scripts"; Flags: sharedfile; Components: core
169
170
171 Source: "distrib\README.win32.txt"; DestDir: "{app}\%(PKGDIR)s\docs"; Flags: isreadme; Components: core
172 Source: "licence\*.txt"; DestDir: "{app}\%(PKGDIR)s\docs\licence"; Components: core
173 Source: "docs\CHANGES.*"; DestDir: "{app}\%(PKGDIR)s\docs"; Components: core
174 Source: "docs\MigrationGuide.*"; DestDir: "{app}\%(PKGDIR)s\docs"; Components: core
175 Source: "docs\default.css"; DestDir: "{app}\%(PKGDIR)s\docs"; Components: core
176
177
178
179 ;;------------------------------------------------------------
180
181 [Run]
182 ;; Compile the .py files
183 Filename: "{code:GetPythonDir}\python.exe"; Parameters: "{code:GetPythonDir}\Lib\compileall.py {app}\%(PKGDIR)s"; Description: "Compile Python .py files to .pyc"; Flags: postinstall; Components: core
184
185 ;; Recreate the tool scripts to use the paths on the users machine
186 Filename: "{code:GetPythonDir}\python.exe"; Parameters: "CreateBatchFiles.py"; WorkingDir: "{code:GetPythonDir}\Scripts"; Description: "Create batch files for tool scripts"; Flags: postinstall; Components: core
187
188
189
190
191 ;;------------------------------------------------------------
192
193 [UninstallDelete]
194 Type: files; Name: "{app}\%(PKGDIR)s\wx\*.pyc";
195 Type: files; Name: "{app}\%(PKGDIR)s\wx\*.pyo";
196 Type: files; Name: "{app}\%(PKGDIR)s\wx\*.pyd";
197 Type: files; Name: "{app}\%(PKGDIR)s\wx\build\*.pyc";
198 Type: files; Name: "{app}\%(PKGDIR)s\wx\build\*.pyo";
199 Type: files; Name: "{app}\%(PKGDIR)s\wx\lib\*.pyc";
200 Type: files; Name: "{app}\%(PKGDIR)s\wx\lib\*.pyo";
201 Type: files; Name: "{app}\%(PKGDIR)s\wx\lib\analogclock\*.pyc";
202 Type: files; Name: "{app}\%(PKGDIR)s\wx\lib\analogclock\*.pyo";
203 Type: files; Name: "{app}\%(PKGDIR)s\wx\lib\analogclock\lib_setup\*.pyc";
204 Type: files; Name: "{app}\%(PKGDIR)s\wx\lib\analogclock\lib_setup\*.pyo";
205 Type: files; Name: "{app}\%(PKGDIR)s\wx\lib\art\*.pyc";
206 Type: files; Name: "{app}\%(PKGDIR)s\wx\lib\art\*.pyo";
207 Type: files; Name: "{app}\%(PKGDIR)s\wx\lib\colourchooser\*.pyc";
208 Type: files; Name: "{app}\%(PKGDIR)s\wx\lib\colourchooser\*.pyo";
209 Type: files; Name: "{app}\%(PKGDIR)s\wx\lib\editor\*.pyc";
210 Type: files; Name: "{app}\%(PKGDIR)s\wx\lib\editor\*.pyo";
211 Type: files; Name: "{app}\%(PKGDIR)s\wx\lib\mixins\*.pyc";
212 Type: files; Name: "{app}\%(PKGDIR)s\wx\lib\mixins\*.pyo";
213 Type: files; Name: "{app}\%(PKGDIR)s\wx\lib\masked\*.pyc";
214 Type: files; Name: "{app}\%(PKGDIR)s\wx\lib\masked\*.pyo";
215 Type: files; Name: "{app}\%(PKGDIR)s\wx\lib\ogl\*.pyc";
216 Type: files; Name: "{app}\%(PKGDIR)s\wx\lib\ogl\*.pyo";
217 Type: files; Name: "{app}\%(PKGDIR)s\wx\lib\floatcanvas\*.pyc";
218 Type: files; Name: "{app}\%(PKGDIR)s\wx\lib\floatcanvas\*.pyo";
219
220 Type: files; Name: "{app}\%(PKGDIR)s\wx\py\*.pyc";
221 Type: files; Name: "{app}\%(PKGDIR)s\wx\py\*.pyo";
222 Type: files; Name: "{app}\%(PKGDIR)s\wx\py\tests\*.pyc";
223 Type: files; Name: "{app}\%(PKGDIR)s\wx\py\tests\*.pyo";
224 Type: files; Name: "{app}\%(PKGDIR)s\wx\tools\*.pyc";
225 Type: files; Name: "{app}\%(PKGDIR)s\wx\tools\*.pyo";
226 Type: files; Name: "{app}\%(PKGDIR)s\wx\tools\XRCed\*.pyc";
227 Type: files; Name: "{app}\%(PKGDIR)s\wx\tools\XRCed\*.pyo";
228
229
230 Type: files; Name: "{app}\%(PKGDIR)s\wxPython\*.pyc";
231 Type: files; Name: "{app}\%(PKGDIR)s\wxPython\*.pyo";
232 Type: files; Name: "{app}\%(PKGDIR)s\wxPython\lib\*.pyc";
233 Type: files; Name: "{app}\%(PKGDIR)s\wxPython\lib\*.pyo";
234 Type: files; Name: "{app}\%(PKGDIR)s\wxPython\lib\colourchooser\*.pyc";
235 Type: files; Name: "{app}\%(PKGDIR)s\wxPython\lib\colourchooser\*.pyo";
236 Type: files; Name: "{app}\%(PKGDIR)s\wxPython\lib\editor\*.pyc";
237 Type: files; Name: "{app}\%(PKGDIR)s\wxPython\lib\editor\*.pyo";
238 Type: files; Name: "{app}\%(PKGDIR)s\wxPython\lib\mixins\*.pyc";
239 Type: files; Name: "{app}\%(PKGDIR)s\wxPython\lib\mixins\*.pyo";
240 Type: files; Name: "{app}\%(PKGDIR)s\wxPython\tools\*.pyc";
241 Type: files; Name: "{app}\%(PKGDIR)s\wxPython\tools\*.pyo";
242
243 Type: files; Name: "{app}\wxversion.pyc";
244 Type: files; Name: "{app}\wxversion.pyo";
245
246 Type: files; Name: "{app}\%(PKGDIR)s\wxaddons\*.pyc";
247 Type: files; Name: "{app}\%(PKGDIR)s\wxaddons\*.pyo";
248
249 %(UNINSTALL_BATCH)s
250
251 ''' + """
252 ;----------------------------------------------------------------------
253
254 [Code]
255
256 program Setup;
257 var
258 PythonDir : String;
259 InstallDir : String;
260
261
262 function InitializeSetup(): Boolean;
263 begin
264
265 (* -------------------------------------------------------------- *)
266 (* Figure out what to use as a default installation dir *)
267
268 if not RegQueryStringValue(HKEY_LOCAL_MACHINE,
269 'Software\Python\PythonCore\%(PYTHONVER)s\InstallPath',
270 '', PythonDir) then begin
271
272 if not RegQueryStringValue(HKEY_CURRENT_USER,
273 'Software\Python\PythonCore\%(PYTHONVER)s\InstallPath',
274 '', PythonDir) then begin
275
276 MsgBox('No installation of Python %(PYTHONVER)s found in registry.' + #13 +
277 'Be sure to enter a pathname that places wxPython on the PYTHONPATH',
278 mbConfirmation, MB_OK);
279 PythonDir := 'C:\Put a directory on PYTHONPATH here\';
280 end;
281 end;
282 InstallDir := PythonDir;
283 %(IF22)s
284
285 Result := True;
286 end;
287
288
289
290 function GetPythonDir(Default: String): String;
291 begin
292 Result := PythonDir;
293 end;
294
295
296
297 function GetInstallDir(Default: String): String;
298 begin
299 Result := InstallDir;
300 end;
301
302
303
304 function UninstallOld(FileName: String): Boolean;
305 var
306 ResultCode: Integer;
307 begin
308 Result := False;
309 if FileExists(FileName) then begin
310 Result := True;
311 ResultCode := MsgBox('A prior wxPython installation was found in this directory. It' + #13 +
312 'is recommended that it be uninstalled first.' + #13#13 +
313 'Should I do it?',
314 mbConfirmation, MB_YESNO);
315 if ResultCode = IDYES then begin
316 Exec(FileName, '/SILENT', WizardDirValue(), SW_SHOWNORMAL, ewWaitUntilTerminated, ResultCode);
317
318 end;
319 end;
320 end;
321
322
323
324 function NextButtonClick(CurPage: Integer): Boolean;
325 begin
326 Result := True;
327 if CurPage <> wpSelectDir then Exit;
328 if not UninstallOld(WizardDirValue() + '\wxPython\unins000.exe') then
329 if not UninstallOld(WizardDirValue() + '\wx\unins000.exe') then
330 UninstallOld(WizardDirValue() + '\%(PKGDIR)s\unins000.exe')
331 end;
332
333
334
335 function OnlyBeforeXP(): Boolean;
336 var
337 Version: TWindowsVersion;
338 begin
339 GetWindowsVersionEx(Version);
340 Result := True;
341 if (Version.Major > 5) or ((Version.Major = 5) and (Version.Minor >= 1)) then begin
342 Result := False;
343 end;
344 end;
345
346
347 begin
348 end.
349
350 """
351
352 #----------------------------------------------------------------------
353
354 ISS_DocDemo_Template = r'''
355
356 [Setup]
357 AppName = wxPython%(SHORTVER)s-docs-demos
358 AppVerName = wxPython Docs and Demos %(VERSION)s
359 OutputBaseFilename = wxPython%(SHORTVER)s-win32-docs-demos-%(VERSION)s
360 AppCopyright = Copyright © 2006 Total Control Software
361 DefaultDirName = {pf}\wxPython%(SHORTVER)s Docs and Demos
362 DefaultGroupName = wxPython%(SHORTVER)s Docs Demos and Tools
363 PrivilegesRequired = none
364 OutputDir = dist
365 WizardStyle = modern
366 DisableStartupPrompt = true
367 Compression = bzip
368 DirExistsWarning = no
369 DisableReadyMemo = true
370 DisableReadyPage = true
371 ;;DisableDirPage = true
372 DisableProgramGroupPage = no
373 UsePreviousAppDir = no
374 UsePreviousGroup = no
375
376 AppPublisher = Total Control Software
377 AppPublisherURL = http://wxPython.org/
378 AppSupportURL = http://wxPython.org/maillist.php
379 AppUpdatesURL = http://wxPython.org/download.php
380 AppVersion = %(VERSION)s
381
382 UninstallDisplayIcon = {app}\demo\wxpdemo.ico
383 UninstallFilesDir = {app}
384 LicenseFile = licence\licence.txt
385
386 ;; WizardDebug = yes
387
388
389 ;;------------------------------------------------------------
390
391
392 [Files]
393 Source: "demo\demo.py"; DestDir: "{app}\demo"; DestName: "demo.pyw";
394 Source: "demo\*.py"; DestDir: "{app}\demo";
395 Source: "demo\*.xml"; DestDir: "{app}\demo";
396 Source: "demo\*.txt"; DestDir: "{app}\demo";
397 Source: "demo\*.ico"; DestDir: "{app}\demo";
398
399 Source: "demo\bitmaps\*.bmp"; DestDir: "{app}\demo\bitmaps";
400 Source: "demo\bitmaps\*.gif"; DestDir: "{app}\demo\bitmaps";
401 Source: "demo\bitmaps\*.jpg"; DestDir: "{app}\demo\bitmaps";
402 Source: "demo\bitmaps\*.png"; DestDir: "{app}\demo\bitmaps";
403 Source: "demo\bitmaps\*.ico"; DestDir: "{app}\demo\bitmaps";
404
405 Source: "demo\bmp_source\*.gif"; DestDir: "{app}\demo\bmp_source";
406 Source: "demo\bmp_source\*.bmp"; DestDir: "{app}\demo\bmp_source";
407 Source: "demo\bmp_source\*.jpg"; DestDir: "{app}\demo\bmp_source";
408 Source: "demo\bmp_source\*.png"; DestDir: "{app}\demo\bmp_source";
409 Source: "demo\bmp_source\*.ico"; DestDir: "{app}\demo\bmp_source";
410
411 Source: "demo\data\*.htm"; DestDir: "{app}\demo\data";
412 Source: "demo\data\*.html"; DestDir: "{app}\demo\data";
413 Source: "demo\data\*.py"; DestDir: "{app}\demo\data";
414 Source: "demo\data\*.png"; DestDir: "{app}\demo\data";
415 Source: "demo\data\*.bmp"; DestDir: "{app}\demo\data";
416 Source: "demo\data\*.dat"; DestDir: "{app}\demo\data";
417 Source: "demo\data\*.txt"; DestDir: "{app}\demo\data";
418 Source: "demo\data\*.wav"; DestDir: "{app}\demo\data";
419 Source: "demo\data\*.wdr"; DestDir: "{app}\demo\data";
420 Source: "demo\data\*.xrc"; DestDir: "{app}\demo\data";
421 Source: "demo\data\*.swf"; DestDir: "{app}\demo\data";
422 Source: "demo\data\*.mpg"; DestDir: "{app}\demo\data";
423
424 Source: "demo\data\locale-src\*.po"; DestDir: "{app}\demo\data\locale-src";
425 Source: "demo\data\locale-src\install"; DestDir: "{app}\demo\data\locale-src";
426 Source: "demo\data\locale\af\LC_MESSAGES\*.mo"; DestDir: "{app}\demo\data\locale\af\LC_MESSAGES";
427 Source: "demo\data\locale\de\LC_MESSAGES\*.mo"; DestDir: "{app}\demo\data\locale\de\LC_MESSAGES";
428 Source: "demo\data\locale\es\LC_MESSAGES\*.mo"; DestDir: "{app}\demo\data\locale\es\LC_MESSAGES";
429 Source: "demo\data\locale\fr\LC_MESSAGES\*.mo"; DestDir: "{app}\demo\data\locale\fr\LC_MESSAGES";
430 Source: "demo\data\locale\it\LC_MESSAGES\*.mo"; DestDir: "{app}\demo\data\locale\it\LC_MESSAGES";
431
432 ;;Source: "demo\dllwidget\*.cpp"; DestDir: "{app}\demo\dllwidget";
433 ;;Source: "demo\dllwidget\*.py"; DestDir: "{app}\demo\dllwidget";
434 ;;Source: "demo\dllwidget\Makefile"; DestDir: "{app}\demo\dllwidget";
435 ;;Source: "demo\dllwidget\makefile.*"; DestDir: "{app}\demo\dllwidget";
436
437 Source: "licence\*.txt"; DestDir: "{app}\docs\licence";
438 Source: "%(WXDIR)s\docs\htmlhelp\wx.chm"; DestDir: "{app}\docs";
439 ;;Source: "%(WXDIR)s\docs\htmlhelp\ogl.chm"; DestDir: "{app}\docs";
440 Source: "docs\README.txt"; DestDir: "{app}\docs"; Flags: isreadme;
441 Source: "docs\*.txt"; DestDir: "{app}\docs";
442 Source: "docs\*.css"; DestDir: "{app}\docs";
443 Source: "docs\*.html"; DestDir: "{app}\docs";
444 Source: "docs\*.conf"; DestDir: "{app}\docs";
445 Source: "docs\screenshots\*.png"; DestDir: "{app}\docs\screenshots";
446
447
448 Source: "samples\doodle\*.py"; DestDir: "{app}\samples\doodle";
449 Source: "samples\doodle\*.txt"; DestDir: "{app}\samples\doodle";
450 Source: "samples\doodle\*.bat"; DestDir: "{app}\samples\doodle";
451 Source: "samples\doodle\sample.ddl"; DestDir: "{app}\samples\doodle";
452 Source: "samples\doodle\superdoodle.iss"; DestDir: "{app}\samples\doodle";
453
454 Source: "samples\docview\*.py"; DestDir: "{app}\samples\docview";
455 Source: "samples\pydocview\*.py"; DestDir: "{app}\samples\pydocview";
456 Source: "samples\pydocview\*.png"; DestDir: "{app}\samples\pydocview";
457 Source: "samples\pydocview\*.txt"; DestDir: "{app}\samples\pydocview";
458
459 Source: "samples\ide\*.py"; DestDir: "{app}\samples\ide";
460 Source: "samples\ide\activegrid\*.py"; DestDir: "{app}\samples\ide\activegrid";
461 Source: "samples\ide\activegrid\tool\*.py"; DestDir: "{app}\samples\ide\activegrid\tool";
462 Source: "samples\ide\activegrid\tool\data\*.txt"; DestDir: "{app}\samples\ide\activegrid\tool\data";
463 Source: "samples\ide\activegrid\util\*.py"; DestDir: "{app}\samples\ide\activegrid\util";
464 Source: "samples\ide\activegrid\model\*.py"; DestDir: "{app}\samples\ide\activegrid\model";
465
466 Source: "samples\embedded\*.py"; DestDir: "{app}\samples\embedded";
467 Source: "samples\embedded\*.cpp"; DestDir: "{app}\samples\embedded";
468 Source: "samples\embedded\*.txt"; DestDir: "{app}\samples\embedded";
469 Source: "samples\embedded\*.vc"; DestDir: "{app}\samples\embedded";
470 Source: "samples\embedded\*.unx"; DestDir: "{app}\samples\embedded";
471 Source: "samples\embedded\*.ico"; DestDir: "{app}\samples\embedded";
472 Source: "samples\embedded\*.xpm"; DestDir: "{app}\samples\embedded";
473 Source: "samples\embedded\*.rc"; DestDir: "{app}\samples\embedded";
474
475 Source: "samples\frogedit\*.py"; DestDir: "{app}\samples\frogedit";
476
477 Source: "samples\hangman\*.py"; DestDir: "{app}\samples\hangman";
478
479 Source: "samples\mainloop\*.py"; DestDir: "{app}\samples\mainloop";
480
481 Source: "samples\pySketch\*.py"; DestDir: "{app}\samples\pySketch";
482 Source: "samples\pySketch\images\*.bmp"; DestDir: "{app}\samples\pySketch\images";
483
484 Source: "samples\simple\*.py"; DestDir: "{app}\samples\simple";
485
486 Source: "samples\StyleEditor\*.txt"; DestDir: "{app}\samples\StyleEditor";
487 Source: "samples\StyleEditor\*.py"; DestDir: "{app}\samples\StyleEditor";
488 Source: "samples\StyleEditor\*.cfg"; DestDir: "{app}\samples\StyleEditor";
489
490 Source: "samples\wxProject\*.txt"; DestDir: "{app}\samples\wxProject";
491 Source: "samples\wxProject\*.py"; DestDir: "{app}\samples\wxProject";
492
493 Source: "samples\wxPIA_book\*"; DestDir: "{app}\wxPython\samples\wxPIA_book";
494 Source: "samples\wxPIA_book\Chapter-01\*"; DestDir: "{app}\wxPython\samples\wxPIA_book\Chapter-01";
495 Source: "samples\wxPIA_book\Chapter-02\*"; DestDir: "{app}\wxPython\samples\wxPIA_book\Chapter-02";
496 Source: "samples\wxPIA_book\Chapter-03\*"; DestDir: "{app}\wxPython\samples\wxPIA_book\Chapter-03";
497 Source: "samples\wxPIA_book\Chapter-04\*"; DestDir: "{app}\wxPython\samples\wxPIA_book\Chapter-04";
498 Source: "samples\wxPIA_book\Chapter-05\*"; DestDir: "{app}\wxPython\samples\wxPIA_book\Chapter-05";
499 Source: "samples\wxPIA_book\Chapter-06\*"; DestDir: "{app}\wxPython\samples\wxPIA_book\Chapter-06";
500 Source: "samples\wxPIA_book\Chapter-07\*"; DestDir: "{app}\wxPython\samples\wxPIA_book\Chapter-07";
501 Source: "samples\wxPIA_book\Chapter-08\*"; DestDir: "{app}\wxPython\samples\wxPIA_book\Chapter-08";
502 Source: "samples\wxPIA_book\Chapter-09\*"; DestDir: "{app}\wxPython\samples\wxPIA_book\Chapter-09";
503 Source: "samples\wxPIA_book\Chapter-10\*"; DestDir: "{app}\wxPython\samples\wxPIA_book\Chapter-10";
504 Source: "samples\wxPIA_book\Chapter-11\*"; DestDir: "{app}\wxPython\samples\wxPIA_book\Chapter-11";
505 Source: "samples\wxPIA_book\Chapter-12\*"; DestDir: "{app}\wxPython\samples\wxPIA_book\Chapter-12";
506 Source: "samples\wxPIA_book\Chapter-13\*"; DestDir: "{app}\wxPython\samples\wxPIA_book\Chapter-13";
507 Source: "samples\wxPIA_book\Chapter-14\*"; DestDir: "{app}\wxPython\samples\wxPIA_book\Chapter-14";
508 Source: "samples\wxPIA_book\Chapter-15\*"; DestDir: "{app}\wxPython\samples\wxPIA_book\Chapter-15";
509 Source: "samples\wxPIA_book\Chapter-16\*"; DestDir: "{app}\wxPython\samples\wxPIA_book\Chapter-16";
510 Source: "samples\wxPIA_book\Chapter-16\helpfiles\*"; DestDir: "{app}\wxPython\samples\wxPIA_book\Chapter-16\helpfiles";
511 Source: "samples\wxPIA_book\Chapter-17\*"; DestDir: "{app}\wxPython\samples\wxPIA_book\Chapter-17";
512 Source: "samples\wxPIA_book\Chapter-18\*"; DestDir: "{app}\wxPython\samples\wxPIA_book\Chapter-18";
513
514
515 Source: "scripts\pyshell"; DestDir: "{app}\scripts"; DestName: "pyshell.pyw";
516 Source: "scripts\pycrust"; DestDir: "{app}\scripts"; DestName: "pycrust.pyw";
517 Source: "scripts\pyalamode"; DestDir: "{app}\scripts"; DestName: "pyalamode.pyw";
518 Source: "scripts\pyalacarte"; DestDir: "{app}\scripts"; DestName: "pyalacarte.pyw";
519 Source: "scripts\xrced"; DestDir: "{app}\scripts"; DestName: "xrced.pyw";
520
521 Source: "wx\py\PyCrust.ico"; DestDir: "{app}\scripts";
522 Source: "wx\tools\XRCed\xrced.ico"; DestDir: "{app}\scripts";
523
524
525 ;;------------------------------------------------------------
526
527 [Icons]
528 Name: "{group}\Run the wxPython DEMO"; Filename: "{app}\demo\demo.pyw"; WorkingDir: "{app}\demo"; IconFilename: "{app}\demo\wxpdemo.ico";
529 Name: "{group}\PyCrust"; Filename: "{app}\scripts\pycrust.pyw"; WorkingDir: "c:\"; IconFilename: "{app}\scripts\PyCrust.ico";
530 Name: "{group}\PyShell"; Filename: "{app}\scripts\pyshell.pyw"; WorkingDir: "c:\"; IconFilename: "{app}\scripts\PyCrust.ico";
531 Name: "{group}\PyAlaMode"; Filename: "{app}\scripts\pyalamode.pyw"; WorkingDir: "c:\"; IconFilename: "{app}\scripts\PyCrust.ico";
532 Name: "{group}\PyAlaCarte"; Filename: "{app}\scripts\pyalacarte.pyw"; WorkingDir: "c:\"; IconFilename: "{app}\scripts\PyCrust.ico";
533 Name: "{group}\Resource Editor"; Filename: "{app}\scripts\xrced.pyw"; WorkingDir: "c:\"; IconFilename: "{app}\scripts\xrced.ico";
534
535 Name: "{group}\Sample Apps"; Filename: "{app}\samples";
536
537 Name: "{group}\wxWidgets Reference"; Filename: "{app}\docs\wx.chm";
538 Name: "{group}\Migration Guide"; Filename: "{app}\docs\MigrationGuide.html";
539 Name: "{group}\Recent Changes"; Filename: "{app}\docs\CHANGES.html";
540 Name: "{group}\Other Docs"; Filename: "{app}\docs";
541
542 Name: "{group}\Uninstall wxPython Docs and Demos"; Filename: "{uninstallexe}";
543
544
545
546
547 ;;------------------------------------------------------------
548
549 [UninstallDelete]
550 Type: files; Name: "{app}\demo\*.pyc";
551 Type: files; Name: "{app}\demo\*.pyo";
552 Type: files; Name: "{app}\demo\data\showTips";
553 Type: files; Name: "{app}\demo\data\*.pyc";
554 Type: files; Name: "{app}\demo\data\*.pyo";
555 Type: files; Name: "{app}\demo\dllwidget\*.pyc";
556 Type: files; Name: "{app}\demo\dllwidget\*.pyo";
557
558 Type: files; Name: "{app}\samples\doodle\*.pyc";
559 Type: files; Name: "{app}\samples\doodle\*.pyo";
560 Type: files; Name: "{app}\samples\embedded\*.pyc";
561 Type: files; Name: "{app}\samples\embedded\*.pyo";
562 Type: files; Name: "{app}\samples\frogedit\*.pyc";
563 Type: files; Name: "{app}\samples\frogedit\*.pyo";
564 Type: files; Name: "{app}\samples\hangman\*.pyc";
565 Type: files; Name: "{app}\samples\hangman\*.pyo";
566 Type: files; Name: "{app}\samples\hangman\*.txt";
567 Type: files; Name: "{app}\samples\mainloop\*.pyc";
568 Type: files; Name: "{app}\samples\mainloop\*.pyo";
569 Type: files; Name: "{app}\samples\pySketch\*.pyc";
570 Type: files; Name: "{app}\samples\pySketch\*.pyo";
571 Type: files; Name: "{app}\samples\simple\*.pyc";
572 Type: files; Name: "{app}\samples\simple\*.pyo";
573 Type: files; Name: "{app}\samples\StyleEditor\*.pyc";
574 Type: files; Name: "{app}\samples\StyleEditor\*.pyo";
575 Type: files; Name: "{app}\samples\wx_examples\basic\*.pyc";
576 Type: files; Name: "{app}\samples\wx_examples\basic\*.pyo";
577 Type: files; Name: "{app}\samples\wx_examples\hello\*.pyc";
578 Type: files; Name: "{app}\samples\wx_examples\hello\*.pyo";
579 Type: files; Name: "{app}\samples\wxProject\*.pyc";
580 Type: files; Name: "{app}\samples\wxProject\*.pyo";
581
582 Type: files; Name: "{app}\samples\ide\*.pyc";
583 Type: files; Name: "{app}\samples\ide\activegrid\*.pyc";
584 Type: files; Name: "{app}\samples\ide\activegrid\tool\*.pyc";
585 Type: files; Name: "{app}\samples\ide\activegrid\util\*.pyc";
586 Type: files; Name: "{app}\samples\ide\activegrid\model\*.pyc";
587 Type: files; Name: "{app}\samples\ide\*.pyo";
588 Type: files; Name: "{app}\samples\ide\activegrid\*.pyo";
589 Type: files; Name: "{app}\samples\ide\activegrid\tool\*.pyo";
590 Type: files; Name: "{app}\samples\ide\activegrid\util\*.pyo";
591 Type: files; Name: "{app}\samples\ide\activegrid\model\*.pyo";
592
593 Type: files; Name: "{app}\samples\docview\*.pyc";
594 Type: files; Name: "{app}\samples\pydocview\*.pyc";
595 Type: files; Name: "{app}\samples\docview\*.pyo";
596 Type: files; Name: "{app}\samples\pydocview\*.pyo";
597
598 Type: files; Name: "{app}\samples\wxPIA_book\*";
599 Type: files; Name: "{app}\samples\wxPIA_book\Chapter-01\*";
600 Type: files; Name: "{app}\samples\wxPIA_book\Chapter-02\*";
601 Type: files; Name: "{app}\samples\wxPIA_book\Chapter-03\*";
602 Type: files; Name: "{app}\samples\wxPIA_book\Chapter-04\*";
603 Type: files; Name: "{app}\samples\wxPIA_book\Chapter-05\*";
604 Type: files; Name: "{app}\samples\wxPIA_book\Chapter-06\*";
605 Type: files; Name: "{app}\samples\wxPIA_book\Chapter-07\*";
606 Type: files; Name: "{app}\samples\wxPIA_book\Chapter-08\*";
607 Type: files; Name: "{app}\samples\wxPIA_book\Chapter-09\*";
608 Type: files; Name: "{app}\samples\wxPIA_book\Chapter-10\*";
609 Type: files; Name: "{app}\samples\wxPIA_book\Chapter-11\*";
610 Type: files; Name: "{app}\samples\wxPIA_book\Chapter-12\*";
611 Type: files; Name: "{app}\samples\wxPIA_book\Chapter-13\*";
612 Type: files; Name: "{app}\samples\wxPIA_book\Chapter-14\*";
613 Type: files; Name: "{app}\samples\wxPIA_book\Chapter-15\*";
614 Type: files; Name: "{app}\samples\wxPIA_book\Chapter-16\*";
615 Type: files; Name: "{app}\samples\wxPIA_book\Chapter-16\helpfiles\*";
616 Type: files; Name: "{app}\samples\wxPIA_book\Chapter-17\*";
617 Type: files; Name: "{app}\samples\wxPIA_book\Chapter-18\*";
618
619
620 '''
621
622 #----------------------------------------------------------------------
623
624 def find_DLLs():
625
626 WXDLLVER = PYTHONVER = None
627
628 proc = os.popen(r"dumpbin /imports wx\_core_.pyd", "r")
629 lines = proc.readlines()
630 proc.close()
631 for line in lines:
632 if line.startswith(" wxmsw"):
633 WXDLLVER = line[9:14].split('_')[0]
634
635 if line.startswith(" python"):
636 PYTHONVER = line[10] + '.' + line[11]
637
638 return WXDLLVER, PYTHONVER
639
640
641 #----------------------------------------------------------------------
642
643 locale_template = 'Source: "%s"; DestDir: "{app}\%s\%s"; Components: core'
644
645 def build_locale_string(pkgdir):
646 stringlst = []
647
648 def walk_helper(lst, dirname, files):
649 for f in files:
650 filename = os.path.join(dirname, f)
651 if not os.path.isdir(filename):
652 lst.append( locale_template % (filename, pkgdir, dirname) )
653
654 os.path.walk('wx\\locale', walk_helper, stringlst)
655 return '\n'.join(stringlst)
656
657
658 def get_system_dir():
659 for p in [r"C:\WINNT\SYSTEM32",
660 r"C:\WINDOWS\SYSTEM32",
661 ]:
662 if os.path.exists(p):
663 return p
664 raise IOError, "System dir not found"
665
666
667 def get_batch_files():
668 globs = {}
669 execfile("scripts/CreateBatchFiles.py", globs)
670 scripts = globs["scripts"]
671 scripts = ['Type: files; Name: "{code:GetPythonDir}\Scripts\%s.bat";' % i[0] for i in scripts]
672 return '\n'.join(scripts)
673
674
675
676 runtime_template1 = 'Source: "%(name)s"; DestDir: "{code:GetPythonDir}"; Flags: uninsneveruninstall; Components: core'
677 runtime_template2 = 'Source: "%(name)s"; DestDir: "{app}\%(PKGDIR)s\wx"; Components: core; Flags: replacesameversion'
678
679 def get_runtime_dlls(PYVER, PKGDIR):
680 if PYVER >= "py24":
681 return ( runtime_template1 % dict(name=r"distrib\msw\msvcr71.dll", PKGDIR=PKGDIR),
682 runtime_template2 % dict(name=r"distrib\msw\msvcp71.dll", PKGDIR=PKGDIR) )
683 else:
684 return ( runtime_template1 % dict(name=r"distrib\msw\MSVCRT.dll", PKGDIR=PKGDIR),
685 runtime_template2 % dict(name=r"distrib\msw\MSVCIRT.dll", PKGDIR=PKGDIR) + "\n" +
686 runtime_template2 % dict(name=r"distrib\msw\MSVCP60.dll", PKGDIR=PKGDIR) )
687
688
689 #----------------------------------------------------------------------
690
691 def main():
692
693 verglob = {}
694 execfile("wx/__version__.py", verglob)
695
696 VERSION = verglob["VERSION_STRING"]
697 SHORTVER = VERSION[:3]
698
699 WXDLLVER, PYTHONVER = find_DLLs()
700
701 PYVER = "py" + PYTHONVER[0] + PYTHONVER[2]
702 WXDIR = os.environ["WXWIN"]
703 WXPYDIR = os.path.join(WXDIR, "wxPython")
704 SYSDIR = get_system_dir()
705 ISSFILE = "__wxPython.iss"
706 ISSDEMOFILE = "__wxPythonDemo.iss"
707 UNINSTALL_BATCH = get_batch_files()
708 PKGDIR = open('src/wx.pth').read()
709 LOCALE = build_locale_string(PKGDIR)
710 RTDLL,CPPDLL = get_runtime_dlls(PYVER, PKGDIR)
711
712 print """
713 Building Win32 installer for wxPython:
714 VERSION = %(VERSION)s
715 SHORTVER = %(SHORTVER)s
716 WXDLLVER = %(WXDLLVER)s
717 PYTHONVER = %(PYTHONVER)s
718 PYVER = %(PYVER)s
719 PKGDIR = %(PKGDIR)s
720 WXDIR = %(WXDIR)s
721 WXPYDIR = %(WXPYDIR)s
722 SYSDIR = %(SYSDIR)s
723 """ % vars()
724
725 if PYTHONVER >= "2.2":
726 IF22 = r"InstallDir := InstallDir + '\Lib\site-packages';"
727 else:
728 IF22 = ""
729
730 MSLU=''
731 CHARTYPE='ansi'
732 if "UNICODE=1" in sys.argv:
733 MSLU=r'Source: "distrib\msw\unicows.dll"; DestDir: "{code:GetPythonDir}"; Components: core; Flags: replacesameversion sharedfile' % vars()
734 CHARTYPE='unicode'
735
736 f = open(ISSFILE, "w")
737 f.write(ISS_Template % vars())
738 f.close()
739
740 f = open(ISSDEMOFILE, "w")
741 f.write(ISS_DocDemo_Template % vars())
742 f.close()
743
744 TOOLS = os.environ['TOOLS']
745 if TOOLS.startswith('/cygdrive'):
746 TOOLS = r"c:\TOOLS" # temporary hack until I convert everything over to bash
747
748 os.system(ISCC % (TOOLS, ISSFILE))
749 os.system(ISCC % (TOOLS, ISSDEMOFILE))
750
751 if not KEEP_TEMPS:
752 time.sleep(1)
753 os.remove(ISSFILE)
754 os.remove(ISSDEMOFILE)
755
756
757 #----------------------------------------------------------------------
758
759 if __name__ == "__main__":
760 main()
761
762
763
764 #----------------------------------------------------------------------
765
766