-
Notifications
You must be signed in to change notification settings - Fork 22
/
appveyor.yml
310 lines (251 loc) · 8.9 KB
/
appveyor.yml
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
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
version: 1.0.{build}
environment:
AVRAW: https://raw.githubusercontent.com/appveyor/ci/master/scripts/
AVFILE: enable-desktop.ps1
pyFTP: https://www.python.org/ftp/python/
KVMASTER: 1.11.0
LATESTPY2: 2.7.13
LATESTPY34: 3.4.4
LATESTPY35: 3.5.3
LATESTPY36: 3.6.5
matrix:
- PY: 27
ARCH: 86
MASTER: 0
ADMIN: 0
DESIGNER: 0
SHORTCUTS: 0
- PY: 27
ARCH: 86
MASTER: 1
ADMIN: 0
DESIGNER: 0
SHORTCUTS: 0
- PY: 27
ARCH: 86
MASTER: 0
ADMIN: 0
DESIGNER: 1
SHORTCUTS: 0
- PY: 27
ARCH: 86
MASTER: 0
ADMIN: 0
DESIGNER: 0
SHORTCUTS: 1
- PY: 27
ARCH: 64
MASTER: 0
ADMIN: 0
DESIGNER: 0
SHORTCUTS: 0
- PY: 27
ARCH: 64
MASTER: 1
ADMIN: 0
DESIGNER: 0
SHORTCUTS: 0
- PY: 27
ARCH: 64
MASTER: 0
ADMIN: 0
DESIGNER: 1
SHORTCUTS: 0
- PY: 27
ARCH: 64
MASTER: 0
ADMIN: 0
DESIGNER: 0
SHORTCUTS: 1
- PY: 34
ARCH: 86
MASTER: 0
ADMIN: 0
- PY: 34
ARCH: 86
MASTER: 1
ADMIN: 0
- PY: 34
ARCH: 64
MASTER: 0
ADMIN: 0
- PY: 34
ARCH: 64
MASTER: 1
ADMIN: 0
- PY: 35
ARCH: 86
MASTER: 1
ADMIN: 0
- PY: 35
ARCH: 86
MASTER: 1
ADMIN: 1
- PY: 35
ARCH: 64
MASTER: 1
ADMIN: 0
- PY: 35
ARCH: 64
MASTER: 1
ADMIN: 1
- PY: 36
ARCH: 86
MASTER: 1
ADMIN: 0
- PY: 36
ARCH: 86
MASTER: 1
ADMIN: 1
- PY: 36
ARCH: 64
MASTER: 1
ADMIN: 0
- PY: 36
ARCH: 64
MASTER: 1
ADMIN: 1
install:
- ps: iex ((new-object net.webclient).DownloadString($env:AVRAW+$env:AVFILE))
build_script:
- cmd:
setlocal ENABLEDELAYEDEXPANSION
REM ***********************************************************************
REM Check vars for environment generation first, raise error if not def. *
REM ***********************************************************************
if not defined PY (echo Set env var "PY" to -> 27, 34, 35, 36, 37 & exit 1)
if not defined ARCH (echo Set env var "ARCH" to -> 86, 64 & exit 1)
echo Py %PY%, arch %ARCH%, master %MASTER% admin %ADMIN%
designer %DESIGNER%, shortcuts %SHORTCUTS%, cd %CD%
REM ***********************************************************************
REM Uninstall global Python pre-installed by Appveyor *
REM versions www.appveyor.com/docs/build-environment/#python *
REM ***********************************************************************
if "%ADMIN%"=="1" (
if "%PY%"=="35" (
if "%ARCH%"=="86" (
bitsadmin.exe /transfer "3586" ^
"%pyFTP%%LATESTPY35%/python-%LATESTPY35%.exe" ^
"%cd%\py%LATESTPY35%.exe" &
"%cd%\py%LATESTPY35%.exe" /uninstall /quiet
) else if "%ARCH%"=="64" (
bitsadmin.exe /transfer "3564" ^
"%pyFTP%%LATESTPY35%/python-%LATESTPY35%-amd64.exe" ^
"%cd%\py%LATESTPY35%-amd64.exe" &
"%cd%\py%LATESTPY35%-amd64.exe" /uninstall /quiet
)
) else if "%PY%"=="36" (
if "%ARCH%"=="86" (
bitsadmin.exe /transfer "3686" ^
"%pyFTP%%LATESTPY36%/python-%LATESTPY36%.exe" ^
"%cd%\py%LATESTPY36%.exe" &
"%cd%\py%LATESTPY36%.exe" /uninstall /quiet
) else if "%ARCH%"=="64" (
bitsadmin.exe /transfer "3664" ^
"%pyFTP%%LATESTPY36%/python-%LATESTPY36%-amd64.exe" ^
"%cd%\py%LATESTPY36%-amd64.exe" &
"%cd%\py%LATESTPY36%-amd64.exe" /uninstall /quiet
)
)
)
del "%cd%\py*.exe"
REM ***********************************************************************
REM Downgrade versions in kivy.bat manually for batupdate test later. *
REM *
REM Appveyor/Yaml file raises errors when a single colon (:) or two *
REM colons with a space are present in the file, thus EXIT as its env var *
REM %=ExitCodeAscii% converts the int to char. *
REM *
REM Batch knows no float math, therefore VBS (or PS) needs to be used, *
REM however, it may return a comma (,) instead of a period (.) in the *
REM result, thus convert'n'replace behavior is unfortunately necessary. *
REM ***********************************************************************
kivy version > _ver
set /p new_ver=<_ver && del _ver && set up_com=::Version
cmd /c exit 58 & call echo %=ExitCodeAscii% > _colon
set /p colon=<_colon & del _colon && set up_com=%up_com%%colon% %new_ver%
set up_ver=set installerversion=%new_ver%
echo Wscript.Echo Replace(CStr(FormatNumber(%new_ver%-0.1, 1)), ",", ".") > _calc.vbs
cscript //Nologo _calc.vbs > _calc
set /p old_ver=<_calc && del _calc && del _calc.vbs
for /F "delims=" %%l in (%cd%\kivy.bat) do (if "%%l"=="%up_com%" (
echo ::Version%colon% %old_ver%>> old.bat
) else if "%%l"=="%up_ver%" (
echo set installerversion=%old_ver%>> old.bat
) else (echo %%l>> old.bat))
del %cd%\kivy.bat && move %cd%\old.bat %cd%\kivy.bat
REM ***********************************************************************
REM Enable ECHO with DEBUG option. *
REM Set options from the env vars provided in matrix + default fallback. *
REM ***********************************************************************
set DEBUG=1&& set choice_python=3&&set ___=
if "%PY%"=="27" (
set choice_python=2&& set py2=%LATESTPY2%&& set cp2=cp27&&set ___=
) else if "%PY%"=="34" (
set py3=%LATESTPY34%&& set cp3=cp34&&set ___=
) else if "%PY%"=="35" (
set py3=%LATESTPY35%&& set cp3=cp35&&set ___=
) else if "%PY%"=="36" (
set py3=%LATESTPY36%&& set cp3=cp36&&set ___=
)
set choice_kivy=y&& set choice_master=n&&set ___=
if "%MASTER%"=="1" (
set choice_master=y&&set ___=
)
set choice_privileges=n&&set ___=
if "%ADMIN%"=="1" (
set choice_privileges=y&&set ___=
)
set choice_dsgn=n&&set ___=
if "%DESIGNER%"=="1" (
set choice_dsgn=y&&set ___=
)
set choice_shrt=n&&set ___=
if "%SHORTCUTS%"=="1" (
set choice_shrt=y&&set ___=
)
set master=%KVMASTER%&& set choice_ext=n&& set choice_gst=n&&set ___=
REM ***********************************************************************
REM ARCH option is the first asked option, therefore it needs a user *
REM interaction - handled by ECHOing through PIPE. The rest of "set /p" *
REM options are silenced by this step + variables are set before ECHO. *
REM *
REM The ECHO runs the kivy.bat script that doesn't need any form of user *
REM interaction + DEBUG in the env forbids running the Touchtracer. *
REM *
REM (echoPset /p ___="y")P form sets a value without a newline from ECHO *
REM ***********************************************************************
if "%ARCH%"=="86" (
(echo|set /p ___="y")|kivy.bat
) else if "%ARCH%"=="64" (
(echo|set /p ___="n")|kivy.bat
)
REM ***********************************************************************
REM Check if Python was (re)installed correctly from kivy.bat. *
REM ***********************************************************************
if not exist "%cd%\python.exe" (exit /B 1)
REM ***********************************************************************
REM Check kivy.bat launcher in Quick Launch and SendTo folders + print. *
REM ***********************************************************************
set QL=%appdata%\Microsoft\Internet Explorer\Quick Launch
set ST=%appdata%\Microsoft\Windows\SendTo
dir "%QL%"
if "%SHORTCUTS%"=="1" (
if not exist "%QL%\Kivy%PY%.bat" exit /B 1
)
dir "%ST%"
if "%SHORTCUTS%"=="1" (
if not exist "%ST%\Kivy%PY%.bat" exit /B 1
)
REM ***********************************************************************
REM Output the configuration for script (for manual check if neccessary). *
REM ***********************************************************************
echo Installer config
type %cd%\config.kivyinstaller
REM ***********************************************************************
REM Test script update command via script variable check. *
REM ***********************************************************************
kivy batupdate
kivy version > _ver && set /p new_ver=<_ver && del _ver
if not %new_ver% gtr %old_ver% ( exit 1 )
dir "%cd%"