-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathrelease.bat
108 lines (73 loc) · 2.51 KB
/
release.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
@echo off
ECHO.
ECHO This release script requires powershell to be runnable from cmd.
ECHO.
IF %1.==. GOTO VersionError
set version=%1
set installers86path=.\CDP4IMEInstaller\bin\Release\COMET-CE.x86.msi
set filename86=COMET-CE.x86_%version%.msi
set installers64path=.\CDP4IMEInstaller\bin\x64\Release\COMET-CE.x64.msi
set filename64=COMET-CE.x64_%version%.msi
set releasefolder=.\Release
GOTO Setup
:VersionError
ECHO.
ECHO ERROR: No version was specified
ECHO.
GOTO End
:Setup
ECHO Releasing IME Version %version%
:Begin
ECHO.
ECHO Creating release folders
ECHO.
if not exist %releasefolder% mkdir %releasefolder%
if exist %releasefolder%\%version% rmdir %releasefolder%\%version% /S /Q
if not exist %releasefolder%\%version% mkdir %releasefolder%\%version%
ECHO.
ECHO Building x86 Release Version
ECHO.
set platform=x86
call MSBuild.exe CDP4-CE.sln -target:Clean -p:Configuration=Release;Platform=x86
call MSBuild.exe .\CDP4PluginPackager\CDP4PluginPackager.csproj -p:Configuration=Release;Platform=x86
call MSBuild.exe CDP4-CE.sln -restore -p:Configuration=Release;Platform=x86
ECHO Error Level %errorlevel%
IF %errorlevel%==1 GOTO BuildError
ECHO.
ECHO Moving x86 installer
ECHO.
call powershell -Command "& {Copy-Item -Path %installers86path% -Destination %releasefolder%\%version%\%filename86%;}"
ECHO.
ECHO Release x86 %version% Completed
ECHO.
ECHO.
ECHO Building x64 Release Version
ECHO.
set platform=x64
call MSBuild.exe CDP4-CE.sln -target:Clean -p:Configuration=Release;Platform=x64
call MSBuild.exe .\CDP4PluginPackager\CDP4PluginPackager.csproj -p:Configuration=Release;Platform=x86
call MSBuild.exe CDP4-CE.sln -restore /property:Configuration=Release;Platform=x64
ECHO Error Level %errorlevel%
IF %errorlevel%==1 GOTO BuildError
ECHO.
ECHO Moving x64 installer
ECHO.
call powershell -Command "& {Copy-Item -Path %installers64path% -Destination %releasefolder%\%version%\%filename64%;}"
ECHO.
ECHO Release x64 %version% Completed
ECHO.
ECHO.
ECHO Generating Verification Hashes
ECHO.
call powershell -Command "& {Get-ChildItem -Path %releasefolder%\%version% -Recurse -Filter *.msi | Get-FileHash -Algorithm MD5 | Format-List | Out-File %releasefolder%\%version%\verification_hashes_%version%.txt}"
call powershell -Command "& {Get-ChildItem -Path %releasefolder%\%version% -Recurse -Filter *.msi | Get-FileHash | Format-List | Out-File %releasefolder%\%version%\verification_hashes_%version%.txt -Append}"
:End
ECHO.
ECHO Done
ECHO.
EXIT /B 0
:BuildError
ECHO.
ECHO Release %version% %platform% Failed
ECHO.
EXIT /B 1