forked from linuxgurugamer/AutomatedScreenshots
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuildRelease.bat
More file actions
92 lines (75 loc) · 2.63 KB
/
buildRelease.bat
File metadata and controls
92 lines (75 loc) · 2.63 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
@echo off
set DEFHOMEDRIVE=d:
set DEFHOMEDIR=%DEFHOMEDRIVE%%HOMEPATH%
set HOMEDIR=
set HOMEDRIVE=%CD:~0,2%
set RELEASEDIR=d:\Users\jbb\release
set ZIP="c:\Program Files\7-zip\7z.exe"
echo Default homedir: %DEFHOMEDIR%
rem set /p HOMEDIR= "Enter Home directory, or <CR> for default: "
if "%HOMEDIR%" == "" (
set HOMEDIR=%DEFHOMEDIR%
)
echo %HOMEDIR%
SET _test=%HOMEDIR:~1,1%
if "%_test%" == ":" (
set HOMEDRIVE=%HOMEDIR:~0,2%
)
set VERSIONFILE=automatedscreenshots.version
copy automatedscreenshots.version a.version
set VERSIONFILE=a.version
rem The following requires the JQ program, available here: https://stedolan.github.io/jq/download/
c:\local\jq-win64 ".VERSION.MAJOR" %VERSIONFILE% >tmpfile
set /P major=<tmpfile
c:\local\jq-win64 ".VERSION.MINOR" %VERSIONFILE% >tmpfile
set /P minor=<tmpfile
c:\local\jq-win64 ".VERSION.PATCH" %VERSIONFILE% >tmpfile
set /P patch=<tmpfile
c:\local\jq-win64 ".VERSION.BUILD" %VERSIONFILE% >tmpfile
set /P build=<tmpfile
del tmpfile
set VERSION=%major%.%minor%.%patch%
if "%build%" NEQ "0" set VERSION=%VERSION%.%build%
type automatedscreenshots.version
echo Version: %VERSION%
del a.version
set /p newVERSION= "Enter version: "
if "%newVERSION" NEQ "" set VERSION=%newVERSION%
set d=%HOMEDIR\install
if exist %d% goto one
mkdir %d%
:one
set d=%HOMEDIR%\install\Gamedata
if exist %d% goto two
mkdir %d%
:two
set d=%HOMEDIR%\install\Gamedata\AutomatedScreenShots
if exist %d% goto three
mkdir %d%
:three
set d=%HOMEDIR%\install\Gamedata\AutomatedScreenShots\Plugins
if exist %d% goto four
mkdir %d%
:four
set d=%HOMEDIR%\install\Gamedata\AutomatedScreenShots\Textures
if exist %d% goto five
mkdir %d%
:five
del %HOMEDIR%\install\Gamedata\AutomatedScreenShots\Textures\*.*
set d=%HOMEDIR%\install\Gamedata\AutomatedScreenShots\PluginData
if exist %d% goto six
mkdir %d%
:six
rem xcopy src\Textures\AS*.* %HOMEDIR%\install\Gamedata\AutomatedScreenShots\Textures /y
xcopy src\Textures\Auto*.png %HOMEDIR%\install\GameData\AutomatedScreenShots\Textures /Y
copy bin\Release\AutomatedScreenshots.dll %HOMEDIR%\install\Gamedata\AutomatedScreenShots\Plugins
copy automatedscreenshots.version %HOMEDIR%\install\Gamedata\AutomatedScreenShots
copy README.md %HOMEDIR%\install\Gamedata\AutomatedScreenshots
copy ChangeLog.txt %HOMEDIR%\install\Gamedata\AutomatedScreenshots
pause
%HOMEDRIVE%
cd %HOMEDIR%\install
set FILE="%RELEASEDIR%\AutomatedScreenshots-%VERSION%.zip"
IF EXIST %FILE% del /F %FILE%
%ZIP% a -tzip %FILE% Gamedata\AutomatedScreenshots
rem %ZIP% a -tzip %RELEASEDIR%\AutomatedScreenshots-%VERSION%.zip Gamedata\AutomatedScreenshots