-
Notifications
You must be signed in to change notification settings - Fork 48
/
build_ualds_win64.bat
58 lines (45 loc) · 1.75 KB
/
build_ualds_win64.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
@ECHO off
REM ****************************************************************************************************************
REM ** This script builds the UA-LDS.
REM ** This must be run from a Visual Studio command line.
REM ****************************************************************************************************************
SETLOCAL
set SRCDIR=%~dp0
set INSTALLDIR=%~dp0
set SIGNTOOL=C:\Build\sign_output.bat
set ZIP="C:\Program Files\7-zip\7z.exe"
set VS_CONFIG=RelWithDebInfo
set LDSFN=OPC UA Local Discovery Server
set GIT=C:\Program Files\Git\bin\git.exe
IF NOT EXIST "%GIT%" SET GIT=C:\Program Files (x86)\Git\bin\git.exe
ECHO STEP 1) Deleting Output Directories
REM IF EXIST %INSTALLDIR%\bin rmdir /s /q %INSTALLDIR%\bin
IF "%1"=="no-stack" GOTO noStack
ECHO STEP 2) Fetch OpenSSL
REM IF EXIST %INSTALLDIR%\stack\openssl rmdir /s /q %INSTALLDIR%\stack\openssl
CALL fetch_openssl_win64.bat
ECHO STEP 3) Building Stack
cd %SRCDIR%\stack
CALL build_win64.bat
:noStack
ECHO STEP 4) Update Build Number
cd %SRCDIR%
IF NOT DEFINED BUILD_VERSION SET BUILD_VERSION=413
IF NOT DEFINED BUILD_NUMBER SET BUILD_NUMBER=1
ECHO Building Version: %BUILD_VERSION%.%BUILD_NUMBER%
perl -pi.bak -e "s/XXX/%BUILD_VERSION%/;" .\config.h
perl -pi.bak -e "s/YYY/%BUILD_NUMBER%/;" .\config.h
del /Q *.bak
ECHO STEP 5) Building LDS
cd %SRCDIR%
CALL build_win64.bat
ECHO STEP 6) Sign the Binaries
IF EXIST "%SIGNTOOL%" CALL "%SIGNTOOL%" %INSTALLDIR%\build\bin\%VS_CONFIG%\*.dll /dual
IF EXIST "%SIGNTOOL%" CALL "%SIGNTOOL%" %INSTALLDIR%\build\bin\%VS_CONFIG%\*.exe /dual
ECHO STEP 7) ZIP the Binaries
%ZIP% a "%LDSFN%.zip" "%INSTALLDIR%\build\bin\%VS_CONFIG%\*.exe"
%ZIP% a "%LDSFN%.zip" "%INSTALLDIR%\build\bin\%VS_CONFIG%\*.dll"
ECHO *** ALL DONE ***
GOTO theEnd
:theEnd
ENDLOCAL