-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcreate-pack.cmd
57 lines (43 loc) · 1.43 KB
/
create-pack.cmd
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
rem
rem This script packs together a Keizer_...zip package.
rem It uses the executables from the bin\x86\Release-directory.
rem It takes the version number from KFC2.csproj.
rem To work, this script needs robocopy, tclsh.exe and 7za.exe in PATH.
@echo off
set "startdir=%cd%"
set projfile=KFC2.csproj
rem The following seems to be the way to go to put the result of a command into
rem a variable in cmd-scripts. It is truly astonishing.
for /f usebackq %%i in (`tclsh extract-vers.tcl %projfile%`) do (
set vers=%%i
)
echo Version parsed from %projfile% is %vers%
set temp0=C:\tmp\kfc-pack\
set packname=Keizer_%vers%
set tempdir=%temp0%%packname%
md %tempdir%
del /Q %tempdir%\*.*
del /Q %tempdir%\..\*.zip
del /Q %tempdir%\cfg
del /Q %tempdir%\docs
del /Q %tempdir%\export
cd bin\x86\Release\net6.0-windows
copy KFC2.exe %tempdir%\KeizerForClubs.exe
copy ..\..\..\..\cfg\* cfg
robocopy ..\..\..\..\docs\ docs *.html *.png *.pdf *.txt /E
rem This is only for debugging T82.
@echo on
rem copy ..\..\..\..\System.Data.SQLite.w32.dll .
rem copy ..\..\..\..\System.Data.SQLite.x64.dll .
@echo off
robocopy . %tempdir% *.dll *.json *.s3db Keizer*.html *.ini *.png *.pdf *.txt *.css *.xsl /E
cd %tempdir%\..
7za a -tzip kfc %packname%
rename kfc.zip %packname%.zip
rd /S /Q %tempdir%\cfg
rd /S /Q %tempdir%\docs
rd /S /Q %tempdir%\export
del /Q %tempdir%\*.*
rd %tempdir%
echo %packname%.zip created in %temp0%
cd "%startdir%"