forked from opencor/opencor
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathpackage.bat
59 lines (39 loc) · 1.82 KB
/
package.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
@ECHO OFF
SETLOCAL ENABLEDELAYEDEXPANSION
SET AppDir=%~dp0
CALL !AppDir!clean
CALL !AppDir!make %*
SET ExitCode=!ERRORLEVEL!
IF !ExitCode! EQU 0 (
SET EvCertificate=!AppDir!EVCertificate.pfx
SET OrigDir=!CD!
CD !AppDir!build
IF EXIST !EvCertificate! (
TITLE Code signing OpenCOR...
set VSCMD_ARG_HOST_ARCH=x64
set VSCMD_ARG_TGT_ARCH=x64
IF EXIST "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\Common7\Tools\vsdevcmd\core\winsdk.bat" (
CALL "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\Common7\Tools\vsdevcmd\core\winsdk.bat"
) ELSE (
CALL "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\Common7\Tools\vsdevcmd\core\winsdk.bat"
)
"!WindowsSdkVerBinPath!\x64\signtool.exe" sign /tr http://timestamp.globalsign.com/tsa/r6advanced1 /fd SHA256 /td SHA256 /f !EvCertificate! !AppDir!build\OpenCOR.com
"!WindowsSdkVerBinPath!\x64\signtool.exe" sign /tr http://timestamp.globalsign.com/tsa/r6advanced1 /fd SHA256 /td SHA256 /f !EvCertificate! !AppDir!build\OpenCOR.exe
"!WindowsSdkVerBinPath!\x64\signtool.exe" sign /tr http://timestamp.globalsign.com/tsa/r6advanced1 /fd SHA256 /td SHA256 /f !EvCertificate! !AppDir!build\Python\bin\python.exe
SET ExitCode=!ERRORLEVEL!
) ELSE (
SET ExitCode=0
)
IF !ExitCode! EQU 0 (
TITLE Packaging OpenCOR...
cpack
SET ExitCode=!ERRORLEVEL!
)
IF !ExitCode! EQU 0 AND EXIST !EvCertificate! (
TITLE Code signing OpenCOR's installer...
"!WindowsSdkVerBinPath!\x64\signtool.exe" sign /tr http://timestamp.globalsign.com/tsa/r6advanced1 /fd SHA256 /td SHA256 /f !EvCertificate! !AppDir!build\OpenCOR-*.exe
SET ExitCode=!ERRORLEVEL!
)
CD !OrigDir!
)
EXIT /B !ExitCode!