-
Notifications
You must be signed in to change notification settings - Fork 19
/
Copy pathBuildMSI.cmd
49 lines (39 loc) · 949 Bytes
/
BuildMSI.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
@echo off
setlocal EnableDelayedExpansion
:handle_help_request
if /i "%~1" == "-?" call :usage & exit /b 0
if /i "%~1" == "--help" call :usage & exit /b 0
:check_args
if /i "%~1" == "" call :usage & exit /b 1
if /i "%~1" == "--clean" call :clean & exit /b 0
where candle 2>nul
if !errorlevel! neq 0 (
echo ERROR: candle not found on the PATH, adjust it to include WiX, e.g
echo set PATH=%%PATH%%;C:\Program Files ^(x86^)\WiX Toolset v3.xx\bin
exit /b 1
)
set root=%~dp1
set source=%~nx1
set candleOutput=%~n1.wixobj
:build
pushd "%root%"
if !errorlevel! neq 0 exit /b !errorlevel!
candle %source%
if !errorlevel! neq 0 exit /b !errorlevel!
light %candleOutput%
if !errorlevel! neq 0 exit /b !errorlevel!
popd
exit /b 0
:usage
echo.
echo Usage: %~n0 ^<filename.wxs^>
echo.
goto :eof
:clean
rd /s /q Debug 2> nul
rd /s /q Release 2> nul
del *.wixobj 2> nul
del *.wixpdb 2> nul
del *.msi 2> nul
del /ah *.suo 2> nul
goto :eof