]>
git.saurik.com Git - wxWidgets.git/blob - wxPython/distrib/make_installer.py
2 This script will generate a setup script for InnoSetup and then run it
3 to make the installer executable. If all goes right the proper versions
4 of Python and wxWindows (including hybrid/final settings) will all be
5 calculated based on what wxc.pyd imports and an appropriate installer
14 #----------------------------------------------------------------------
17 ;;------------------------------------------------------------
21 AppVerName = wxPython %(VERSION)s
22 OutputBaseFilename = wxPython-%(VERSION)s-%(PYVER)s
23 AppCopyright = Copyright © 2001 Total Control Software
24 DefaultDirName = {code:GetPythonDir|c:\DoNotInstallHere}
25 DefaultGroupName = wxPython %(SHORTVER)s for Python %(PYTHONVER)s
26 AlwaysCreateUninstallIcon = yes
29 ;; OutputDir is relative to SourceDir
32 UninstallStyle = modern
33 DisableStartupPrompt = true
36 DisableReadyMemo = true
37 DisableReadyPage = true
38 ;;DisableDirPage = true
39 DisableProgramGroupPage = true
40 DisableAppendDir = true
42 UninstallFilesDir = {app}\wxPython
43 AppPublisherURL = http://wxPython.org/
44 LicenseFile = licence\licence.txt
45 CodeFile = %(IFSFILE)s
47 ;;------------------------------------------------------------
52 ;;------------------------------------------------------------
55 Name: core; Description: "wxPython modules and library"; Types: full compact custom; Flags: fixed
56 Name: docs; Description: "Documentation"; Types: full
57 Name: demo; Description: "Demo application"; Types: full
58 Name: samples; Description: "Sample applications"; Types: full
59 Name: tools; Description: "Tools"; Types: full
62 ;;------------------------------------------------------------
65 Source: "%(SYSDIR)s\MSVCRT.dll"; DestDir: "{sys}"; CopyMode: alwaysskipifsameorolder; Flags: sharedfile uninsneveruninstall restartreplace; Components: core
66 Source: "%(SYSDIR)s\MSVCIRT.dll"; DestDir: "{sys}"; CopyMode: alwaysskipifsameorolder; Flags: sharedfile uninsneveruninstall restartreplace; Components: core
68 Source: "%(WXDIR)s\lib\%(WXDLL)s"; DestDir: "{app}\wxPython"; Components: core
69 Source: "wxPython\wxc.pyd"; DestDir: "{app}\wxPython"; Components: core
70 Source: "wxPython\gridc.pyd"; DestDir: "{app}\wxPython"; Components: core
71 Source: "wxPython\htmlc.pyd"; DestDir: "{app}\wxPython"; Components: core
72 Source: "wxPython\utilsc.pyd"; DestDir: "{app}\wxPython"; Components: core
73 Source: "wxPython\calendarc.pyd"; DestDir: "{app}\wxPython"; Components: core
74 Source: "wxPython\glcanvasc.pyd"; DestDir: "{app}\wxPython"; Components: core
75 Source: "wxPython\oglc.pyd"; DestDir: "{app}\wxPython"; Components: core
76 Source: "wxPython\stc_c.pyd"; DestDir: "{app}\wxPython"; Components: core
78 Source: "wxPython\*.py"; DestDir: "{app}\wxPython"; Components: core
79 Source: "wxPython\lib\*.py"; DestDir: "{app}\wxPython\lib"; Components: core
80 Source: "wxPython\lib\editor\*.py"; DestDir: "{app}\wxPython\lib\editor"; Components: core
81 Source: "wxPython\lib\editor\*.txt"; DestDir: "{app}\wxPython\lib\editor"; Components: core
83 Source: "demo\*.py"; DestDir: "{app}\wxPython\demo"; Components: demo
84 Source: "demo\*.xml"; DestDir: "{app}\wxPython\demo"; Components: demo
85 Source: "demo\*.txt"; DestDir: "{app}\wxPython\demo"; Components: demo
87 Source: "demo\bitmaps\*.gif"; DestDir: "{app}\wxPython\demo\bitmaps"; Components: demo
88 Source: "demo\bitmaps\*.bmp"; DestDir: "{app}\wxPython\demo\bitmaps"; Components: demo
89 Source: "demo\bitmaps\*.jpg"; DestDir: "{app}\wxPython\demo\bitmaps"; Components: demo
90 Source: "demo\bitmaps\*.png"; DestDir: "{app}\wxPython\demo\bitmaps"; Components: demo
91 Source: "demo\bitmaps\*.ico"; DestDir: "{app}\wxPython\demo\bitmaps"; Components: demo
93 Source: "demo\data\*.htm"; DestDir: "{app}\wxPython\demo\data"; Components: demo
94 Source: "demo\data\*.html"; DestDir: "{app}\wxPython\demo\data"; Components: demo
95 Source: "demo\data\*.py"; DestDir: "{app}\wxPython\demo\data"; Components: demo
96 Source: "demo\data\*.png"; DestDir: "{app}\wxPython\demo\data"; Components: demo
97 Source: "demo\data\*.bmp"; DestDir: "{app}\wxPython\demo\data"; Components: demo
98 Source: "demo\data\*.i"; DestDir: "{app}\wxPython\demo\data"; Components: demo
99 Source: "demo\data\*.h"; DestDir: "{app}\wxPython\demo\data"; Components: demo
100 Source: "demo\data\*.txt"; DestDir: "{app}\wxPython\demo\data"; Components: demo
102 Source: "README.txt"; DestDir: "{app}\wxPython\docs"; Flags: isreadme; Components: core
103 Source: "CHANGES.txt"; DestDir: "{app}\wxPython\docs"; Components: core
104 Source: "licence\*.txt"; DestDir: "{app}\wxPython\docs\licence"; Components: core
105 Source: "%(WXDIR)s\docs\htmlhelp\wx.chm"; DestDir: "{app}\wxPython\docs"; Components: docs
106 Source: "%(WXDIR)s\docs\htmlhelp\ogl.chm"; DestDir: "{app}\wxPython\docs"; Components: docs
108 Source: "tools\*.py"; DestDir: "{app}\wxPython\tools"; Components: tools
110 Source: "samples\doodle\*.py"; DestDir: "{app}\wxPython\samples\doodle"; Components: samples
111 Source: "samples\doodle\*.txt"; DestDir: "{app}\wxPython\samples\doodle"; Components: samples
112 Source: "samples\doodle\sample.ddl"; DestDir: "{app}\wxPython\samples\doodle"; Components: samples
113 Source: "samples\doodle\superdoodle.iss"; DestDir: "{app}\wxPython\samples\doodle"; Components: samples
114 Source: "samples\wxProject\*.txt"; DestDir: "{app}\wxPython\samples\wxProject"; Components: samples
115 Source: "samples\wxProject\*.py"; DestDir: "{app}\wxPython\samples\wxProject"; Components: samples
117 Source: "samples\stxview\*.py"; DestDir: "{app}\wxPython\samples\stxview"; Components: samples
118 Source: "samples\stxview\*.stx"; DestDir: "{app}\wxPython\samples\stxview"; Components: samples
119 Source: "samples\stxview\*.txt"; DestDir: "{app}\wxPython\samples\stxview"; Components: samples
120 Source: "samples\stxview\StructuredText\*.py"; DestDir: "{app}\wxPython\samples\stxview\StructuredText"; Components: samples
123 ;;------------------------------------------------------------
126 Name: "{group}\Run the DEMO"; Filename: "{code:GetPythonDir}\pythonw.exe"; WorkingDir: "{app}\wxPython\demo"; Parameters: "demo.py";
127 Name: "{group}\wxWindows Referece"; Filename: "{app}\wxPython\docs\wx.chm";
128 Name: "{group}\wxOGL Referece"; Filename: "{app}\wxPython\docs\ogl.chm";
129 Name: "{group}\licence.txt"; Filename: "{app}\wxPython\docs\licence\licence.txt";
130 Name: "{group}\README.txt"; Filename: "{app}\wxPython\docs\README.txt";
131 Name: "{group}\CHANGES.txt"; Filename: "{app}\wxPython\docs\CHANGES.txt";
132 Name: "{group}\Sample Apps"; Filename: "{app}\wxPython\samples"; Components: samples
134 ;;Name: "{group}\Uninstall wxPython"; Filename: "{app}\wxPython\unins000.exe"; WorkingDir: "{app}\wxPython";
137 ;;------------------------------------------------------------
140 Type: files; Name: "{app}\wxPython\*.pyc";
141 Type: files; Name: "{app}\wxPython\*.pyo";
142 Type: files; Name: "{app}\wxPython\lib\*.pyc";
143 Type: files; Name: "{app}\wxPython\lib\*.pyo";
144 Type: files; Name: "{app}\wxPython\lib\editor\*.pyc";
145 Type: files; Name: "{app}\wxPython\lib\editor\*.pyo";
146 Type: files; Name: "{app}\wxPython\demo\*.pyc";
147 Type: files; Name: "{app}\wxPython\demo\*.pyo";
148 Type: files; Name: "{app}\wxPython\demo\data\showTips";
149 Type: files; Name: "{app}\wxPython\tools\*.pyc";
150 Type: files; Name: "{app}\wxPython\tools\*.pyo";
151 Type: files; Name: "{app}\wxPython\samples\doodle\*.pyc";
152 Type: files; Name: "{app}\wxPython\samples\doodle\*.pyo";
153 Type: files; Name: "{app}\wxPython\samples\wxProject\*.pyc";
154 Type: files; Name: "{app}\wxPython\samples\wxProject\*.pyo";
155 Type: files; Name: "{app}\wxPython\samples\stxview\*.pyc";
156 Type: files; Name: "{app}\wxPython\samples\stxview\*.pyo";
157 Type: files; Name: "{app}\wxPython\samples\stxview\StructuredText\*.pyc";
158 Type: files; Name: "{app}\wxPython\samples\stxview\StructuredText\*.pyo";
163 #----------------------------------------------------------------------
170 function InitializeSetup(): Boolean;
172 if not RegQueryStringValue(HKEY_LOCAL_MACHINE,
173 'Software\Python\PythonCore\%(PYTHONVER)s\InstallPath',
174 '', PythonDir) then begin
175 MsgBox('No installation of Python %(PYTHONVER)s found. Aborting...',
176 mbConfirmation, MB_OK);
183 function GetPythonDir(Default: String): String;
194 #----------------------------------------------------------------------
198 WXDLL
= PYTHONVER
= None
200 proc
= os
.popen(r
"dumpbin /imports wxPython\wxc.pyd", "r")
201 lines
= proc
.readlines()
204 if line
[:6] == " wx":
205 WXDLL
= string
.strip(line
)
207 if line
[:10] == " python":
208 PYTHONVER
= line
[10] + '.' + line
[11]
210 if WXDLL
and PYTHONVER
:
211 return WXDLL
, PYTHONVER
214 #----------------------------------------------------------------------
219 execfile("wxPython/__version__.py", verglob
)
221 VERSION
= verglob
["ver"]
222 SHORTVER
= VERSION
[:3]
224 WXDLL
, PYTHONVER
= find_DLLs()
226 PYVER
= "Py" + PYTHONVER
[0] + PYTHONVER
[2]
227 WXDIR
= os
.environ
["WXWIN"]
228 WXPYDIR
= os
.path
.join(WXDIR
, "wxPython")
229 SYSDIR
= r
"C:\WINNT\SYSTEM32"
230 ISSFILE
= "__wxPython.iss"
231 IFSFILE
= "__wxPython.ifs"
234 if string
.find(WXDLL
, "h") != -1:
235 PYVER
= PYVER
+ "-hybrid"
237 f
= open(ISSFILE
, "w")
238 f
.write(ISS_Template
% vars())
241 f
= open(IFSFILE
, "w")
242 f
.write(IFS_Template
% vars())
245 os
.system(r
"C:\TOOLS\InnoSetup2Ex\ISCC.exe %s" % ISSFILE
)
252 #----------------------------------------------------------------------
254 if __name__
== "__main__":
259 #----------------------------------------------------------------------