forked from cztomczak/cefpython
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinnosetup.template
More file actions
165 lines (129 loc) · 6.46 KB
/
innosetup.template
File metadata and controls
165 lines (129 loc) · 6.46 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
; Parts of this code was taken from wxPython/distrib/make_installer.py
[Setup]
AppName = CEF Python 3 for Python %(PYTHON_VERSION)s %(APP_NAME_BITS)s
AppVersion = %(APP_VERSION)s
AppVerName = CEF Python 3 version %(APP_VERSION)s for Python %(PYTHON_VERSION)s %(PYTHON_ARCHITECTURE)s
AppPublisher = Czarek Tomczak
AppPublisherURL = http://code.google.com/cefpython/
AppSupportURL = https://groups.google.com/group/cefpython?hl=en
AppUpdatesURL = http://code.google.com/cefpython/
AppCopyright = Copyright 2012-2013 Czarek Tomczak
DefaultDirName = {code:GetInstallDir|c:\Python}
DefaultGroupName = CEF Python 3 for Python %(PYTHON_VERSION)s %(APP_NAME_BITS)s
PrivilegesRequired = none
DisableStartupPrompt = yes
Compression = zip
DirExistsWarning = no
DisableReadyMemo = yes
DisableReadyPage = yes
DisableDirPage = no
DisableProgramGroupPage = no
UsePreviousAppDir = yes
UsePreviousGroup = yes
SourceDir = %(BINARIES_DIR)s
OutputDir = %(INSTALLER_DIR)s\Output
OutputBaseFilename = %(PACKAGE_NAME)s-%(APP_VERSION)s.%(PLATFORM)s-py%(PYTHON_VERSION)s-innosetup
UninstallFilesDir = {app}\%(PACKAGE_NAME)s
LicenseFile = %(BINARIES_DIR)s\LICENSE.txt
[Icons]
Name: "{group}\Examples"; Filename: "{app}\%(PACKAGE_NAME)s\examples";
Name: "{group}\Uninstall Package"; Filename: "{uninstallexe}";
[Run]
Filename: "{app}\%(PACKAGE_NAME)s\examples"; Flags: postinstall skipifsilent shellexec;
[Files]
Source: "*.dll"; DestDir: "{app}\%(PACKAGE_NAME)s"; Flags: ignoreversion;
Source: "*.pak"; DestDir: "{app}\%(PACKAGE_NAME)s"; Flags: ignoreversion;
Source: "locales\*.pak"; DestDir: "{app}\%(PACKAGE_NAME)s\locales"; Flags: ignoreversion;
Source: "%(INSTALLER_DIR)s\__init__.py.generated"; DestDir: "{app}\%(PACKAGE_NAME)s"; DestName: "__init__.py"; Flags: ignoreversion;
Source: "cefclient.exe"; DestDir: "{app}\%(PACKAGE_NAME)s"; Flags: ignoreversion;
Source: "cefpython_py%(PYTHON_VERSION_NODOT)s.pyd"; DestDir: "{app}\%(PACKAGE_NAME)s"; Flags: ignoreversion;
Source: "LICENSE.txt"; DestDir: "{app}\%(PACKAGE_NAME)s"; Flags: ignoreversion;
Source: "README.txt"; DestDir: "{app}\%(PACKAGE_NAME)s"; Flags: ignoreversion;
Source: "subprocess.exe"; DestDir: "{app}\%(PACKAGE_NAME)s"; Flags: ignoreversion;
; ------------------------------------------------------------------------------
; wx subpackage
; ------------------------------------------------------------------------------
Source: "%(WX_SUBPACKAGE_DIR)s\*.py"; DestDir: "{app}\%(PACKAGE_NAME)s\wx"; Flags: ignoreversion;
Source: "%(WX_SUBPACKAGE_DIR)s\*.txt"; DestDir: "{app}\%(PACKAGE_NAME)s\wx"; Flags: ignoreversion;
Source: "%(WX_SUBPACKAGE_DIR)s\images\*.png"; DestDir: "{app}\%(PACKAGE_NAME)s\wx\images"; Flags: ignoreversion;
; ------------------------------------------------------------------------------
; wx examples
; ------------------------------------------------------------------------------
Source: "%(WX_SUBPACKAGE_DIR)s\examples\*.py"; DestDir: "{app}\%(PACKAGE_NAME)s\examples\wx"; Flags: ignoreversion;
Source: "%(WX_SUBPACKAGE_DIR)s\examples\*.html"; DestDir: "{app}\%(PACKAGE_NAME)s\examples\wx"; Flags: ignoreversion;
Source: "%(WX_SUBPACKAGE_DIR)s\examples\*.png"; DestDir: "{app}\%(PACKAGE_NAME)s\examples\wx"; Flags: ignoreversion;
; ------------------------------------------------------------------------------
; examples
; ------------------------------------------------------------------------------
Source: "*.py"; DestDir: "{app}\%(PACKAGE_NAME)s\examples"; Flags: ignoreversion;
Source: "*.html"; DestDir: "{app}\%(PACKAGE_NAME)s\examples"; Flags: ignoreversion;
Source: "*.css"; DestDir: "{app}\%(PACKAGE_NAME)s\examples"; Flags: ignoreversion;
Source: "*.js"; DestDir: "{app}\%(PACKAGE_NAME)s\examples"; Flags: ignoreversion;
Source: "*.ico"; DestDir: "{app}\%(PACKAGE_NAME)s\examples"; Flags: ignoreversion;
[UninstallDelete]
Type: files; Name: "{app}\%(PACKAGE_NAME)s\*.pyc";
Type: files; Name: "{app}\%(PACKAGE_NAME)s\*.log";
Type: filesandordirs; Name: "{app}\%(PACKAGE_NAME)s\__pycache__"
Type: files; Name: "{app}\%(PACKAGE_NAME)s\examples\*.pyc";
Type: files; Name: "{app}\%(PACKAGE_NAME)s\examples\*.log";
Type: filesandordirs; Name: "{app}\%(PACKAGE_NAME)s\examples\__pycache__"
Type: files; Name: "{app}\%(PACKAGE_NAME)s\examples\wx\*.pyc";
Type: files; Name: "{app}\%(PACKAGE_NAME)s\examples\wx\*.log";
Type: filesandordirs; Name: "{app}\%(PACKAGE_NAME)s\examples\wx\__pycache__"
Type: files; Name: "{app}\%(PACKAGE_NAME)s\wx\*.pyc";
Type: files; Name: "{app}\%(PACKAGE_NAME)s\wx\*.log";
Type: filesandordirs; Name: "{app}\%(PACKAGE_NAME)s\wx\__pycache__"
[Code]
program Setup;
var
PythonDir : String;
InstallDir : String;
function InitializeSetup(): Boolean;
begin
if not RegQueryStringValue(%(HKEY_CURRENT_USER)s,
'Software\Python\PythonCore\%(PYTHON_VERSION)s\InstallPath',
'', PythonDir) then begin
if not RegQueryStringValue(%(HKEY_LOCAL_MACHINE)s,
'Software\Python\PythonCore\%(PYTHON_VERSION)s\InstallPath',
'', PythonDir) then begin
if not RegQueryStringValue(%(HKEY_CURRENT_USER)s,
'Software\Wow6432Node\Python\PythonCore\%(PYTHON_VERSION)s\InstallPath',
'', PythonDir) then begin
if not RegQueryStringValue(%(HKEY_LOCAL_MACHINE)s,
'Software\Wow6432Node\Python\PythonCore\%(PYTHON_VERSION)s\InstallPath',
'', PythonDir) then begin
MsgBox('No installation of Python %(PYTHON_VERSION)s '
+ 'found in registry.' + #13 + 'Be sure to enter '
+ 'a pathname that places Python on the '
+ 'PYTHONPATH',
mbConfirmation, MB_OK);
PythonDir := 'C:\Python';
end;
end;
end;
end;
InstallDir := PythonDir + '\Lib\site-packages';
Result := True;
end;
function GetInstallDir(Default: String): String;
begin
Result := InstallDir;
end;
function UninstallOld(FileName: String): Boolean;
var
ResultCode: Integer;
begin
Result := False;
if FileExists(FileName) then begin
Result := True;
Exec(FileName, '/SILENT', WizardDirValue(), SW_SHOWNORMAL,
ewWaitUntilTerminated, ResultCode);
end;
end;
function NextButtonClick(CurPage: Integer): Boolean;
begin
Result := True;
if CurPage <> wpSelectDir then Exit;
UninstallOld(WizardDirValue() + '\%(PACKAGE_NAME)s\unins001.exe')
UninstallOld(WizardDirValue() + '\%(PACKAGE_NAME)s\unins000.exe')
end;