-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbuild.bat
152 lines (126 loc) · 4.04 KB
/
build.bat
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
@ECHO OFF
REM These are path variables, if your system has things in a different place
REM This is some stupid crap to get DOS short paths for no spaces in the stuff
FOR %%A IN ("%WINDIR%\Microsoft.NET\Framework\v3.5") DO SET NETLOC=%%~sA
FOR %%A IN ("%PROGRAMFILES(X86)%\SigCheck") DO SET SIGCHECK=%%~sA
FOR %%A IN ("%PROGRAMFILES%\7-Zip") DO SET ZIP7=%%~sA
REM Check parameters, if those happen
SET HELPPARAMS=-H HELP /H /HELP
SET DEPLOYPARAMS=/D /DEPLOY -D DEPLOY
SET BUILDPARAMS=/B /BUILD -B BUILD
FOR %%A IN (%*) DO (
FOR %%H IN (%HELPPARAMS%) DO (
IF /I "%%A"=="%%H" (
ECHO This script is used to build FishingForm. Options:
ECHO %HELPPARAMS% -- Display this message and exit
ECHO %BUILDPARAMS% -- Skip deploy and just do building
ECHO %DEPLOYPARAMS% -- Skip building and just make deploy files
PAUSE
EXIT /B
)
)
FOR %%D IN (%DEPLOYPARAMS%) DO (
IF /I "%%A"=="%%D" (
SET DEPLOY=1
)
)
FOR %%B IN (%BUILDPARAMS%) DO (
IF /I "%%A"=="%%B" (
SET BUILD=1
)
)
)
ECHO Checking Required Programs
SET MISSING=
IF NOT DEFINED DEPLOY (
IF NOT EXIST "%NETLOC%\MSBuild.exe" (
SET MISSING=1
ECHO %NETLOC%\MSBuild.exe not found. Please ensure proper build files exist or run %~f0 deploy
)
)
IF NOT DEFINED BUILD (
IF NOT EXIST "%SIGCHECK%\sigcheck.exe" (
SET MISSING=1
ECHO %SIGCHECK%\sigcheck.exe not found. Please download from microsoft site--google it--and adjust paths.
)
IF NOT EXIST "%ZIP7%\7z.exe" (
SET MISSING=1
ECHO %ZIP7%\7z.exe not found. Please ensure it or another zip creation program is installed and adjust paths.
)
)
IF DEFINED MISSING (
ECHO.
ECHO Required files were not found. Exiting.
PAUSE
EXIT /B
)
IF NOT DEFINED DEPLOY (
ECHO Building Project
%NETLOC%\MSBuild.exe /property:Configuration=Release;Platform=x86 FishingForm.csproj
%NETLOC%\MSBuild.exe /property:Configuration=Debug;Platform=x86 FishingForm.csproj
ECHO.
ECHO Build Complete
ECHO.
PAUSE
)
IF DEFINED BUILD (
EXIT /B
)
ECHO.
ECHO Creating Deployable Archives
ECHO.
FOR /F "tokens=1-3" %%i IN ('%SIGCHECK%\sigcheck.exe bin\x86\Release\Fishing.exe') DO (IF "%%i %%j"=="File version:" SET filever=%%k)
MKDIR deploy\source\Properties
MKDIR deploy\source\images
MKDIR deploy\source\Fishing
MKDIR deploy\source\FFACETools
MKDIR deploy\FishDB
COPY Properties\* deploy\source\Properties\
COPY images\* deploy\source\images\
COPY Fishing\* deploy\source\Fishing\
COPY FFACETools\* deploy\source\FFACETools\
COPY *.cs deploy\source
COPY *.resx deploy\source
COPY *.suo deploy\source
COPY *.user deploy\source
COPY *.sln deploy\source
COPY *.csproj deploy\source
COPY *.dll
COPY *.cd deploy\source
COPY *.bat deploy\source
COPY *.log deploy\source
COPY *.config deploy\source
COPY *.mwb deploy\source
COPY bin\x86\Release\*.exe deploy
COPY bin\x86\Release\*.dll deploy
COPY bin\x86\Release\FishDB\* deploy\FishDB
COPY bin\x86\Release\*.wav deploy
DEL FishingForm_mC-FD_(with_source).zip
DEL FishingForm_v%filever%_mC-FD_(with_source).zip
DEL FishingForm_mC-FD.zip
DEL FishingForm_v%filever%_mC-FD.zip
DEL FishingForm_mC-FD_DEBUG.zip
DEL FishingForm_v%filever%_mC-FD_DEBUG.zip
CD deploy
"%ZIP7%\7z" a ..\FishingForm_mC-FD_(with_source).zip -mx9 -tzip *
COPY ..\FishingForm_mC-FD_(with_source).zip ..\FishingForm_v%filever%_mC-FD_(with_source).zip
"%ZIP7%\7z" a ..\FishingForm_mC-FD.zip -mx9 -tzip -x!source\ *
COPY ..\FishingForm_mC-FD.zip ..\FishingForm_v%filever%_mC-FD.zip
MKDIR Debug
COPY ..\bin\x86\Debug\*.exe Debug
COPY ..\bin\x86\Debug\*.pdb Debug
CD Debug
"%ZIP7%\7z" a ..\..\FishingForm_mC-FD_DEBUG.zip -mx9 -tzip *
COPY ..\..\FishingForm_mC-FD_DEBUG.zip ..\..\FishingForm_v%filever%_mC-FD_DEBUG.zip
CD ..\..\
ECHO.
ECHO Deployable Archives Created:
ECHO FishingForm_mC-FD_(with_source).zip
ECHO FishingForm_v%filever%_mC-FD_(with_source).zip
ECHO FishingForm_mC-FD.zip
ECHO FishingForm_v%filever%_mC-FD.zip
ECHO FishingForm_mC-FD_DEBUG.zip
ECHO FishingForm_v%filever%_mC-FD_DEBUG.zip
ECHO.
PAUSE
RD /Q /S deploy