-
Notifications
You must be signed in to change notification settings - Fork 235
/
build.bat
89 lines (71 loc) · 2.73 KB
/
build.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
@echo off
rem Unseting user variables
set "aut2exe=source\Aut2Exe\Aut2exe_x64.exe"
set "sevenzip=source\i_data\tools\7za.exe"
rem Setting up the different folders used for building. %~dp0 is the folder of the build script itself (may not be the same as the working directory).
set "input_folder=%~dp0"
set "build_folder=%input_folder%build"
rem Find path for aut2exe
rem If the user supplied a aut2exe path use it
IF DEFINED aut2exe (
echo Using user defind path to aut2exe
goto done_aut2exe
)
rem Try to find the aut2exe path.
set "PPATH=%ProgramFiles%\AutoIt3\Aut2Exe\aut2exe.exe"
IF exist "%PPATH%" (
set "aut2exe=%PPATH%"
goto done_aut2exe
)
set "PPATH=%ProgramFiles(x86)%\AutoIt3\Aut2Exe\aut2exe.exe"
IF exist "%PPATH%" (
set "aut2exe=%PPATH%"
goto done_aut2exe
)
:done_aut2exe
IF not exist "%aut2exe%" (
echo Can't locate AutoIt. Is it installed? Pleas set the aut2exe variable if it is installed in a nonstandard path.
EXIT /B
)
rem Find path for sevenzip
rem If the user supplied a sevenzip path use it
IF DEFINED sevenzip (
echo Using user defind path to sevenzip
goto done_sevenzip
)
rem Try to find the sevenzip path.
set "PPATH=%ProgramFiles%\7-Zip\7z.exe"
IF exist "%PPATH%" (
set "sevenzip=%PPATH%"
goto done_sevenzip
)
set "PPATH=%ProgramFiles(x86)%\7-Zip\7z.exe"
IF exist "%PPATH%" (
set "sevenzip=%PPATH%"
goto done_sevenzip
)
:done_sevenzip
IF not exist "%sevenzip%" (
echo Can't locate 7-Zip. Is it installed? Pleas set the sevenzip variable if it is installed in a nonstandard path.
EXIT /B
)
echo aut2exe path: %aut2exe%
echo sevenzip path: %sevenzip%
rem Create build and release folders if needed.
rem Make a copy of the file for easy compression later.
rem xcopy /d /c /e /i "%input_folder%source\i_data" "%build_folder%\data\"
Mkdir %build_folder% >nul 2>&1
rem Compile Portable-VirtualBox.
"%aut2exe%" /in "%input_folder%source\Portable-VirtualBox.au3" /out "%build_folder%\Portable-VirtualBox_x86-x64.exe" /icon "%input_folder%source\VirtualBox.ico" /x86
"%aut2exe%" /in "%input_folder%source\Portable-VirtualBox.au3" /out "%build_folder%\Portable-VirtualBox_x64.exe" /icon "%input_folder%source\VirtualBox.ico" /x64
echo ###############################################################################
for %%i in ("%build_folder%\Portable-VirtualBox_x64.exe") do (
echo Build new release as %build_folder%\Portable-VirtualBox_x64.exe
echo Size: %%~zi bytes
)
for %%i in ("%build_folder%\Portable-VirtualBox_x86-x64.exe") do (
echo Build new release as %build_folder%\Portable-VirtualBox_x86-x64.exe
echo Size: %%~zi bytes
)
echo ###############################################################################
pause