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