VirtualBox

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

Last change on this file since 106321 was 106321, checked in by vboxsync, 6 weeks ago

Windows installers: Big revamp for removing all DIFxApp-related / DIFxApi-related code and build dependencies for the host and guest installers. bugref:10762

This implements an own framework (VBoxWinDrvInst and VBoxWinDrvStore) for installing Windows drivers and querying / handling the Windows driver store,
along with testcases for the Windows guest and host installers.

  • 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 106321 2024-10-15 13:06:30Z 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
81RegCleanup_BLD_TRG_ARCH := x86
82RegCleanup_DEFS := _WIN32_WINNT=0x0400
83RegCleanup_SOURCES := \
84 RegCleanup.cpp \
85 RegCleanup.rc
86RegCleanup_VBOX_IMPORT_CHECKER.win.x86 := nt4
87
88
89#
90# Install all the certificates we use.
91#
92INSTALLS += AdditionsInstCertFiles
93AdditionsInstCertFiles_TEMPLATE := VBoxGuestR3Exe
94AdditionsInstCertFiles_SOURCES =
95AdditionsInstCertFiles_CLEAN =
96if defined(VBOX_SIGNING_MODE) && defined(VBOX_SIGN_ADDITIONS)
97 define def_VBoxAdditionsInstCertFiles
98 AdditionsInstCertFiles_SOURCES += $$(AdditionsInstCertFiles_0_OUTDIR)/$(1)=>$1
99 AdditionsInstCertFiles_CLEAN += $$(AdditionsInstCertFiles_0_OUTDIR)/$(1)
100 $$$$(AdditionsInstCertFiles_0_OUTDIR)/$(1): $$(2) | $$$$(dir $$$$@) $(VBOX_RTSIGNTOOL)
101 $(QUIET)$(RM) -f -- "$$@"
102 $(VBOX_RTSIGNTOOL) $3 --signature-index $4 --input "$$<" --output "$$@"
103 endef
104
105 if !defined(VBOX_CERTIFICATE_SHA2_SUBJECT_NAME) && !$(intersects win all 1,$(VBOX_WITH_CORP_CODE_SIGNING))
106 $(evalcall2 def_VBoxAdditionsInstCertFiles,vbox.cer,$(VBOX_PATH_ADDITIONS)/VBoxGuest.sys, \
107 extract-exe-signer-cert, 0)
108 VBOX_GA_CERT_ROOT_SHA1 := vbox-root.cer
109 $(evalcall2 def_VBoxAdditionsInstCertFiles,$(VBOX_GA_CERT_ROOT_SHA1),$(VBOX_PATH_ADDITIONS)/VBoxGuest.sys, \
110 extract-signer-root --self-signed-roots-from-system, 0)
111 ifdef VBOX_TSA_URL_ARGS
112 VBOX_GA_CERT_ROOT_SHA1_TS := vbox-timestamp-root.cer
113 $(evalcall2 def_VBoxAdditionsInstCertFiles,$(VBOX_GA_CERT_ROOT_SHA1_TS),$(VBOX_PATH_ADDITIONS)/VBoxGuest.sys, \
114 extract-timestamp-root --self-signed-roots-from-system, 0)
115 endif
116 else
117 $(evalcall2 def_VBoxAdditionsInstCertFiles,vbox-sha1.cer,$(VBOX_PATH_ADDITIONS)/VBoxGuest.sys, \
118 extract-exe-signer-cert, 0)
119 VBOX_GA_CERT_ROOT_SHA1 := vbox-sha1-root.cer
120 $(evalcall2 def_VBoxAdditionsInstCertFiles,$(VBOX_GA_CERT_ROOT_SHA1),$(VBOX_PATH_ADDITIONS)/VBoxGuest.sys, \
121 extract-signer-root --self-signed-roots-from-system, 0)
122 ifdef VBOX_TSA_URL_ARGS
123 VBOX_GA_CERT_ROOT_SHA1_TS := vbox-sha1-timestamp-root.cer
124 $(evalcall2 def_VBoxAdditionsInstCertFiles,$(VBOX_GA_CERT_ROOT_SHA1_TS),$(VBOX_PATH_ADDITIONS)/VBoxGuest.sys, \
125 extract-timestamp-root --self-signed-roots-from-system, 0)
126 endif
127
128 $(evalcall2 def_VBoxAdditionsInstCertFiles,vbox-sha256.cer,$(VBOX_PATH_ADDITIONS)/VBoxGuest.sys, \
129 extract-exe-signer-cert, 1)
130 VBOX_GA_CERT_ROOT_SHA2 := vbox-sha256-root.cer
131 $(evalcall2 def_VBoxAdditionsInstCertFiles,$(VBOX_GA_CERT_ROOT_SHA2),$(VBOX_PATH_ADDITIONS)/VBoxGuest.sys, \
132 extract-signer-root --self-signed-roots-from-system, 1)
133 ifdef VBOX_TSA_SHA2_URL_ARGS
134 VBOX_GA_CERT_ROOT_SHA2_TS := vbox-sha256-timestamp-root.cer
135 $(evalcall2 def_VBoxAdditionsInstCertFiles,$(VBOX_GA_CERT_ROOT_SHA2_TS),$(VBOX_PATH_ADDITIONS)/VBoxGuest.sys, \
136 extract-timestamp-root --self-signed-roots-from-system, 1)
137 endif
138
139 if !$(intersects win, $(VBOX_WITH_CORP_CODE_SIGNING)) && $(intersects win_planb,$(VBOX_WITH_CORP_CODE_SIGNING))
140 $(evalcall2 def_VBoxAdditionsInstCertFiles,vbox-sha256-r3.cer,$(VBOX_PATH_ADDITIONS)/VBoxDrvInst.exe, \
141 extract-exe-signer-cert, 1)
142 VBOX_GA_CERT_ROOT_SHA2_R3 := vbox-sha256-r3-root.cer
143 $(evalcall2 def_VBoxAdditionsInstCertFiles,$(VBOX_GA_CERT_ROOT_SHA2_R3),$(VBOX_PATH_ADDITIONS)/VBoxDrvInst.exe, \
144 extract-signer-root --self-signed-roots-from-system, 1)
145 VBOX_GA_CERT_ROOT_SHA2_R3_TS := vbox-sha256-r3-timestamp-root.cer
146 $(evalcall2 def_VBoxAdditionsInstCertFiles,$(VBOX_GA_CERT_ROOT_SHA2_R3_TS),$(VBOX_PATH_ADDITIONS)/VBoxDrvInst.exe, \
147 extract-timestamp-root --self-signed-roots-from-system, 1)
148 endif
149 endif
150endif
151
152#
153# The installer.
154#
155PACKING += $(PATH_STAGE_BIN)/additions/VBoxWindowsAdditions-$(KBUILD_TARGET_ARCH).exe
156OTHER_CLEAN += $(PATH_STAGE_BIN)/additions/VBoxWindowsAdditions-$(KBUILD_TARGET_ARCH).exe
157
158VBOX_WINDOWS_ADDITIONS_ATTESTATION_SIGNED_FILES := \
159 $(PATH_STAGE_BIN)/additions/VBoxGuest.inf \
160 $(PATH_STAGE_BIN)/additions/VBoxGuest.sys \
161 $(PATH_STAGE_BIN)/additions/VBoxTray.exe \
162 $(PATH_STAGE_BIN)/additions/VBoxControl.exe \
163 \
164 $(PATH_STAGE_BIN)/additions/VBoxMouse.inf \
165 $(PATH_STAGE_BIN)/additions/VBoxMouse.sys \
166 \
167 $(PATH_STAGE_BIN)/additions/VBoxVideo.inf \
168 $(PATH_STAGE_BIN)/additions/VBoxVideo.sys \
169 $(PATH_STAGE_BIN)/additions/VBoxDisp.dll \
170 \
171 $(PATH_STAGE_BIN)/additions/VBoxSF.sys \
172 $(PATH_STAGE_BIN)/additions/VBoxMRXNP.dll
173
174ifeq ($(KBUILD_TARGET_ARCH),amd64) # 32-bit network provider DLLs for 32-bit apps running on a 64-bit system
175 VBOX_WINDOWS_ADDITIONS_ATTESTATION_SIGNED_FILES += \
176 $(PATH_STAGE_BIN)/additions/VBoxMRXNP-x86.dll
177endif
178
179ifeq ($(KBUILD_TARGET_ARCH),x86)
180 VBOX_WINDOWS_ADDITIONS_OTHER_FILES += \
181 $(PATH_STAGE_BIN)/additions/VBoxGuestEarlyNT.inf \
182 $(PATH_STAGE_BIN)/additions/VBoxVideoEarlyNT.inf
183endif
184
185if defined(VBOX_SIGNING_MODE) && defined(VBOX_SIGN_ADDITIONS)
186 VBOX_WINDOWS_ADDITIONS_OTHER_FILES += \
187 $(PATH_STAGE_BIN)/additions/VBoxVideo.cat \
188 $(PATH_STAGE_BIN)/additions/VBoxVideo-PreW10.cat \
189 $(PATH_STAGE_BIN)/additions/VBoxGuest.cat \
190 $(PATH_STAGE_BIN)/additions/VBoxGuest-PreW10.cat \
191 $(PATH_STAGE_BIN)/additions/VBoxMouse.cat \
192 $(PATH_STAGE_BIN)/additions/VBoxMouse-PreW10.cat
193 ifeq ($(KBUILD_TARGET_ARCH),x86)
194 VBOX_WINDOWS_ADDITIONS_OTHER_FILES += \
195 $(PATH_STAGE_BIN)/additions/VBoxGuestEarlyNT.cat \
196 $(PATH_STAGE_BIN)/additions/VBoxVideoEarlyNT.cat
197 endif
198endif
199
200VBOX_WINDOWS_ADDITIONS_OTHER_FILES := \
201 $(PATH_STAGE_BIN)/additions/VBoxService.exe \
202 $(PATH_STAGE_BIN)/additions/VBoxHook.dll \
203 $(PATH_STAGE_BIN)/additions/RegCleanup.exe
204
205ifeq ($(KBUILD_TARGET_ARCH),x86)
206 VBOX_WINDOWS_ADDITIONS_OTHER_FILES += \
207 $(PATH_STAGE_BIN)/additions/VBoxMouseNT.sys \
208 $(PATH_STAGE_BIN)/additions/VBoxSFW2K.sys
209endif
210
211ifdef VBOX_WITH_WDDM
212 VBOX_WINDOWS_ADDITIONS_ATTESTATION_SIGNED_FILES += \
213 $(PATH_STAGE_BIN)/additions/VBoxWddm.inf \
214 $(PATH_STAGE_BIN)/additions/VBoxWddm.sys \
215 $(PATH_STAGE_BIN)/additions/VBoxDispD3D.dll
216 ifeq ($(KBUILD_TARGET_ARCH),amd64)
217 VBOX_WINDOWS_ADDITIONS_ATTESTATION_SIGNED_FILES += \
218 $(PATH_STAGE_BIN)/additions/VBoxDispD3D-x86.dll
219 endif
220
221 ifdef VBOX_WITH_WDDM_DX
222 VBOX_WINDOWS_ADDITIONS_ATTESTATION_SIGNED_FILES += \
223 $(PATH_STAGE_BIN)/additions/VBoxDX.dll
224 ifeq ($(KBUILD_TARGET_ARCH),amd64)
225 VBOX_WINDOWS_ADDITIONS_ATTESTATION_SIGNED_FILES += \
226 $(PATH_STAGE_BIN)/additions/VBoxDX-x86.dll
227 endif
228 endif
229
230 ifdef VBOX_WITH_MESA3D
231 VBOX_WINDOWS_ADDITIONS_ATTESTATION_SIGNED_FILES += \
232 $(PATH_STAGE_BIN)/additions/VBoxNine.dll \
233 $(PATH_STAGE_BIN)/additions/VBoxSVGA.dll \
234 $(PATH_STAGE_BIN)/additions/VBoxGL.dll
235 ifeq ($(KBUILD_TARGET_ARCH),amd64)
236 VBOX_WINDOWS_ADDITIONS_ATTESTATION_SIGNED_FILES += \
237 $(PATH_STAGE_BIN)/additions/VBoxNine-x86.dll \
238 $(PATH_STAGE_BIN)/additions/VBoxSVGA-x86.dll \
239 $(PATH_STAGE_BIN)/additions/VBoxGL-x86.dll
240 endif
241 endif
242
243 if defined(VBOX_SIGNING_MODE) && defined(VBOX_SIGN_ADDITIONS)
244 VBOX_WINDOWS_ADDITIONS_OTHER_FILES += \
245 $(PATH_STAGE_BIN)/additions/VBoxWddm.cat \
246 $(PATH_STAGE_BIN)/additions/VBoxWddm-PreW10.cat
247 endif
248endif # VBOX_WITH_WDDM
249
250ifdef env.VBOX_WITH_ADDITIONS_SHIPPING_AUDIO_TEST
251 VBOX_WINDOWS_ADDITIONS_OTHER_FILES += \
252 $(PATH_STAGE_BIN)/additions/VBoxAudioTest.exe
253endif
254
255VBOX_WINDOWS_ADDITIONS_OTHER_FILES += $(addprefix $(PATH_STAGE_BIN)/additions/, \
256 $(VBOX_GA_CERT_ROOT_SHA1) \
257 $(VBOX_GA_CERT_ROOT_SHA1_TS) \
258 $(VBOX_GA_CERT_ROOT_SHA2) \
259 $(VBOX_GA_CERT_ROOT_SHA2_TS) \
260 $(VBOX_GA_CERT_ROOT_SHA2_R3) \
261 $(VBOX_GA_CERT_ROOT_SHA2_R3_TS))
262
263VB_WIN_ADD_NSIS_ENV := \
264 -E 'PATH_OUT=$(subst /,\,$(PATH_OUT))' \
265 -E 'PATH_TARGET=$(subst /,\,$(PATH_TARGET))' \
266 -E 'VBOX_VENDOR=$(VBOX_VENDOR)' \
267 -E 'VBOX_VENDOR_SHORT=$(VBOX_VENDOR_SHORT)' \
268 -E 'VBOX_PRODUCT=$(VBOX_PRODUCT)' \
269 -E 'VBOX_C_YEAR=$(VBOX_C_YEAR)' \
270 -E 'VBOX_VERSION_STRING=$(VBOX_VERSION_STRING)' \
271 -E 'VBOX_VERSION_STRING_RAW=$(VBOX_VERSION_STRING_RAW)' \
272 -E 'VBOX_VERSION_MAJOR=$(VBOX_VERSION_MAJOR)' \
273 -E 'VBOX_VERSION_MINOR=$(VBOX_VERSION_MINOR)' \
274 -E 'VBOX_VERSION_BUILD=$(VBOX_VERSION_BUILD)' \
275 -E 'VBOX_SVN_REV=$(VBOX_SVN_REV)' \
276 -E 'VBOX_WINDOWS_ADDITIONS_ICON_FILE=$(subst /,\,$(VBOX_WINDOWS_ADDITIONS_ICON_FILE))' \
277 -E 'VBOX_NSIS_ICON_FILE=$(subst /,\,$(VBOX_NSIS_ICON_FILE))' \
278 -E 'VBOX_WITH_GUEST_INSTALL_HELPER=$(if $(VBOX_WITH_GUEST_INSTALL_HELPER),1,0)' \
279 -E 'VBOX_WITH_GUEST_INSTALLER_UNICODE=$(if $(VBOX_WITH_GUEST_INSTALLER_UNICODE),1,0)' \
280 -E 'VBOX_WITH_ADDITIONS_SHIPPING_AUDIO_TEST=$(if $(VBOX_WITH_ADDITIONS_SHIPPING_AUDIO_TEST),1,0)' \
281 -E 'VBOX_WITH_LICENSE_INSTALL_RTF=$(if $(VBOX_BRAND_LICENSE_RTF),1,0)' \
282 -E 'VBOX_WITH_WDDM=$(if $(VBOX_WITH_WDDM),1,0)' \
283 -E 'VBOX_WITH_WDDM_DX=$(if $(VBOX_WITH_WDDM_DX),1,0)' \
284 -E 'VBOX_WITH_MESA3D=$(if $(VBOX_WITH_MESA3D),1,0)' \
285 -E 'VBOX_BRAND_WIN_ADD_INST_DLGBMP=$(subst /,\,$(VBOX_BRAND_WIN_ADD_INST_DLGBMP))' \
286 -E 'VBOX_BRAND_LICENSE_RTF=$(subst /,\,$(VBOX_BRAND_LICENSE_RTF))' \
287 $(foreach lang,$(VBOX_INSTALLER_ADD_LANGUAGES),-E 'VBOX_BRAND_$(lang)_LICENSE_RTF=$(VBOX_BRAND_$(lang)_LICENSE_RTF)') \
288 -E 'KBUILD_TYPE=$(KBUILD_TYPE)' \
289 -E 'KBUILD_TARGET_ARCH=$(KBUILD_TARGET_ARCH)' \
290 $(foreach base, VBOX_GA_CERT_ROOT_SHA1 VBOX_GA_CERT_ROOT_SHA2 VBOX_GA_CERT_ROOT_SHA2_R3 \
291 ,-E '$(base)=$(firstword $($(base)) none)' -E '$(base)_TS=$(firstword $($(base)_TS) none)')
292
293$(PATH_STAGE_BIN)/additions/VBoxWindowsAdditions-$(KBUILD_TARGET_ARCH).exe: \
294 $(PATH_SUB_CURRENT)/VBoxGuestAdditions.nsi \
295 $(PATH_SUB_CURRENT)/VBoxGuestAdditionsCommon.nsh \
296 $(PATH_SUB_CURRENT)/VBoxGuestAdditionsExternal.nsh \
297 $(PATH_SUB_CURRENT)/VBoxGuestAdditionsLog.nsh \
298 $(PATH_SUB_CURRENT)/VBoxGuestAdditionsUninstall.nsh \
299 $(PATH_SUB_CURRENT)/VBoxGuestAdditionsUninstallOld.nsh \
300 $(PATH_SUB_CURRENT)/VBoxGuestAdditionsNT4.nsh \
301 $(PATH_SUB_CURRENT)/VBoxGuestAdditionsW2KXP.nsh \
302 $(PATH_SUB_CURRENT)/VBoxGuestAdditionsVista.nsh \
303 $(PATH_SUB_CURRENT)/dumplog.nsh \
304 $(PATH_SUB_CURRENT)/ReplaceDLL.nsh \
305 $(PATH_SUB_CURRENT)/servicepack.nsh \
306 $(PATH_SUB_CURRENT)/strstr.nsh \
307 $(PATH_SUB_CURRENT)/winver.nsh \
308 $(PATH_SUB_CURRENT)/Languages/English.nsh \
309 $(PATH_SUB_CURRENT)/Languages/German.nsh \
310 $(PATH_SUB_CURRENT)/Languages/French.nsh \
311 $(VBOX_WINDOWS_ADDITIONS_ATTESTATION_SIGNED_FILES) \
312 $(VBOX_WINDOWS_ADDITIONS_OTHER_FILES) \
313 $(VBOX_WINDOWS_ADDITIONS_ICON_FILE) \
314 $(VBOX_NSIS_ICON_FILE) \
315 $(if $(VBOX_SIGNING_MODE),$(PATH_TARGET)/uninst.exe) \
316 $(if $(VBOX_WIN_ATTESTATION_SIGNING),$(PATH_OUT)/repackadd/$(VBOX_SIGNED_DRIVERS_ZIP_NAME)) \
317 $(VBOX_VERSION_STAMP) \
318 $$(VBoxDrvInst_1_STAGE_TARGET) \
319 | $(VBOX_SIGN_IMAGE_ORDERDEPS)
320 $(call MSG_L1,Creating $@, from $<)
321ifdef VBOX_WIN_ATTESTATION_SIGNING # Unpack the attestation signed drivers - this is an ugly as 'ing heck hack!
322 $(TOOL_ZIP_UNPACK) -oj $(PATH_OUT)/repackadd/$(VBOX_SIGNED_DRIVERS_ZIP_NAME) -d $(PATH_STAGE_BIN)/additions/
323endif
324 $(REDIRECT) -C $(VBOX_PATH_WIN_ADD_INS_SRC) \
325 $(VB_WIN_ADD_NSIS_ENV) \
326 -- $(EXEC_X86_WIN32) $(VBOX_PATH_NSIS)/makensis.exe /NOCD /V2 \
327 $(if $(VBOX_SIGNING_MODE),'/DEXTERNAL_UNINSTALLER=1') \
328 $(if-expr defined(VBOX_SIGN_ADDITIONS) && defined(VBOX_SIGNING_MODE), \
329 '/DVBOX_SIGN_ADDITIONS=1' \
330 $(if-expr defined(VBOX_WITH_VBOX_LEGACY_TS_CA),'/DVBOX_WITH_VBOX_LEGACY_TS_CA=1') \
331 ,) \
332 $(if $(VBOX_INSTALLER_ADD_LANGUAGES),'/DVBOX_INSTALLER_ADD_LANGUAGES=1') \
333 $(foreach lang,$(VBOX_INSTALLER_ADD_LANGUAGES),'/DVBOX_BRAND_$(lang)_LICENSE_RTF=1') \
334 '$(subst /,\,$<)'
335 $(call VBOX_SIGN_IMAGE_FN,$@)
336
337
338ifdef VBOX_SIGNING_MODE
339 #
340 # This is a hack to sign the uninstaller.
341 # See http://nsis.sourceforge.net/Signing_an_Uninstaller for more details.
342 #
343 OTHER_CLEAN += \
344 $(PATH_TARGET)/VBoxWindowsAdditions-$(KBUILD_TARGET_ARCH)-uninst.exe \
345 $(PATH_TARGET)/uninst.exe
346 $(PATH_TARGET)/VBoxWindowsAdditions-$(KBUILD_TARGET_ARCH)-uninst.exe: \
347 $(PATH_SUB_CURRENT)/VBoxGuestAdditions.nsi \
348 $(PATH_SUB_CURRENT)/VBoxGuestAdditionsCommon.nsh \
349 $(PATH_SUB_CURRENT)/VBoxGuestAdditionsExternal.nsh \
350 $(PATH_SUB_CURRENT)/VBoxGuestAdditionsLog.nsh \
351 $(PATH_SUB_CURRENT)/VBoxGuestAdditionsUninstall.nsh \
352 $(PATH_SUB_CURRENT)/VBoxGuestAdditionsNT4.nsh \
353 $(PATH_SUB_CURRENT)/VBoxGuestAdditionsW2KXP.nsh \
354 $(PATH_SUB_CURRENT)/VBoxGuestAdditionsVista.nsh \
355 $(PATH_SUB_CURRENT)/dumplog.nsh \
356 $(PATH_SUB_CURRENT)/ReplaceDLL.nsh \
357 $(PATH_SUB_CURRENT)/servicepack.nsh \
358 $(PATH_SUB_CURRENT)/strstr.nsh \
359 $(PATH_SUB_CURRENT)/winver.nsh \
360 $(PATH_SUB_CURRENT)/Languages/English.nsh \
361 $(PATH_SUB_CURRENT)/Languages/German.nsh \
362 $(PATH_SUB_CURRENT)/Languages/French.nsh \
363 $(VBOX_WINDOWS_ADDITIONS_ATTESTATION_SIGNED_FILES) \
364 $(VBOX_WINDOWS_ADDITIONS_OTHER_FILES) \
365 $(VBOX_WINDOWS_ADDITIONS_ICON_FILE) \
366 $(VBOX_NSIS_ICON_FILE) \
367 $(VBOX_VERSION_STAMP) \
368 $$(VBoxDrvInst_1_STAGE_TARGET) \
369 | $$(dir $$@)
370 $(call MSG_L1,Creating $@, from $<)
371 $(QUIET)$(REDIRECT) -C $(VBOX_PATH_WIN_ADD_INS_SRC) \
372 $(VB_WIN_ADD_NSIS_ENV) \
373 -- $(EXEC_X86_WIN32) $(VBOX_PATH_NSIS)/makensis.exe /NOCD /V2 \
374 $(if $(VBOX_SIGN_ADDITIONS),'/DVBOX_SIGN_ADDITIONS=1') \
375 $(if $(VBOX_WITH_VBOX_LEGACY_TS_CA),'/DVBOX_WITH_VBOX_LEGACY_TS_CA=1') \
376 $(if $(VBOX_INSTALLER_ADD_LANGUAGES),'/DVBOX_INSTALLER_ADD_LANGUAGES=1') \
377 $(foreach lang,$(VBOX_INSTALLER_ADD_LANGUAGES),'/DVBOX_BRAND_$(lang)_LICENSE_RTF=1') \
378 '/DUNINSTALLER_ONLY=1' \
379 '$(subst /,\,$<)'
380
381 $(PATH_TARGET)/uninst.exe: \
382 $(PATH_TARGET)/VBoxWindowsAdditions-$(KBUILD_TARGET_ARCH)-uninst.exe | $$(dir $$@) $(VBOX_SIGN_IMAGE_ORDERDEPS)
383 $(call MSG_L1,Creating $@, from $<)
384 $(QUIET)$(RM) -f $@
385 -$(REDIRECT) -E __COMPAT_LAYER=RUNASINVOKER -- $<
386 $(TEST) -f $@
387 $(call VBOX_SIGN_IMAGE_FN,$@)
388
389endif # VBOX_SIGNING_MODE
390
391
392if defined(VBOX_WIN_ATTESTATION_SIGNING) && defined(VBOX_SIGNING_MODE) && defined(VBOX_SIGN_ADDITIONS)
393 #
394 # This automagically attestation signs the GA drivers.
395 #
396 $(PATH_OUT)/repackadd/$(VBOX_SIGNED_DRIVERS_ZIP_NAME): \
397 $(PATH_OUT)/repackadd/$(VBOX_DRIVERS_PACK_NAME)
398 $(RM_EXT) -f $(PATH_OUT)/repackadd/*.zip
399 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)"
400
401 #
402 # This creates a .CAB file of the driver files that should be attestation signed.
403 #
404 $(PATH_OUT)/repackadd/$(VBOX_DRIVERS_PACK_NAME): \
405 $(PATH_OUT)/repackadd/PackDriversForSubmission.cmd \
406 # $(VBOX_WINDOWS_ADDITIONS_ATTESTATION_SIGNED_FILES) - is is unsafe, because of the 'ing ugly hack replacing most of them above during packing.
407 $(RM_EXT) -f $(PATH_OUT)/repackadd/*.cab
408 $(RM_EXT) -f $(PATH_OUT)/repackadd/*.ddf
409 $(RM_EXT) -f $(PATH_OUT)/repackadd/*.inf
410 $(RM_EXT) -f $(PATH_OUT)/repackadd/*.rpt
411 $(EXEC_X86_WIN32) cmd /c $(PATH_OUT)/repackadd/PackDriversForSubmission.cmd -b $(PATH_STAGE_BIN) -a $(KBUILD_TARGET_ARCH) \
412 -x -n --no-main --ga -o $(PATH_OUT)/repackadd/$(VBOX_DRIVERS_PACK_NAME)
413 $(call VBOX_SIGN_EV_FILE_FN,$@)
414endif # VBOX_WIN_ATTESTATION_SIGNING && VBOX_SIGNING_MODE && VBOX_SIGN_ADDITIONS
415
416
417#
418# Repackaging scripts and files.
419#
420INSTALLS += RePackScriptsAdd
421RePackScriptsAdd_TEMPLATE = DUMMY
422RePackScriptsAdd_INST = repackadd/
423RePackScriptsAdd_INSTTYPE = stage
424RePackScriptsAdd_SOURCES = \
425 ../../../Installer/win/Scripts/UnpackBlessedDrivers.cmd \
426 $(RePackScriptsAdd_0_OUTDIR)/PackDriversForSubmission.cmd \
427 $(RePackScriptsAdd_0_OUTDIR)/Combined-1-Prepare.cmd \
428 $(RePackScriptsAdd_0_OUTDIR)/Combined-3-RepackAdditions.cmd \
429 $(RePackScriptsAdd_0_OUTDIR)/sign-ev.cmd
430RePackScriptsAdd_CLEAN = \
431 $(RePackScriptsAdd_0_OUTDIR)/sign-ev.cmd
432
433ifndef VBOX_OSE
434 RePackScriptsAdd_SOURCES += \
435 $(RePackScriptsAdd_0_OUTDIR)/Combined-0-Additions.cmd \
436 $(RePackScriptsAdd_0_OUTDIR)/Combined-2-SignAdditions.cmd
437endif
438
439$(call VBOX_EDIT_VERSION_AND_BUILD_RULE_FN,RePackScriptsAdd,../../../Installer/win/Scripts/PackDriversForSubmission.cmd,PackDriversForSubmission.cmd)
440$(call VBOX_EDIT_VERSION_AND_BUILD_RULE_FN,RePackScriptsAdd,../../../Installer/win/Scripts/Combined-1-Prepare.cmd,Combined-1-Prepare.cmd)
441ifndef VBOX_OSE
442 $(call VBOX_EDIT_VERSION_AND_BUILD_RULE_FN,RePackScriptsAdd,../../../Installer/win/Scripts/Combined-0-Additions.cmd,Combined-0-Additions.cmd)
443 $(call VBOX_EDIT_VERSION_AND_BUILD_RULE_FN,RePackScriptsAdd,../../../Installer/win/Scripts/Combined-2-SignAdditions.cmd,Combined-2-SignAdditions.cmd)
444endif
445$(call VBOX_EDIT_VERSION_AND_BUILD_RULE_FN,RePackScriptsAdd,../../../Installer/win/Scripts/Combined-3-RepackAdditions.cmd,Combined-3-RepackAdditions.cmd)
446
447# The %~dp1\ oddity is working around otherwise ending with \" during
448# expansion of the CCS command line which for a reason I cannot immediately
449# understand appends a " to the path.
450$$(RePackScriptsAdd_0_OUTDIR)/sign-ev.cmd: | $$(dir $$@)
451 $(APPEND) -nt "$@" \
452 'if ".%KBUILD_DEVTOOLS%" == "." (echo KBUILD_DEVTOOLS is not set & exit /b 1)' \
453 'if ".%KBUILD_BIN_PATH%" == "." (echo KBUILD_BIN_PATH is not set & exit /b 1)' \
454 'if ".%1" == "." (echo No .cab file specified & exit /b 1)' \
455 $(subst $(KBUILD_BIN_PATH),%KBUILD_BIN_PATH%,$(subst $(KBUILD_DEVTOOLS),%KBUILD_DEVTOOLS%, \
456 '( $(call VBOX_SIGN_EV_FILE_FN,%1,%~dp1\) ) || exit /b1' \
457 ) )
458
459#
460# Repacking resources.
461#
462INSTALLS += RePackScriptsAddResources
463RePackScriptsAddResources_TEMPLATE = DUMMY
464RePackScriptsAddResources_INST = repackadd/resources/
465RePackScriptsAddResources_INSTTYPE = stage
466RePackScriptsAddResources_DIRS = Languages
467RePackScriptsAddResources_SOURCES = \
468 welcome.bmp \
469 $(VBOX_WINDOWS_ADDITIONS_ICON_FILE)=>VirtualBoxGA-vista.ico \
470 $(VBOX_NSIS_ICON_FILE)=>VirtualBoxGA-nsis.ico \
471 $(PATH_ROOT)/doc/License-gpl-3.0.rtf \
472 VBoxGuestAdditions.nsi \
473 dumplog.nsh \
474 ReplaceDLL.nsh \
475 servicepack.nsh \
476 strstr.nsh \
477 VBoxGuestAdditionsCommon.nsh \
478 VBoxGuestAdditionsExternal.nsh \
479 VBoxGuestAdditionsLog.nsh \
480 VBoxGuestAdditionsNT4.nsh \
481 VBoxGuestAdditionsUninstall.nsh \
482 VBoxGuestAdditionsUninstallOld.nsh \
483 VBoxGuestAdditionsVista.nsh \
484 VBoxGuestAdditionsW2KXP.nsh \
485 winver.nsh \
486 ISO/AUTORUN.INF \
487 ISO/NT3xReadme.txt \
488 \
489 Languages/English.nsh=>Languages/English.nsh \
490 Languages/French.nsh=>Languages/French.nsh \
491 Languages/German.nsh=>Languages/German.nsh
492
493
494#
495# NT3.x installer.
496#
497# Just for fun, this one does not use the CRT more than it really really needs
498# to. This saves space and avoid compatiblity issues, it also makes for a
499# fun challenge.
500#
501PROGRAMS.win.x86 += VBoxAddInstallNt3x
502ifdef VBOX_WITH_NOCRT_STATIC
503 ## @todo noCRT: the result is much too big. Got rid of log.cpp, but still pretty big. Work on reducing it.
504 VBoxAddInstallNt3x_TEMPLATE := VBoxGuestR3Exe
505else
506 VBoxAddInstallNt3x_TEMPLATE := VBoxGuestR3NoCrtExe
507endif
508VBoxAddInstallNt3x_SOURCES := VBoxAddInstallNt3x.cpp
509VBoxAddInstallNt3x.cpp_DEPS = $(VBOX_SVN_REV_HEADER)
510
511
512include $(FILE_KBUILD_SUB_FOOTER)
513
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