VirtualBox

source: vbox/trunk/src/VBox/Installer/win/Scripts/Combined-3-RepackAdditions.cmd@ 82866

Last change on this file since 82866 was 82542, checked in by vboxsync, 5 years ago

GARepack: 64bit DIFx dll for 64bit installer

  • Property svn:eol-style set to CRLF
  • Property svn:keywords set to Author Date Id Revision
File size: 15.9 KB
Line 
1@echo off
2rem $Id: Combined-3-RepackAdditions.cmd 82542 2019-12-10 16:24:04Z vboxsync $
3rem rem @file
4rem Windows NT batch script for repacking signed amd64 and x86 drivers.
5rem
6
7rem
8rem Copyright (C) 2018-2019 Oracle Corporation
9rem
10rem This file is part of VirtualBox Open Source Edition (OSE), as
11rem available from http://www.virtualbox.org. This file is free software;
12rem you can redistribute it and/or modify it under the terms of the GNU
13rem General Public License (GPL) as published by the Free Software
14rem Foundation, in version 2 as it comes in the "COPYING" file of the
15rem VirtualBox OSE distribution. VirtualBox OSE is distributed in the
16rem hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
17rem
18
19
20setlocal ENABLEEXTENSIONS
21setlocal
22
23rem
24rem Globals and checks for required enviornment variables.
25rem
26if ".%KBUILD_DEVTOOLS%" == "." (echo KBUILD_DEVTOOLS is not set & goto end_failed)
27if ".%KBUILD_BIN_PATH%" == "." (echo KBUILD_BIN_PATH is not set & goto end_failed)
28set _MY_SCRIPT_DIR=%~dp0
29set _MY_SAVED_CD=%CD%
30set _MY_VER_REV=@VBOX_VERSION_STRING@r@VBOX_SVN_REV@
31
32rem
33rem Parse arguments.
34rem
35set _MY_OPT_UNTAR_DIR=%_MY_SCRIPT_DIR%\..\..\..\
36for %%i in (%_MY_OPT_UNTAR_DIR%) do set _MY_OPT_UNTAR_DIR=%%~fi
37set _MY_OPT_BUILD_TYPE=@KBUILD_TYPE@
38set _MY_OPT_OUTDIR=%_MY_OPT_UNTAR_DIR%\output
39set _MY_OPT_SRC_DIR=%_MY_SCRIPT_DIR%\resources\
40
41:argument_loop
42if ".%1" == "." goto no_more_arguments
43
44if ".%1" == ".-h" goto opt_h
45if ".%1" == ".-?" goto opt_h
46if ".%1" == "./h" goto opt_h
47if ".%1" == "./H" goto opt_h
48if ".%1" == "./?" goto opt_h
49if ".%1" == ".-help" goto opt_h
50if ".%1" == ".--help" goto opt_h
51
52if ".%1" == ".-o" goto opt_o
53if ".%1" == ".--outdir" goto opt_o
54if ".%1" == ".-s" goto opt_s
55if ".%1" == ".--source" goto opt_s
56if ".%1" == ".--signed-amd64" goto opt_signed_amd64
57if ".%1" == ".--signed-x86" goto opt_signed_x86
58if ".%1" == ".-t" goto opt_t
59if ".%1" == ".--build-type" goto opt_t
60if ".%1" == ".-u" goto opt_u
61if ".%1" == ".--vboxall-untar-dir" goto opt_u
62echo syntax error: Unknown option: %1
63echo Try --help to list valid options.
64goto end_failed
65
66:argument_loop_next_with_value
67shift
68shift
69goto argument_loop
70
71:opt_h
72echo Toplevel combined package: Repack the guest additions.
73echo .
74echo Usage: Combined-3-RepackAdditions.cmd [-o output-dir]
75echo [-u/--vboxall-dir unpacked-vboxall-dir] [-t build-type]
76echo [--signed-amd64 signed-amd64.zip]
77echo [--signed-x86 signed-x86.zip]
78echo
79echo .
80echo Default -u/--vboxall-untar-dir value: %_MY_OPT_UNTAR_DIR%
81echo Default -o/--outdir value: %_MY_OPT_OUTDIR%
82echo Default -t/--build-type value: %_MY_OPT_BUILD_TYPE%
83echo .
84goto end_failed
85
86:opt_o
87if ".%~2" == "." goto syntax_error_missing_value
88set _MY_OPT_OUTDIR=%~f2
89goto argument_loop_next_with_value
90
91:opt_s
92if ".%~2" == "." goto syntax_error_missing_value
93set _MY_OPT_SRC_DIR=%~f2
94goto argument_loop_next_with_value
95
96:opt_signed_amd64
97if ".%~2" == "." goto syntax_error_missing_value
98set _MY_OPT_SIGNED_AMD64=%~f2
99goto argument_loop_next_with_value
100
101:opt_signed_x86
102if ".%~2" == "." goto syntax_error_missing_value
103set _MY_OPT_SIGNED_X86=%~f2
104goto argument_loop_next_with_value
105
106:opt_t
107if ".%~2" == "." goto syntax_error_missing_value
108set _MY_OPT_BUILD_TYPE=%~2
109goto argument_loop_next_with_value
110
111:opt_u
112if ".%~2" == "." goto syntax_error_missing_value
113set _MY_OPT_UNTAR_DIR=%~f2
114goto argument_loop_next_with_value
115
116:syntax_error_missing_value
117echo syntax error: missing or empty option value after %1
118goto end_failed
119
120:error_vboxall_untar_dir_not_found
121echo syntax error: The VBoxAll untar directory was not found: "%_MY_OPT_UNTAR_DIR%"
122goto end_failed
123
124:error_amd64_bindir_not_found
125echo syntax error: The AMD64 bin directory was not found: "%_MY_BINDIR_AMD64%"
126goto end_failed
127
128:error_x86_bindir_not_found
129echo syntax error: The X86 bin directory was not found: "%_MY_BINDIR_X86%"
130goto end_failed
131
132:error_amd64_repack_dir_not_found
133echo syntax error: The AMD64 repack directory was not found: "%_MY_REPACK_DIR_AMD64%"
134goto end_failed
135
136:error_x86_repack_dir_not_found
137echo syntax error: The X86 repack directory was not found: "%_MY_REPACK_DIR_X86%"
138goto end_failed
139
140:error_extpack_not_found
141echo syntax error: Specified extension pack not found: "%_MY_OPT_EXTPACK%"
142goto end_failed
143
144:error_enterprise_extpack_not_found
145echo syntax error: Specified enterprise extension pack not found: "%_MY_OPT_EXTPACK_ENTERPRISE%"
146goto end_failed
147
148:error_signed_amd64_not_found
149echo syntax error: Zip with signed AMD64 drivers not found: "%_MY_OPT_SIGNED_AMD64%"
150goto end_failed
151
152:error_signed_x86_not_found
153echo syntax error: Zip with signed X86 drivers not found: "%_MY_OPT_SIGNED_X86%"
154goto end_failed
155
156:error_src_dir_not_found
157echo syntax error: src directory not found: "%_MY_OPT_SRC_DIR%"
158goto end_failed
159
160
161:no_more_arguments
162rem
163rem Validate and adjust specified options.
164rem
165
166if not exist "%_MY_OPT_UNTAR_DIR%" goto error_vboxall_untar_dir_not_found
167
168set _MY_BINDIR_AMD64=%_MY_OPT_UNTAR_DIR%\win.amd64\%_MY_OPT_BUILD_TYPE%\bin\additions
169set _MY_BINDIR_X86=%_MY_OPT_UNTAR_DIR%\win.x86\%_MY_OPT_BUILD_TYPE%\bin\additions
170if not exist "%_MY_BINDIR_AMD64%" goto error_amd64_bindir_not_found
171if not exist "%_MY_BINDIR_X86%" goto error_x86_bindir_not_found
172
173set _MY_REPACK_DIR_AMD64=%_MY_OPT_UNTAR_DIR%\win.amd64\%_MY_OPT_BUILD_TYPE%\repack
174set _MY_REPACK_DIR_X86=%_MY_OPT_UNTAR_DIR%\win.x86\%_MY_OPT_BUILD_TYPE%\repack
175if not exist "%_MY_REPACK_DIR_AMD64%" goto error_amd64_repack_dir_not_found
176if not exist "%_MY_REPACK_DIR_X86%" goto error_x86_repack_dir_not_found
177
178if not exist "%_MY_OPT_SIGNED_AMD64%" goto error_signed_amd64_not_found
179if not exist "%_MY_OPT_SIGNED_X86%" goto error_signed_x86_not_found
180
181rem Make sure the output dir exists.
182if not exist "%_MY_OPT_OUTDIR%" (mkdir "%_MY_OPT_OUTDIR%" || goto end_failed)
183
184if not exist "%_MY_OPT_SRC_DIR%" goto error_src_dir_not_found
185
186rem
187rem Unpacking the two driver zips.
188rem
189echo **************************************************************************
190echo * AMD64: Unpacking signed drivers...
191echo **************************************************************************
192cd /d "%_MY_REPACK_DIR_AMD64%" || goto end_failed
193call "%_MY_REPACK_DIR_AMD64%\UnpackBlessedDrivers.cmd" -b "%_MY_BINDIR_AMD64%" -i "%_MY_OPT_SIGNED_AMD64%" -n -v || goto end_failed
194echo .
195
196echo **************************************************************************
197echo * X86: Unpacking signed drivers...
198echo **************************************************************************
199cd /d "%_MY_REPACK_DIR_X86%" || goto end_failed
200call "%_MY_REPACK_DIR_X86%\UnpackBlessedDrivers.cmd" -b "%_MY_BINDIR_X86%" -i "%_MY_OPT_SIGNED_X86%" -n -v || goto end_failed
201echo .
202
203
204rem
205rem Building amd64 installer
206rem
207echo **************************************************************************
208echo * Building amd64 installer
209echo **************************************************************************
210
211del %_MY_OPT_UNTAR_DIR%\win.amd64\release\bin\additions\VBoxWindowsAdditions-amd64.exe
212cp %_MY_REPACK_DIR_AMD64%\..\obj\uninst.exe %_MY_REPACK_DIR_AMD64%
213
214rem TBD: that has to be converted to invoke auto-generated .cmd
215
216%KBUILD_BIN_PATH%\kmk_redirect.exe -C %_MY_OPT_SRC_DIR% ^
217 -E "PATH_OUT=%_MY_REPACK_DIR_AMD64%\.." ^
218 -E "PATH_TARGET=%_MY_REPACK_DIR_AMD64%" ^
219 -E "PATH_TARGET_X86=%_MY_REPACK_DIR_X86%\resources" ^
220 -E "VBOX_PATH_ADDITIONS_WIN_X86=%_MY_REPACK_DIR_AMD64%\..\bin\additions" ^
221 -E "VBOX_PATH_DIFX=%KBUILD_DEVTOOLS%\win.amd64\DIFx\v2.1-r3" ^
222 -E "VBOX_VENDOR=Oracle Corporation" -E "VBOX_VENDOR_SHORT=Oracle" -E "VBOX_PRODUCT=Oracle VM VirtualBox" ^
223 -E "VBOX_C_YEAR=@VBOX_C_YEAR@" -E "VBOX_VERSION_STRING=@VBOX_VERSION_STRING@" -E "VBOX_VERSION_STRING_RAW=@VBOX_VERSION_STRING_RAW@" ^
224 -E "VBOX_VERSION_MAJOR=@VBOX_VERSION_MAJOR@" -E "VBOX_VERSION_MINOR=@VBOX_VERSION_MINOR@" -E "VBOX_VERSION_BUILD=0" -E "VBOX_SVN_REV=@VBOX_SVN_REV@" ^
225 -E "VBOX_WINDOWS_ADDITIONS_ICON_FILE=%_MY_OPT_SRC_DIR%\VirtualBoxGA-vista.ico" ^
226 -E "VBOX_NSIS_ICON_FILE=%_MY_OPT_SRC_DIR%\VirtualBoxGA-nsis.ico" ^
227 -E "VBOX_WITH_GUEST_INSTALL_HELPER=1" -E "VBOX_WITH_GUEST_INSTALLER_UNICODE=1" -E "VBOX_WITH_LICENSE_INSTALL_RTF=1" ^
228 -E "VBOX_WITH_WDDM=1" -E "VBOX_WITH_MESA3D=1" -E "VBOX_BRAND_WIN_ADD_INST_DLGBMP=%_MY_OPT_SRC_DIR%\welcome.bmp" ^
229 -E "VBOX_BRAND_LICENSE_RTF=%_MY_OPT_SRC_DIR%\License-gpl-2.0.rtf" -E "BUILD_TYPE=release" -E "BUILD_TARGET_ARCH=amd64" ^
230 -- %KBUILD_DEVTOOLS%/win.x86/nsis/v3.04-log/makensis.exe /NOCD /V2 ^
231 "/DVBOX_SIGN_ADDITIONS=1" ^
232 "/DEXTERNAL_UNINSTALLER=1" ^
233 "%_MY_OPT_SRC_DIR%\VBoxGuestAdditions.nsi"
234
235rem
236rem Building amd64 installer
237rem
238echo **************************************************************************
239echo * Building x86 installer
240echo **************************************************************************
241
242del %_MY_OPT_UNTAR_DIR%\win.x86\release\bin\additions\VBoxWindowsAdditions-x86.exe
243cp %_MY_REPACK_DIR_X86%\..\obj\uninst.exe %_MY_REPACK_DIR_X86%\
244
245rem TBD: that has to be converted to invoke auto-generated .cmd
246
247%KBUILD_BIN_PATH%\kmk_redirect.exe -C %_MY_OPT_SRC_DIR% ^
248 -E "PATH_OUT=%_MY_REPACK_DIR_X86%\.." ^
249 -E "PATH_TARGET=%_MY_REPACK_DIR_X86%" ^
250 -E "PATH_TARGET_X86=%_MY_REPACK_DIR_X86%\resources" ^
251 -E "VBOX_PATH_ADDITIONS_WIN_X86=%_MY_REPACK_DIR_X86%\..\bin\additions" ^
252 -E "VBOX_PATH_DIFX=%KBUILD_DEVTOOLS%\win.x86\DIFx\v2.1-r3" ^
253 -E "VBOX_VENDOR=Oracle Corporation" -E "VBOX_VENDOR_SHORT=Oracle" -E "VBOX_PRODUCT=Oracle VM VirtualBox" ^
254 -E "VBOX_C_YEAR=@VBOX_C_YEAR@" -E "VBOX_VERSION_STRING=@VBOX_VERSION_STRING@" -E "VBOX_VERSION_STRING_RAW=@VBOX_VERSION_STRING_RAW@" ^
255 -E "VBOX_VERSION_MAJOR=@VBOX_VERSION_MAJOR@" -E "VBOX_VERSION_MINOR=@VBOX_VERSION_MINOR@" -E "VBOX_VERSION_BUILD=0" -E "VBOX_SVN_REV=@VBOX_SVN_REV@" ^
256 -E "VBOX_WINDOWS_ADDITIONS_ICON_FILE=%_MY_OPT_SRC_DIR%\VirtualBoxGA-vista.ico" ^
257 -E "VBOX_NSIS_ICON_FILE=%_MY_OPT_SRC_DIR%\VirtualBoxGA-nsis.ico" ^
258 -E "VBOX_WITH_GUEST_INSTALL_HELPER=1" -E "VBOX_WITH_GUEST_INSTALLER_UNICODE=1" -E "VBOX_WITH_LICENSE_INSTALL_RTF=1" ^
259 -E "VBOX_WITH_WDDM=1" -E "VBOX_WITH_MESA3D=1" -E "VBOX_BRAND_WIN_ADD_INST_DLGBMP=%_MY_OPT_SRC_DIR%\welcome.bmp" ^
260 -E "VBOX_BRAND_LICENSE_RTF=%_MY_OPT_SRC_DIR%\License-gpl-2.0.rtf" -E "BUILD_TYPE=release" -E "BUILD_TARGET_ARCH=x86" ^
261 -- %KBUILD_DEVTOOLS%/win.x86/nsis/v3.04-log/makensis.exe /NOCD /V2 ^
262 "/DVBOX_SIGN_ADDITIONS=1" ^
263 "/DEXTERNAL_UNINSTALLER=1" ^
264 "%_MY_OPT_SRC_DIR%\VBoxGuestAdditions.nsi"
265
266rem
267rem Making .iso
268rem
269echo **************************************************************************
270echo * Making VBoxGuestAdditions.iso
271echo **************************************************************************
272
273del %_MY_OPT_OUTDIR%/VBoxGuestAdditions.iso
274
275rem TBD: that has to be converted to invoke auto-generated .cmd
276
277%_MY_SCRIPT_DIR%/../bin/bldRTIsoMaker.exe ^
278 --output %_MY_OPT_OUTDIR%/VBoxGuestAdditions.iso ^
279 --iso-level 3 ^
280 --rock-ridge ^
281 --joliet ^
282 --rational-attribs ^
283 --random-order-verification 2048 ^
284 /cert/vbox-sha1.cer=%_MY_SCRIPT_DIR%../bin/additions/vbox-sha1.cer ^
285 /cert/vbox-sha256.cer=%_MY_SCRIPT_DIR%../bin/additions/vbox-sha256.cer ^
286 /VBoxWindowsAdditions-x86.exe=%_MY_OPT_UNTAR_DIR%/win.x86/release/bin/additions/VBoxWindowsAdditions-x86.exe ^
287 /VBoxWindowsAdditions.exe=%_MY_OPT_UNTAR_DIR%/win.x86/release/bin/additions/VBoxWindowsAdditions.exe ^
288 /AUTORUN.INF=%_MY_OPT_SRC_DIR%/AUTORUN.INF ^
289 /cert/VBoxCertUtil.exe=%_MY_SCRIPT_DIR%../bin/additions/VBoxCertUtil.exe ^
290 /NT3x/Readme.txt=%_MY_OPT_SRC_DIR%/NT3xReadme.txt ^
291 /NT3x/VBoxGuest.sys=%_MY_OPT_UNTAR_DIR%/win.x86/release/bin/additions/VBoxGuest.sys ^
292 /NT3x/VBoxGuest.cat=%_MY_OPT_UNTAR_DIR%/win.x86/release/bin/additions/VBoxGuest.cat ^
293 /NT3x/VBoxGuest.inf=%_MY_OPT_UNTAR_DIR%/win.x86/release/bin/additions/VBoxGuest.inf ^
294 /NT3x/VBoxMouseNT.sys=%_MY_OPT_UNTAR_DIR%/win.x86/release/bin/additions/VBoxMouseNT.sys ^
295 /NT3x/VBoxMouse.inf=%_MY_OPT_UNTAR_DIR%/win.x86/release/bin/additions/VBoxMouse.inf ^
296 /NT3x/VBoxMouse.cat=%_MY_OPT_UNTAR_DIR%/win.x86/release/bin/additions/VBoxMouse.cat ^
297 /NT3x/VBoxMouse.sys=%_MY_OPT_UNTAR_DIR%/win.x86/release/bin/additions/VBoxMouse.sys ^
298 /NT3x/VBoxControl.exe=%_MY_OPT_UNTAR_DIR%/win.x86/release/bin/additions/VBoxControl.exe ^
299 /NT3x/VBoxService.exe=%_MY_OPT_UNTAR_DIR%/win.x86/release/bin/additions/VBoxService.exe ^
300 /VBoxWindowsAdditions-amd64.exe=%_MY_OPT_UNTAR_DIR%/win.amd64/release/bin/additions/VBoxWindowsAdditions-amd64.exe ^
301 /VBoxSolarisAdditions.pkg=%_MY_OPT_UNTAR_DIR%/solaris.x86/release/bin/additions/VBoxSolarisAdditions.pkg ^
302 /OS2/VBoxGuest.sys=%_MY_OPT_UNTAR_DIR%/os2.x86/release/bin/additions/VBoxGuest.sys ^
303 /OS2/VBoxSF.ifs=%_MY_OPT_UNTAR_DIR%/os2.x86/release/bin/additions/VBoxSF.ifs ^
304 /OS2/VBoxService.exe=%_MY_OPT_UNTAR_DIR%/os2.x86/release/bin/additions/VBoxService.exe ^
305 /OS2/VBoxControl.exe=%_MY_OPT_UNTAR_DIR%/os2.x86/release/bin/additions/VBoxControl.exe ^
306 /OS2/VBoxReplaceDll.exe=%_MY_OPT_UNTAR_DIR%/os2.x86/release/bin/additions/VBoxReplaceDll.exe ^
307 /OS2/libc06.dll=%_MY_OPT_UNTAR_DIR%/os2.x86/release/bin/additions/libc06.dll ^
308 /OS2/libc061.dll=%_MY_OPT_UNTAR_DIR%/os2.x86/release/bin/additions/libc061.dll ^
309 /OS2/libc062.dll=%_MY_OPT_UNTAR_DIR%/os2.x86/release/bin/additions/libc062.dll ^
310 /OS2/libc063.dll=%_MY_OPT_UNTAR_DIR%/os2.x86/release/bin/additions/libc063.dll ^
311 /OS2/libc064.dll=%_MY_OPT_UNTAR_DIR%/os2.x86/release/bin/additions/libc064.dll ^
312 /OS2/libc065.dll=%_MY_OPT_UNTAR_DIR%/os2.x86/release/bin/additions/libc065.dll ^
313 /OS2/libc066.dll=%_MY_OPT_UNTAR_DIR%/os2.x86/release/bin/additions/libc066.dll ^
314 /OS2/readme.txt=%_MY_OPT_UNTAR_DIR%/os2.x86/release/bin/additions/readme.txt ^
315 /OS2/gengradd.dll=%_MY_OPT_UNTAR_DIR%/os2.x86/release/bin/additions/gengradd.dll ^
316 /OS2/vboxmouse.sys=%_MY_OPT_UNTAR_DIR%/os2.x86/release/bin/additions/vboxmouse.sys ^
317 /VBoxLinuxAdditions.run=%_MY_OPT_UNTAR_DIR%/linux.x86/release/bin/additions/VBoxLinuxAdditions.run ^
318 /runasroot.sh=%_MY_OPT_UNTAR_DIR%/linux.x86/release/bin/additions/runasroot.sh ^
319 /autorun.sh=%_MY_OPT_UNTAR_DIR%/linux.x86/release/bin/additions/autorun.sh ^
320 /VBoxDarwinAdditions.pkg=%_MY_OPT_UNTAR_DIR%/darwin.amd64/release/dist/additions/VBoxGuestAdditions.pkg ^
321 /VBoxDarwinAdditionsUninstall.tool=%_MY_OPT_UNTAR_DIR%/darwin.amd64/release/dist/additions/VBoxDarwinAdditionsUninstall.tool ^
322 --chmod a+x:/VBoxLinuxAdditions.run --chmod a+x:/runasroot.sh --chmod a+x:/autorun.sh --chmod a+x:/VBoxDarwinAdditionsUninstall.tool ^
323 --volume-id="VBOXADDITIONS_@VBOX_VERSION_STRING@_@VBOX_SVN_REV@" ^
324 --name-setup=joliet ^
325 --volume-id="VBox_GAs_@VBOX_VERSION_STRING@"
326
327if not exist %_MY_OPT_OUTDIR%/VBoxGuestAdditions.iso goto end_failed
328call set _MY_OUT_FILES=%%VBoxGuestAdditions.iso
329
330rem
331rem That's that.
332rem
333echo **************************************************************************
334echo * The third and final step is done.
335echo *
336echo * Successfully created:
337for %%i in (%_MY_OUT_FILES%) do echo * "%_MY_OPT_OUTDIR%\%%i"
338goto end
339
340
341:end_failed
342@cd /d "%_MY_SAVED_CD%"
343@endlocal
344@endlocal
345@echo * Failed!
346@exit /b 1
347
348:end
349@cd /d "%_MY_SAVED_CD%"
350@endlocal
351@endlocal
Note: See TracBrowser for help on using the repository browser.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette