-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathGenerateRelease.cmd
85 lines (61 loc) · 1.69 KB
/
GenerateRelease.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
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
@echo off
set "RELEASEDIR=%tmp%\PEDollRelease"
:main
pushd %~dp0
msbuild -ver >nul 2>nul
if %ERRORLEVEL% neq 0 (
echo Run this batch file from a Developer Command Prompt!
goto :eof
)
if exist "%RELEASEDIR%" (
rd /s /q "%RELEASEDIR%"
)
md %RELEASEDIR%
::call :buildAll Debug
call :buildAll Release
start explorer %RELEASEDIR%
popd
goto :eof
:: call :buildAll Debug
:buildAll
call :buildController %1 ^
&& call :buildMonitor x86 %1 ^
&& call :buildMonitor x64 %1
goto :eof
:: call :buildController Debug
:buildController
set PLATFORMDIR=PEDollController\bin
msbuild PEDoll.sln -t:PEDollController -p:Platform="Any CPU";Configuration=%1
if %ERRORLEVEL% neq 0 (
goto :eof
)
if not exist "%RELEASEDIR%\%1" (
md "%RELEASEDIR%\%1"
)
xcopy /e %PLATFORMDIR%\%1 "%RELEASEDIR%\%1\"
xcopy /e /i Scripts "%RELEASEDIR%\%1\Scripts"
:: Generate x64 API script (Scripts\API\*64.txt) from x86 scripts
pushd "%RELEASEDIR%\%1\Scripts\API"
powershell -Command "ls *.txt | foreach { (cat $_.FullName -Raw) -Replace ' --stack=\d+','' > ($_.BaseName + '64.txt') }"
popd
goto :eof
:: call :buildMonitor x64 Debug
:buildMonitor
if %1 equ x86 (
set PLATFORMDIR=.
) else (
set PLATFORMDIR=x64
)
msbuild PEDoll.sln -t:PEDollMonitor,libDoll -p:Platform=%1;Configuration=%2
if %ERRORLEVEL% neq 0 (
goto :eof
)
if not exist "%RELEASEDIR%\%2" (
md "%RELEASEDIR%\%2"
)
md "%RELEASEDIR%\%2\Monitor_%1"
copy %PLATFORMDIR%\%2\PEDollMonitor.exe "%RELEASEDIR%\%2\Monitor_%1\"
copy %PLATFORMDIR%\%2\PEDollMonitor.pdb "%RELEASEDIR%\%2\Monitor_%1\"
copy %PLATFORMDIR%\%2\libDoll.dll "%RELEASEDIR%\%2\Monitor_%1\"
copy %PLATFORMDIR%\%2\libDoll.pdb "%RELEASEDIR%\%2\Monitor_%1\"
goto :eof