VirtualBox

source: vbox/trunk/src/VBox/Additions/WINNT/Installer/Makefile.kmk@ 106501

Last change on this file since 106501 was 106438, checked in by vboxsync, 3 months ago

Additions/WINNT: Only force x86 build targets when on amd64, on arm64 we want arm64 versions of those tools and on x86 no override is necessray, bugref:10734 [scm fix]

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 21.0 KB
Line 
1# $Id: Makefile.kmk 106438 2024-10-17 11:50:20Z vboxsync $
2## @file
3# Sub-Makefile for the Windows Guest Additions Installer.
4#
5
6#
7# Copyright (C) 2006-2024 Oracle and/or its affiliates.
8#
9# This file is part of VirtualBox base platform packages, as
10# available from https://www.virtualbox.org.
11#
12# This program is free software; you can redistribute it and/or
13# modify it under the terms of the GNU General Public License
14# as published by the Free Software Foundation, in version 3 of the
15# License.
16#
17# This program is distributed in the hope that it will be useful, but
18# WITHOUT ANY WARRANTY; without even the implied warranty of
19# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
20# General Public License for more details.
21#
22# You should have received a copy of the GNU General Public License
23# along with this program; if not, see <https://www.gnu.org/licenses>.
24#
25# SPDX-License-Identifier: GPL-3.0-only
26#
27
28SUB_DEPTH = ../../../../..
29include $(KBUILD_PATH)/subheader.kmk
30
31#
32# Include Sub-Makefiles.
33#
34include $(PATH_SUB_CURRENT)/Loader/Makefile.kmk
35include $(PATH_SUB_CURRENT)/InstallHelper/Makefile.kmk
36
37
38#
39# Globals
40#
41VBOX_PATH_WIN_ADD_INS_SRC := $(PATH_SUB_CURRENT)
42VBOX_WITH_GUEST_INSTALL_HELPER := 1 # Use our guest install helper DLL.
43## @todo VBOX_WIN_ADD_INS_OUT_DIR := $(PATH_TARGET)/Additions/Installer/win
44
45ifdef VBOX_WIN_ATTESTATION_SIGNING
46 VBOX_DRIVERS_PACK_NAME := VBoxDrivers-$(VBOX_VERSION_MAJOR).$(VBOX_VERSION_MINOR).$(VBOX_VERSION_BUILD)r$(VBOX_SVN_REV)-$(KBUILD_TARGET_ARCH).cab
47 VBOX_SIGNED_DRIVERS_ZIP_NAME := $(VBOX_DRIVERS_PACK_NAME).Signed.zip
48 include $(KBUILD_PATH)/tools/ZIP.kmk
49 TOOL_ZIP_PACK ?= zip
50endif
51
52
53#
54# VBoxDrvInst - Helps with driver installation.
55#
56PROGRAMS += VBoxDrvInst
57VBoxDrvInst_TEMPLATE = VBoxGuestR3Exe
58VBoxDrvInst_DEFS = _WIN32_WINNT=0x0400 _UNICODE UNICODE
59VBoxDrvInst_DEFS += VBOX_SVN_REV=$(VBOX_SVN_REV)
60ifdef VBOX_WITH_WDDM
61 VBoxDrvInst_DEFS += VBOX_WITH_WDDM
62endif
63VBoxDrvInst_DEPS = $(VBOX_SVN_REV_KMK)
64VBoxDrvInst_SDKS = ReorderCompilerIncs $(VBOX_WINPSDK_GST) $(VBOX_WINDDK_GST)
65VBoxDrvInst_INCS = ../include
66VBoxDrvInst_SOURCES = \
67 VBoxDrvInst.cpp \
68 VBoxDrvInst.rc \
69 $(PATH_ROOT)/src/VBox/GuestHost/Installation/VBoxWinDrvCommon.cpp \
70 $(PATH_ROOT)/src/VBox/GuestHost/Installation/VBoxWinDrvInst.cpp \
71 $(PATH_ROOT)/src/VBox/GuestHost/Installation/VBoxWinDrvStore.cpp
72VBoxDrvInst_VBOX_IMPORT_CHECKER.win.x86 := nt4 # setupapi was introduced in NT4
73
74
75#
76# RegCleanup - A NT4 post-install registry cleanup helper preventing the
77# display config dialog from popping up on subsequent reboots.
78#
79PROGRAMS += RegCleanup
80RegCleanup_TEMPLATE := VBoxGuestR3Exe
81if1of ($(KBUILD_TARGET_ARCH), amd64)
82 RegCleanup_BLD_TRG_ARCH := x86
83endif
84RegCleanup_DEFS := _WIN32_WINNT=0x0400
85RegCleanup_SOURCES := \
86 RegCleanup.cpp \
87 RegCleanup.rc
88RegCleanup_VBOX_IMPORT_CHECKER.win.x86 := nt4
89
90
91#
92# Install all the certificates we use.
93#
94INSTALLS += AdditionsInstCertFiles
95AdditionsInstCertFiles_TEMPLATE := VBoxGuestR3Exe
96AdditionsInstCertFiles_SOURCES =
97AdditionsInstCertFiles_CLEAN =
98if defined(VBOX_SIGNING_MODE) && defined(VBOX_SIGN_ADDITIONS)
99 define def_VBoxAdditionsInstCertFiles
100 AdditionsInstCertFiles_SOURCES += $$(AdditionsInstCertFiles_0_OUTDIR)/$(1)=>$1
101 AdditionsInstCertFiles_CLEAN += $$(AdditionsInstCertFiles_0_OUTDIR)/$(1)
102 $$$$(AdditionsInstCertFiles_0_OUTDIR)/$(1): $$(2) | $$$$(dir $$$$@) $(VBOX_RTSIGNTOOL)
103 $(QUIET)$(RM) -f -- "$$@"
104 $(VBOX_RTSIGNTOOL) $3 --signature-index $4 --input "$$<" --output "$$@"
105 endef
106
107 if !defined(VBOX_CERTIFICATE_SHA2_SUBJECT_NAME) && !$(intersects win all 1,$(VBOX_WITH_CORP_CODE_SIGNING))
108 $(evalcall2 def_VBoxAdditionsInstCertFiles,vbox.cer,$(VBOX_PATH_ADDITIONS)/VBoxGuest.sys, \
109 extract-exe-signer-cert, 0)
110 VBOX_GA_CERT_ROOT_SHA1 := vbox-root.cer
111 $(evalcall2 def_VBoxAdditionsInstCertFiles,$(VBOX_GA_CERT_ROOT_SHA1),$(VBOX_PATH_ADDITIONS)/VBoxGuest.sys, \
112 extract-signer-root --self-signed-roots-from-system, 0)
113 ifdef VBOX_TSA_URL_ARGS
114 VBOX_GA_CERT_ROOT_SHA1_TS := vbox-timestamp-root.cer
115 $(evalcall2 def_VBoxAdditionsInstCertFiles,$(VBOX_GA_CERT_ROOT_SHA1_TS),$(VBOX_PATH_ADDITIONS)/VBoxGuest.sys, \
116 extract-timestamp-root --self-signed-roots-from-system, 0)
117 endif
118 else
119 $(evalcall2 def_VBoxAdditionsInstCertFiles,vbox-sha1.cer,$(VBOX_PATH_ADDITIONS)/VBoxGuest.sys, \
120 extract-exe-signer-cert, 0)
121 VBOX_GA_CERT_ROOT_SHA1 := vbox-sha1-root.cer
122 $(evalcall2 def_VBoxAdditionsInstCertFiles,$(VBOX_GA_CERT_ROOT_SHA1),$(VBOX_PATH_ADDITIONS)/VBoxGuest.sys, \
123 extract-signer-root --self-signed-roots-from-system, 0)
124 ifdef VBOX_TSA_URL_ARGS
125 VBOX_GA_CERT_ROOT_SHA1_TS := vbox-sha1-timestamp-root.cer
126 $(evalcall2 def_VBoxAdditionsInstCertFiles,$(VBOX_GA_CERT_ROOT_SHA1_TS),$(VBOX_PATH_ADDITIONS)/VBoxGuest.sys, \
127 extract-timestamp-root --self-signed-roots-from-system, 0)
128 endif
129
130 $(evalcall2 def_VBoxAdditionsInstCertFiles,vbox-sha256.cer,$(VBOX_PATH_ADDITIONS)/VBoxGuest.sys, \
131 extract-exe-signer-cert, 1)
132 VBOX_GA_CERT_ROOT_SHA2 := vbox-sha256-root.cer
133 $(evalcall2 def_VBoxAdditionsInstCertFiles,$(VBOX_GA_CERT_ROOT_SHA2),$(VBOX_PATH_ADDITIONS)/VBoxGuest.sys, \
134 extract-signer-root --self-signed-roots-from-system, 1)
135 ifdef VBOX_TSA_SHA2_URL_ARGS
136 VBOX_GA_CERT_ROOT_SHA2_TS := vbox-sha256-timestamp-root.cer
137 $(evalcall2 def_VBoxAdditionsInstCertFiles,$(VBOX_GA_CERT_ROOT_SHA2_TS),$(VBOX_PATH_ADDITIONS)/VBoxGuest.sys, \
138 extract-timestamp-root --self-signed-roots-from-system, 1)
139 endif
140
141 if !$(intersects win, $(VBOX_WITH_CORP_CODE_SIGNING)) && $(intersects win_planb,$(VBOX_WITH_CORP_CODE_SIGNING))
142 $(evalcall2 def_VBoxAdditionsInstCertFiles,vbox-sha256-r3.cer,$(VBOX_PATH_ADDITIONS)/VBoxDrvInst.exe, \
143 extract-exe-signer-cert, 1)
144 VBOX_GA_CERT_ROOT_SHA2_R3 := vbox-sha256-r3-root.cer
145 $(evalcall2 def_VBoxAdditionsInstCertFiles,$(VBOX_GA_CERT_ROOT_SHA2_R3),$(VBOX_PATH_ADDITIONS)/VBoxDrvInst.exe, \
146 extract-signer-root --self-signed-roots-from-system, 1)
147 VBOX_GA_CERT_ROOT_SHA2_R3_TS := vbox-sha256-r3-timestamp-root.cer
148 $(evalcall2 def_VBoxAdditionsInstCertFiles,$(VBOX_GA_CERT_ROOT_SHA2_R3_TS),$(VBOX_PATH_ADDITIONS)/VBoxDrvInst.exe, \
149 extract-timestamp-root --self-signed-roots-from-system, 1)
150 endif
151 endif
152endif
153
154#
155# The installer.
156#
157PACKING += $(PATH_STAGE_BIN)/additions/VBoxWindowsAdditions-$(KBUILD_TARGET_ARCH).exe
158OTHER_CLEAN += $(PATH_STAGE_BIN)/additions/VBoxWindowsAdditions-$(KBUILD_TARGET_ARCH).exe
159
160VBOX_WINDOWS_ADDITIONS_ATTESTATION_SIGNED_FILES := \
161 $(PATH_STAGE_BIN)/additions/VBoxGuest.inf \
162 $(PATH_STAGE_BIN)/additions/VBoxGuest.sys \
163 $(PATH_STAGE_BIN)/additions/VBoxTray.exe \
164 $(PATH_STAGE_BIN)/additions/VBoxControl.exe \
165 \
166 $(PATH_STAGE_BIN)/additions/VBoxMouse.inf \
167 $(PATH_STAGE_BIN)/additions/VBoxMouse.sys \
168 \
169 $(PATH_STAGE_BIN)/additions/VBoxVideo.inf \
170 $(PATH_STAGE_BIN)/additions/VBoxVideo.sys \
171 $(PATH_STAGE_BIN)/additions/VBoxDisp.dll \
172 \
173 $(PATH_STAGE_BIN)/additions/VBoxSF.sys \
174 $(PATH_STAGE_BIN)/additions/VBoxMRXNP.dll
175
176ifeq ($(KBUILD_TARGET_ARCH),amd64) # 32-bit network provider DLLs for 32-bit apps running on a 64-bit system
177 VBOX_WINDOWS_ADDITIONS_ATTESTATION_SIGNED_FILES += \
178 $(PATH_STAGE_BIN)/additions/VBoxMRXNP-x86.dll
179endif
180
181ifeq ($(KBUILD_TARGET_ARCH),x86)
182 VBOX_WINDOWS_ADDITIONS_OTHER_FILES += \
183 $(PATH_STAGE_BIN)/additions/VBoxGuestEarlyNT.inf \
184 $(PATH_STAGE_BIN)/additions/VBoxVideoEarlyNT.inf
185endif
186
187if defined(VBOX_SIGNING_MODE) && defined(VBOX_SIGN_ADDITIONS)
188 VBOX_WINDOWS_ADDITIONS_OTHER_FILES += \
189 $(PATH_STAGE_BIN)/additions/VBoxVideo.cat \
190 $(PATH_STAGE_BIN)/additions/VBoxVideo-PreW10.cat \
191 $(PATH_STAGE_BIN)/additions/VBoxGuest.cat \
192 $(PATH_STAGE_BIN)/additions/VBoxGuest-PreW10.cat \
193 $(PATH_STAGE_BIN)/additions/VBoxMouse.cat \
194 $(PATH_STAGE_BIN)/additions/VBoxMouse-PreW10.cat
195 ifeq ($(KBUILD_TARGET_ARCH),x86)
196 VBOX_WINDOWS_ADDITIONS_OTHER_FILES += \
197 $(PATH_STAGE_BIN)/additions/VBoxGuestEarlyNT.cat \
198 $(PATH_STAGE_BIN)/additions/VBoxVideoEarlyNT.cat
199 endif
200endif
201
202VBOX_WINDOWS_ADDITIONS_OTHER_FILES := \
203 $(PATH_STAGE_BIN)/additions/VBoxService.exe \
204 $(PATH_STAGE_BIN)/additions/VBoxHook.dll \
205 $(PATH_STAGE_BIN)/additions/RegCleanup.exe
206
207ifeq ($(KBUILD_TARGET_ARCH),x86)
208 VBOX_WINDOWS_ADDITIONS_OTHER_FILES += \
209 $(PATH_STAGE_BIN)/additions/VBoxMouseNT.sys \
210 $(PATH_STAGE_BIN)/additions/VBoxSFW2K.sys
211endif
212
213ifdef VBOX_WITH_WDDM
214 VBOX_WINDOWS_ADDITIONS_ATTESTATION_SIGNED_FILES += \
215 $(PATH_STAGE_BIN)/additions/VBoxWddm.inf \
216 $(PATH_STAGE_BIN)/additions/VBoxWddm.sys \
217 $(PATH_STAGE_BIN)/additions/VBoxDispD3D.dll
218 ifeq ($(KBUILD_TARGET_ARCH),amd64)
219 VBOX_WINDOWS_ADDITIONS_ATTESTATION_SIGNED_FILES += \
220 $(PATH_STAGE_BIN)/additions/VBoxDispD3D-x86.dll
221 endif
222
223 ifdef VBOX_WITH_WDDM_DX
224 VBOX_WINDOWS_ADDITIONS_ATTESTATION_SIGNED_FILES += \
225 $(PATH_STAGE_BIN)/additions/VBoxDX.dll
226 ifeq ($(KBUILD_TARGET_ARCH),amd64)
227 VBOX_WINDOWS_ADDITIONS_ATTESTATION_SIGNED_FILES += \
228 $(PATH_STAGE_BIN)/additions/VBoxDX-x86.dll
229 endif
230 endif
231
232 ifdef VBOX_WITH_MESA3D
233 VBOX_WINDOWS_ADDITIONS_ATTESTATION_SIGNED_FILES += \
234 $(PATH_STAGE_BIN)/additions/VBoxNine.dll \
235 $(PATH_STAGE_BIN)/additions/VBoxSVGA.dll \
236 $(PATH_STAGE_BIN)/additions/VBoxGL.dll
237 ifeq ($(KBUILD_TARGET_ARCH),amd64)
238 VBOX_WINDOWS_ADDITIONS_ATTESTATION_SIGNED_FILES += \
239 $(PATH_STAGE_BIN)/additions/VBoxNine-x86.dll \
240 $(PATH_STAGE_BIN)/additions/VBoxSVGA-x86.dll \
241 $(PATH_STAGE_BIN)/additions/VBoxGL-x86.dll
242 endif
243 endif
244
245 if defined(VBOX_SIGNING_MODE) && defined(VBOX_SIGN_ADDITIONS)
246 VBOX_WINDOWS_ADDITIONS_OTHER_FILES += \
247 $(PATH_STAGE_BIN)/additions/VBoxWddm.cat \
248 $(PATH_STAGE_BIN)/additions/VBoxWddm-PreW10.cat
249 endif
250endif # VBOX_WITH_WDDM
251
252ifdef env.VBOX_WITH_ADDITIONS_SHIPPING_AUDIO_TEST
253 VBOX_WINDOWS_ADDITIONS_OTHER_FILES += \
254 $(PATH_STAGE_BIN)/additions/VBoxAudioTest.exe
255endif
256
257VBOX_WINDOWS_ADDITIONS_OTHER_FILES += $(addprefix $(PATH_STAGE_BIN)/additions/, \
258 $(VBOX_GA_CERT_ROOT_SHA1) \
259 $(VBOX_GA_CERT_ROOT_SHA1_TS) \
260 $(VBOX_GA_CERT_ROOT_SHA2) \
261 $(VBOX_GA_CERT_ROOT_SHA2_TS) \
262 $(VBOX_GA_CERT_ROOT_SHA2_R3) \
263 $(VBOX_GA_CERT_ROOT_SHA2_R3_TS))
264
265VB_WIN_ADD_NSIS_ENV := \
266 -E 'PATH_OUT=$(subst /,\,$(PATH_OUT))' \
267 -E 'PATH_TARGET=$(subst /,\,$(PATH_TARGET))' \
268 -E 'VBOX_VENDOR=$(VBOX_VENDOR)' \
269 -E 'VBOX_VENDOR_SHORT=$(VBOX_VENDOR_SHORT)' \
270 -E 'VBOX_PRODUCT=$(VBOX_PRODUCT)' \
271 -E 'VBOX_C_YEAR=$(VBOX_C_YEAR)' \
272 -E 'VBOX_VERSION_STRING=$(VBOX_VERSION_STRING)' \
273 -E 'VBOX_VERSION_STRING_RAW=$(VBOX_VERSION_STRING_RAW)' \
274 -E 'VBOX_VERSION_MAJOR=$(VBOX_VERSION_MAJOR)' \
275 -E 'VBOX_VERSION_MINOR=$(VBOX_VERSION_MINOR)' \
276 -E 'VBOX_VERSION_BUILD=$(VBOX_VERSION_BUILD)' \
277 -E 'VBOX_SVN_REV=$(VBOX_SVN_REV)' \
278 -E 'VBOX_WINDOWS_ADDITIONS_ICON_FILE=$(subst /,\,$(VBOX_WINDOWS_ADDITIONS_ICON_FILE))' \
279 -E 'VBOX_NSIS_ICON_FILE=$(subst /,\,$(VBOX_NSIS_ICON_FILE))' \
280 -E 'VBOX_WITH_GUEST_INSTALL_HELPER=$(if $(VBOX_WITH_GUEST_INSTALL_HELPER),1,0)' \
281 -E 'VBOX_WITH_GUEST_INSTALLER_UNICODE=$(if $(VBOX_WITH_GUEST_INSTALLER_UNICODE),1,0)' \
282 -E 'VBOX_WITH_ADDITIONS_SHIPPING_AUDIO_TEST=$(if $(VBOX_WITH_ADDITIONS_SHIPPING_AUDIO_TEST),1,0)' \
283 -E 'VBOX_WITH_LICENSE_INSTALL_RTF=$(if $(VBOX_BRAND_LICENSE_RTF),1,0)' \
284 -E 'VBOX_WITH_WDDM=$(if $(VBOX_WITH_WDDM),1,0)' \
285 -E 'VBOX_WITH_WDDM_DX=$(if $(VBOX_WITH_WDDM_DX),1,0)' \
286 -E 'VBOX_WITH_MESA3D=$(if $(VBOX_WITH_MESA3D),1,0)' \
287 -E 'VBOX_BRAND_WIN_ADD_INST_DLGBMP=$(subst /,\,$(VBOX_BRAND_WIN_ADD_INST_DLGBMP))' \
288 -E 'VBOX_BRAND_LICENSE_RTF=$(subst /,\,$(VBOX_BRAND_LICENSE_RTF))' \
289 $(foreach lang,$(VBOX_INSTALLER_ADD_LANGUAGES),-E 'VBOX_BRAND_$(lang)_LICENSE_RTF=$(VBOX_BRAND_$(lang)_LICENSE_RTF)') \
290 -E 'KBUILD_TYPE=$(KBUILD_TYPE)' \
291 -E 'KBUILD_TARGET_ARCH=$(KBUILD_TARGET_ARCH)' \
292 $(foreach base, VBOX_GA_CERT_ROOT_SHA1 VBOX_GA_CERT_ROOT_SHA2 VBOX_GA_CERT_ROOT_SHA2_R3 \
293 ,-E '$(base)=$(firstword $($(base)) none)' -E '$(base)_TS=$(firstword $($(base)_TS) none)')
294
295$(PATH_STAGE_BIN)/additions/VBoxWindowsAdditions-$(KBUILD_TARGET_ARCH).exe: \
296 $(PATH_SUB_CURRENT)/VBoxGuestAdditions.nsi \
297 $(PATH_SUB_CURRENT)/VBoxGuestAdditionsCommon.nsh \
298 $(PATH_SUB_CURRENT)/VBoxGuestAdditionsExternal.nsh \
299 $(PATH_SUB_CURRENT)/VBoxGuestAdditionsLog.nsh \
300 $(PATH_SUB_CURRENT)/VBoxGuestAdditionsUninstall.nsh \
301 $(PATH_SUB_CURRENT)/VBoxGuestAdditionsUninstallOld.nsh \
302 $(PATH_SUB_CURRENT)/VBoxGuestAdditionsNT4.nsh \
303 $(PATH_SUB_CURRENT)/VBoxGuestAdditionsW2KXP.nsh \
304 $(PATH_SUB_CURRENT)/VBoxGuestAdditionsVista.nsh \
305 $(PATH_SUB_CURRENT)/dumplog.nsh \
306 $(PATH_SUB_CURRENT)/ReplaceDLL.nsh \
307 $(PATH_SUB_CURRENT)/servicepack.nsh \
308 $(PATH_SUB_CURRENT)/strstr.nsh \
309 $(PATH_SUB_CURRENT)/winver.nsh \
310 $(PATH_SUB_CURRENT)/Languages/English.nsh \
311 $(PATH_SUB_CURRENT)/Languages/German.nsh \
312 $(PATH_SUB_CURRENT)/Languages/French.nsh \
313 $(VBOX_WINDOWS_ADDITIONS_ATTESTATION_SIGNED_FILES) \
314 $(VBOX_WINDOWS_ADDITIONS_OTHER_FILES) \
315 $(VBOX_WINDOWS_ADDITIONS_ICON_FILE) \
316 $(VBOX_NSIS_ICON_FILE) \
317 $(if $(VBOX_SIGNING_MODE),$(PATH_TARGET)/uninst.exe) \
318 $(if $(VBOX_WIN_ATTESTATION_SIGNING),$(PATH_OUT)/repackadd/$(VBOX_SIGNED_DRIVERS_ZIP_NAME)) \
319 $(VBOX_VERSION_STAMP) \
320 $$(VBoxDrvInst_1_STAGE_TARGET) \
321 | $(VBOX_SIGN_IMAGE_ORDERDEPS)
322 $(call MSG_L1,Creating $@, from $<)
323ifdef VBOX_WIN_ATTESTATION_SIGNING # Unpack the attestation signed drivers - this is an ugly as 'ing heck hack!
324 $(TOOL_ZIP_UNPACK) -oj $(PATH_OUT)/repackadd/$(VBOX_SIGNED_DRIVERS_ZIP_NAME) -d $(PATH_STAGE_BIN)/additions/
325endif
326 $(REDIRECT) -C $(VBOX_PATH_WIN_ADD_INS_SRC) \
327 $(VB_WIN_ADD_NSIS_ENV) \
328 -- $(EXEC_X86_WIN32) $(VBOX_PATH_NSIS)/makensis.exe /NOCD /V2 \
329 $(if $(VBOX_SIGNING_MODE),'/DEXTERNAL_UNINSTALLER=1') \
330 $(if-expr defined(VBOX_SIGN_ADDITIONS) && defined(VBOX_SIGNING_MODE), \
331 '/DVBOX_SIGN_ADDITIONS=1' \
332 $(if-expr defined(VBOX_WITH_VBOX_LEGACY_TS_CA),'/DVBOX_WITH_VBOX_LEGACY_TS_CA=1') \
333 ,) \
334 $(if $(VBOX_INSTALLER_ADD_LANGUAGES),'/DVBOX_INSTALLER_ADD_LANGUAGES=1') \
335 $(foreach lang,$(VBOX_INSTALLER_ADD_LANGUAGES),'/DVBOX_BRAND_$(lang)_LICENSE_RTF=1') \
336 '$(subst /,\,$<)'
337 $(call VBOX_SIGN_IMAGE_FN,$@)
338
339
340ifdef VBOX_SIGNING_MODE
341 #
342 # This is a hack to sign the uninstaller.
343 # See http://nsis.sourceforge.net/Signing_an_Uninstaller for more details.
344 #
345 OTHER_CLEAN += \
346 $(PATH_TARGET)/VBoxWindowsAdditions-$(KBUILD_TARGET_ARCH)-uninst.exe \
347 $(PATH_TARGET)/uninst.exe
348 $(PATH_TARGET)/VBoxWindowsAdditions-$(KBUILD_TARGET_ARCH)-uninst.exe: \
349 $(PATH_SUB_CURRENT)/VBoxGuestAdditions.nsi \
350 $(PATH_SUB_CURRENT)/VBoxGuestAdditionsCommon.nsh \
351 $(PATH_SUB_CURRENT)/VBoxGuestAdditionsExternal.nsh \
352 $(PATH_SUB_CURRENT)/VBoxGuestAdditionsLog.nsh \
353 $(PATH_SUB_CURRENT)/VBoxGuestAdditionsUninstall.nsh \
354 $(PATH_SUB_CURRENT)/VBoxGuestAdditionsNT4.nsh \
355 $(PATH_SUB_CURRENT)/VBoxGuestAdditionsW2KXP.nsh \
356 $(PATH_SUB_CURRENT)/VBoxGuestAdditionsVista.nsh \
357 $(PATH_SUB_CURRENT)/dumplog.nsh \
358 $(PATH_SUB_CURRENT)/ReplaceDLL.nsh \
359 $(PATH_SUB_CURRENT)/servicepack.nsh \
360 $(PATH_SUB_CURRENT)/strstr.nsh \
361 $(PATH_SUB_CURRENT)/winver.nsh \
362 $(PATH_SUB_CURRENT)/Languages/English.nsh \
363 $(PATH_SUB_CURRENT)/Languages/German.nsh \
364 $(PATH_SUB_CURRENT)/Languages/French.nsh \
365 $(VBOX_WINDOWS_ADDITIONS_ATTESTATION_SIGNED_FILES) \
366 $(VBOX_WINDOWS_ADDITIONS_OTHER_FILES) \
367 $(VBOX_WINDOWS_ADDITIONS_ICON_FILE) \
368 $(VBOX_NSIS_ICON_FILE) \
369 $(VBOX_VERSION_STAMP) \
370 $$(VBoxDrvInst_1_STAGE_TARGET) \
371 | $$(dir $$@)
372 $(call MSG_L1,Creating $@, from $<)
373 $(QUIET)$(REDIRECT) -C $(VBOX_PATH_WIN_ADD_INS_SRC) \
374 $(VB_WIN_ADD_NSIS_ENV) \
375 -- $(EXEC_X86_WIN32) $(VBOX_PATH_NSIS)/makensis.exe /NOCD /V2 \
376 $(if $(VBOX_SIGN_ADDITIONS),'/DVBOX_SIGN_ADDITIONS=1') \
377 $(if $(VBOX_WITH_VBOX_LEGACY_TS_CA),'/DVBOX_WITH_VBOX_LEGACY_TS_CA=1') \
378 $(if $(VBOX_INSTALLER_ADD_LANGUAGES),'/DVBOX_INSTALLER_ADD_LANGUAGES=1') \
379 $(foreach lang,$(VBOX_INSTALLER_ADD_LANGUAGES),'/DVBOX_BRAND_$(lang)_LICENSE_RTF=1') \
380 '/DUNINSTALLER_ONLY=1' \
381 '$(subst /,\,$<)'
382
383 $(PATH_TARGET)/uninst.exe: \
384 $(PATH_TARGET)/VBoxWindowsAdditions-$(KBUILD_TARGET_ARCH)-uninst.exe | $$(dir $$@) $(VBOX_SIGN_IMAGE_ORDERDEPS)
385 $(call MSG_L1,Creating $@, from $<)
386 $(QUIET)$(RM) -f $@
387 -$(REDIRECT) -E __COMPAT_LAYER=RUNASINVOKER -- $<
388 $(TEST) -f $@
389 $(call VBOX_SIGN_IMAGE_FN,$@)
390
391endif # VBOX_SIGNING_MODE
392
393
394if defined(VBOX_WIN_ATTESTATION_SIGNING) && defined(VBOX_SIGNING_MODE) && defined(VBOX_SIGN_ADDITIONS)
395 #
396 # This automagically attestation signs the GA drivers.
397 #
398 $(PATH_OUT)/repackadd/$(VBOX_SIGNED_DRIVERS_ZIP_NAME): \
399 $(PATH_OUT)/repackadd/$(VBOX_DRIVERS_PACK_NAME)
400 $(RM_EXT) -f $(PATH_OUT)/repackadd/*.zip
401 cd $(PATH_OUT)/repackadd && $(VBOX_RETRY) $(VBOX_WIN_ATTESTATION_SIGNING_EXE) "VirtualBox GA drivers $(KBUILD_TARGET_ARCH) $(VBOX_VERSION_MAJOR).$(VBOX_VERSION_MINOR).$(VBOX_VERSION_BUILD)r$(VBOX_SVN_REV)" "$(KBUILD_TARGET_ARCH)" "r$(VBOX_SVN_REV)" "$(VBOX_DRIVERS_PACK_NAME)"
402
403 #
404 # This creates a .CAB file of the driver files that should be attestation signed.
405 #
406 $(PATH_OUT)/repackadd/$(VBOX_DRIVERS_PACK_NAME): \
407 $(PATH_OUT)/repackadd/PackDriversForSubmission.cmd \
408 # $(VBOX_WINDOWS_ADDITIONS_ATTESTATION_SIGNED_FILES) - is is unsafe, because of the 'ing ugly hack replacing most of them above during packing.
409 $(RM_EXT) -f $(PATH_OUT)/repackadd/*.cab
410 $(RM_EXT) -f $(PATH_OUT)/repackadd/*.ddf
411 $(RM_EXT) -f $(PATH_OUT)/repackadd/*.inf
412 $(RM_EXT) -f $(PATH_OUT)/repackadd/*.rpt
413 $(EXEC_X86_WIN32) cmd /c $(PATH_OUT)/repackadd/PackDriversForSubmission.cmd -b $(PATH_STAGE_BIN) -a $(KBUILD_TARGET_ARCH) \
414 -x -n --no-main --ga -o $(PATH_OUT)/repackadd/$(VBOX_DRIVERS_PACK_NAME)
415 $(call VBOX_SIGN_EV_FILE_FN,$@)
416endif # VBOX_WIN_ATTESTATION_SIGNING && VBOX_SIGNING_MODE && VBOX_SIGN_ADDITIONS
417
418
419#
420# Repackaging scripts and files.
421#
422INSTALLS += RePackScriptsAdd
423RePackScriptsAdd_TEMPLATE = DUMMY
424RePackScriptsAdd_INST = repackadd/
425RePackScriptsAdd_INSTTYPE = stage
426RePackScriptsAdd_SOURCES = \
427 ../../../Installer/win/Scripts/UnpackBlessedDrivers.cmd \
428 $(RePackScriptsAdd_0_OUTDIR)/PackDriversForSubmission.cmd \
429 $(RePackScriptsAdd_0_OUTDIR)/Combined-1-Prepare.cmd \
430 $(RePackScriptsAdd_0_OUTDIR)/Combined-3-RepackAdditions.cmd \
431 $(RePackScriptsAdd_0_OUTDIR)/sign-ev.cmd
432RePackScriptsAdd_CLEAN = \
433 $(RePackScriptsAdd_0_OUTDIR)/sign-ev.cmd
434
435ifndef VBOX_OSE
436 RePackScriptsAdd_SOURCES += \
437 $(RePackScriptsAdd_0_OUTDIR)/Combined-0-Additions.cmd \
438 $(RePackScriptsAdd_0_OUTDIR)/Combined-2-SignAdditions.cmd
439endif
440
441$(call VBOX_EDIT_VERSION_AND_BUILD_RULE_FN,RePackScriptsAdd,../../../Installer/win/Scripts/PackDriversForSubmission.cmd,PackDriversForSubmission.cmd)
442$(call VBOX_EDIT_VERSION_AND_BUILD_RULE_FN,RePackScriptsAdd,../../../Installer/win/Scripts/Combined-1-Prepare.cmd,Combined-1-Prepare.cmd)
443ifndef VBOX_OSE
444 $(call VBOX_EDIT_VERSION_AND_BUILD_RULE_FN,RePackScriptsAdd,../../../Installer/win/Scripts/Combined-0-Additions.cmd,Combined-0-Additions.cmd)
445 $(call VBOX_EDIT_VERSION_AND_BUILD_RULE_FN,RePackScriptsAdd,../../../Installer/win/Scripts/Combined-2-SignAdditions.cmd,Combined-2-SignAdditions.cmd)
446endif
447$(call VBOX_EDIT_VERSION_AND_BUILD_RULE_FN,RePackScriptsAdd,../../../Installer/win/Scripts/Combined-3-RepackAdditions.cmd,Combined-3-RepackAdditions.cmd)
448
449# The %~dp1\ oddity is working around otherwise ending with \" during
450# expansion of the CCS command line which for a reason I cannot immediately
451# understand appends a " to the path.
452$$(RePackScriptsAdd_0_OUTDIR)/sign-ev.cmd: | $$(dir $$@)
453 $(APPEND) -nt "$@" \
454 'if ".%KBUILD_DEVTOOLS%" == "." (echo KBUILD_DEVTOOLS is not set & exit /b 1)' \
455 'if ".%KBUILD_BIN_PATH%" == "." (echo KBUILD_BIN_PATH is not set & exit /b 1)' \
456 'if ".%1" == "." (echo No .cab file specified & exit /b 1)' \
457 $(subst $(KBUILD_BIN_PATH),%KBUILD_BIN_PATH%,$(subst $(KBUILD_DEVTOOLS),%KBUILD_DEVTOOLS%, \
458 '( $(call VBOX_SIGN_EV_FILE_FN,%1,%~dp1\) ) || exit /b1' \
459 ) )
460
461#
462# Repacking resources.
463#
464INSTALLS += RePackScriptsAddResources
465RePackScriptsAddResources_TEMPLATE = DUMMY
466RePackScriptsAddResources_INST = repackadd/resources/
467RePackScriptsAddResources_INSTTYPE = stage
468RePackScriptsAddResources_DIRS = Languages
469RePackScriptsAddResources_SOURCES = \
470 welcome.bmp \
471 $(VBOX_WINDOWS_ADDITIONS_ICON_FILE)=>VirtualBoxGA-vista.ico \
472 $(VBOX_NSIS_ICON_FILE)=>VirtualBoxGA-nsis.ico \
473 $(PATH_ROOT)/doc/License-gpl-3.0.rtf \
474 VBoxGuestAdditions.nsi \
475 dumplog.nsh \
476 ReplaceDLL.nsh \
477 servicepack.nsh \
478 strstr.nsh \
479 VBoxGuestAdditionsCommon.nsh \
480 VBoxGuestAdditionsExternal.nsh \
481 VBoxGuestAdditionsLog.nsh \
482 VBoxGuestAdditionsNT4.nsh \
483 VBoxGuestAdditionsUninstall.nsh \
484 VBoxGuestAdditionsUninstallOld.nsh \
485 VBoxGuestAdditionsVista.nsh \
486 VBoxGuestAdditionsW2KXP.nsh \
487 winver.nsh \
488 ISO/AUTORUN.INF \
489 ISO/NT3xReadme.txt \
490 \
491 Languages/English.nsh=>Languages/English.nsh \
492 Languages/French.nsh=>Languages/French.nsh \
493 Languages/German.nsh=>Languages/German.nsh
494
495
496#
497# NT3.x installer.
498#
499# Just for fun, this one does not use the CRT more than it really really needs
500# to. This saves space and avoid compatiblity issues, it also makes for a
501# fun challenge.
502#
503PROGRAMS.win.x86 += VBoxAddInstallNt3x
504ifdef VBOX_WITH_NOCRT_STATIC
505 ## @todo noCRT: the result is much too big. Got rid of log.cpp, but still pretty big. Work on reducing it.
506 VBoxAddInstallNt3x_TEMPLATE := VBoxGuestR3Exe
507else
508 VBoxAddInstallNt3x_TEMPLATE := VBoxGuestR3NoCrtExe
509endif
510VBoxAddInstallNt3x_SOURCES := VBoxAddInstallNt3x.cpp
511VBoxAddInstallNt3x.cpp_DEPS = $(VBOX_SVN_REV_HEADER)
512
513
514include $(FILE_KBUILD_SUB_FOOTER)
515
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