@@ -23,10 +23,13 @@ Const RELEASE_SUFFIX:=""
23
23
Const TARGET:= "???"
24
24
#endif
25
25
26
- Const OUTPUT:="wonkey_"+TARGET+"_"+WONKEY_VERSION+RELEASE_SUFFIX
26
+ Global TARGET_SUFFIX:=""
27
+
28
+ Global OUTPUT:="" '--> "wonkey_"+TARGET+TARGET_SUFFIX+"_"+WONKEY_VERSION+RELEASE_SUFFIX
27
29
28
30
Const IGNORE:="
29
31
.gitignore
32
+ .gitattributes
30
33
src/createrelease
31
34
bin/windows/wide.state.json
32
35
bin/windows/wide/wide.state.json
@@ -38,6 +41,7 @@ bin/raspbian/wide.state.json
38
41
bin/raspbian/wide/wide.state.json
39
42
"
40
43
44
+ Global msvc:=False
41
45
Global desktop:String
42
46
Global output:String
43
47
@@ -116,7 +120,13 @@ Function CopyFiles( dir:String )
116
120
If file.StartsWith( "emscripten_" ) Continue
117
121
If file.StartsWith( "android_" ) Continue
118
122
If file.StartsWith( "ios_" ) Continue
119
- 'If file.Contains( "_msvc" ) Continue
123
+ #if __TARGET__="windows"
124
+ If msvc
125
+ If Not file.Contains( "_msvc" ) Continue
126
+ Else
127
+ If file.Contains( "_msvc" ) Continue
128
+ End
129
+ #end
120
130
'If file.Contains( "_x64" ) Continue
121
131
If file="build" Continue
122
132
If file="src" Continue
@@ -155,6 +165,10 @@ Function CopyFiles( dir:String )
155
165
If file.EndsWith("_fast.sh") Continue
156
166
If file.EndsWith("_fastest.sh") Continue
157
167
If file.EndsWith("_slow.sh") Continue
168
+
169
+ #if __TARGET__<>"raspbian"
170
+ If file.EndsWith("_raspbian.bat") Continue
171
+ #end
158
172
159
173
#if __TARGET__="windows"
160
174
If file.EndsWith(".sh") Continue
@@ -216,7 +230,7 @@ Function MakeInno()
216
230
217
231
Local iss:=New StringStack
218
232
iss.Push( "[Setup]" )
219
- iss.Push( "OutputDir=" +desktop )
233
+ iss.Push( "OutputDir=.") ' +desktop )
220
234
iss.Push( "OutputBaseFilename="+OUTPUT )
221
235
iss.Push( "AppName="+OUTPUT )
222
236
iss.Push( "AppVerName="+OUTPUT )
@@ -227,7 +241,7 @@ Function MakeInno()
227
241
iss.Push( "Name: ~q{group}\"+OUTPUT+"~q; Filename: ~q{app}\Wonkey (windows).exe~q; WorkingDir: ~q{app}~q" )
228
242
iss.Push( "Name: ~q{group}\Uninstall "+OUTPUT+"~q; Filename: ~q{uninstallexe}~q" )
229
243
iss.Push( "[FILES]" )
230
- iss.Push( "Source: ~q"+output +"\*~q; DestDir: {app}; Flags: ignoreversion recursesubdirs" )
244
+ iss.Push( "Source: ~q"+OUTPUT +"\*~q; DestDir: {app}; Flags: ignoreversion recursesubdirs" )
231
245
iss.Push( "[RUN]" )
232
246
iss.Push( "Filename: ~q{app}\Wonkey (windows).exe~q; Description: ~qLaunch "+OUTPUT+"~q; Flags: postinstall nowait skipifsilent" )
233
247
@@ -262,6 +276,23 @@ Function Main()
262
276
Endif
263
277
ChangeDir( ExtractDir( CurrentDir() ) )
264
278
Wend
279
+
280
+ 'if windows msvc
281
+ If TARGET = "windows"
282
+ Local usemsvc:= GetEnv( "WX_USE_MSVC" )
283
+
284
+ If usemsvc=""
285
+ usemsvc = FindMSVC() ? "1" Else "0"
286
+ End
287
+
288
+ If int(usemsvc)
289
+ TARGET_SUFFIX = "-msvc"
290
+ msvc=True
291
+ End
292
+ End
293
+
294
+ ' set output name
295
+ OUTPUT = "wonkey_"+TARGET+TARGET_SUFFIX+"_"+WONKEY_VERSION+RELEASE_SUFFIX
265
296
266
297
'#if __TARGET__="windows"
267
298
' desktop=(String.FromCString( getenv( "HOMEDRIVE" ) )+String.FromCString( getenv( "HOMEPATH" ) )+"\Desktop").Replace( "\","/" )+"/"
@@ -281,13 +312,12 @@ Function Main()
281
312
Local outdir:= "releases/unknown/"
282
313
#endif
283
314
284
-
285
-
286
- DeleteDir(outdir,True )
287
- CreateDir(outdir)
288
-
315
+ desktop = outdir
289
316
output=outdir+OUTPUT
290
317
318
+ DeleteDir(output,True )
319
+ CreateDir(output)
320
+
291
321
CopyRelease()
292
322
293
323
#if __TARGET__="windows"
@@ -304,6 +334,78 @@ Function Main()
304
334
305
335
#endif
306
336
307
- Print "~nFinished!!!!! "
337
+ Print "~nFinished!"
308
338
309
339
End
340
+
341
+ '--------------
342
+
343
+ #If __TARGET__="windows"
344
+
345
+ Function FindMSVC:bool()
346
+
347
+ Local msvcs:=""
348
+ Local msvcs_versions:=GetEnv("WX_MSVC_VERSIONS")
349
+ For Local ver:=Eachin msvcs_versions.Split(",")
350
+ msvcs=GetEnv( "ProgramFiles(x86)" )+"\Microsoft Visual Studio\" + ver.Trim()
351
+ If GetFileType( msvcs )=FileType.Directory Exit
352
+ Next
353
+ If GetFileType( msvcs )<>FileType.Directory Return False
354
+
355
+ Local wkits:=GetEnv( "ProgramFiles(x86)" )+"\Windows Kits\10"
356
+ If GetFileType( wkits )<>FileType.Directory Return False
357
+
358
+ Local toolsDir:="",maxver:=0
359
+
360
+ For Local f:=Eachin LoadDir( msvcs )
361
+
362
+ Local dir:=msvcs+"\"+f+"\VC\Tools\MSVC"
363
+ If GetFileType( dir )<>FileType.Directory Continue
364
+
365
+ For Local f:=Eachin LoadDir( dir )
366
+ Local verDir:=dir+"\"+f
367
+ If GetFileType( verDir )<>FileType.Directory Continue
368
+ Local ver:=Int( f.Replace( ".","" ) )
369
+ If ver>maxver
370
+ toolsDir=verDir
371
+ maxver=ver
372
+ Endif
373
+ Next
374
+ Next
375
+
376
+ Local incsDir:=FindMaxVerDir( wkits+"\Include" )
377
+ If Not incsDir Return False
378
+
379
+ Local libsDir:=FindMaxVerDir( wkits+"\Lib" )
380
+ If Not libsDir Return False
381
+
382
+ Return True
383
+ End
384
+
385
+ Function FindMaxVerDir:String( dir:String )
386
+
387
+ Local maxver:Long=0,maxverDir:=""
388
+
389
+ For Local f:=Eachin LoadDir( dir )
390
+
391
+ Local verDir:=dir+"\"+f
392
+ If GetFileType( verDir )<>FileType.Directory Continue
393
+
394
+ Local ver:Long=Int( f.Replace( ".","" ) )
395
+
396
+ If ver>maxver
397
+ maxver=ver
398
+ maxverDir=verDir
399
+ Endif
400
+ Next
401
+
402
+ Return maxverDir
403
+ End
404
+
405
+ #Else
406
+
407
+ Function FindMSVC:Bool()
408
+ Return False
409
+ End
410
+
411
+ #endif
0 commit comments