VirtualBox

source: vbox/trunk/src/VBox/Installer/win/Makefile.kmk@ 99678

Last change on this file since 99678 was 99678, checked in by vboxsync, 19 months ago

Windows base package: adding attestation signing

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 66.1 KB
Line 
1# $Id: Makefile.kmk 99678 2023-05-08 16:38:57Z vboxsync $
2## @file
3# Makefile for the Windows installer.
4#
5
6#
7# Copyright (C) 2006-2023 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
31ifneq ($(KBUILD_HOST),win)
32 $(error "The Windows installer can only be built on Windows!")
33endif
34
35
36#
37# Include Sub-Makefiles.
38#
39include $(PATH_SUB_CURRENT)/InstallHelper/Makefile.kmk
40
41include $(PATH_SUB_CURRENT)/Stub/Makefile.kmk
42include $(PATH_SUB_CURRENT)/StubBld/Makefile.kmk
43include $(PATH_SUB_CURRENT)/Resources/Makefile.kmk
44ifdef VBOX_WITH_MSI_HACK
45 include $(PATH_SUB_CURRENT)/MsiHack/Makefile.kmk
46endif
47
48#
49# Profile for quickly testing the actual mechanisms of our installer.
50# This leaves out most of the optional stuff to make compilation / linking much
51# faster for development cycles. Tweak to your likings if needed.
52#
53# Note! Rather hacky approach -- this *only* works when 'packing' is executed
54# directly in the VBox\Installer directory; otherwise with WILL break the
55# build mostly likely, as we mess with dependencies between components.
56#
57# A better appraoch would be to define separate packing defines for dependencies
58# to decouple the building process from the packing more in such a scenario.
59#
60# Use with care!
61#
62ifdef VBOX_INSTALLER_QUICK
63 VBOX_INSTALLER_LANGUAGES := en_US
64 VBOX_WITH_LICENSE_DISPLAY :=
65 VBOX_WITH_SERIALNUMBER_INSTALL :=
66 VBOX_WITH_ADDITIONS_PACKING :=
67 VBOX_WITH_DEBUGGER_GUI :=
68 VBOX_WITH_EFIFW_PACKING :=
69 VBOX_WITH_EXTPACK :=
70 VBOX_WITH_NETADP :=
71 VBOX_WITH_NETFLT :=
72 VBOX_WITH_PYTHON :=
73 VBOX_WITH_SDS :=
74 VBOX_WITH_WEBSERVICES :=
75 VBOX_WITH_UNATTENDED :=
76 VBOX_WITH_DOCS_PACKING :=
77 VBOX_WITH_QTGUI :=
78 VBOX_WITH_USB :=
79 VBOX_WITH_VBOX_IMG :=
80 VBOX_WITH_VBOXSDL :=
81 VBOX_CAB_COMPRESSION_LEVEL := none
82endif
83
84#
85# Globals.
86#
87# Tip: Use VBOX_CAB_COMPRESSION_LEVEL=none on the kmk command line when working
88# on the installer.
89#
90VBOX_WIN_INST_MAKEFILE_DEP := $(MAKEFILE_CURRENT)
91ifndef VBOX_CAB_COMPRESSION_LEVEL
92 VBOX_CAB_COMPRESSION_LEVEL := high
93endif
94
95VBOX_PATH_WIN_INST_SRC := $(PATH_SUB_CURRENT)
96VBOX_WIN_INST_OUT_DIR := $(PATH_TARGET)/Installer/win
97VBOX_WIN_INST_REPACK_DIR := $(PATH_OUT)/repack
98
99# Note: en_US *must* come first for the dependency file generation.
100ifndef VBOX_INSTALLER_LANGUAGES
101 VBOX_INSTALLER_LANGUAGES = en_US de_DE el_GR fr_FR it_IT tr_TR zh_TW zh_CN
102 VBOX_INSTALLER_LANGUAGES += $(VBOX_INSTALLER_ADD_LANGUAGES)
103endif
104
105# Aliases for VBOX_SIGN_FILE_FN that allows better control of the MSI and MSM signing.
106VBOX_SIGN_MSI_FN ?= $(VBOX_SIGN_FILE_FN)
107VBOX_SIGN_MSM_FN ?= $(VBOX_SIGN_FILE_FN)
108VBOX_SIGN_CAB_FN ?= $(VBOX_SIGN_FILE_FN)
109
110#
111# List of merge modules to use.
112#
113ifndef VBOX_INSTALLER_MERGE_MODULES
114 VBOX_INSTALLER_MERGE_MODULES = App
115 ifdef VBOX_WITH_NETADP
116 VBOX_INSTALLER_MERGE_MODULES += NetAdp NetAdp6
117 endif
118 ifdef VBOX_WITH_NETFLT
119 VBOX_INSTALLER_MERGE_MODULES += NetLwf NetFlt
120 endif
121 ifdef VBOX_WITH_USB
122 VBOX_INSTALLER_MERGE_MODULES += USB
123 endif
124 ifdef VBOX_WITH_PYTHON
125 VBOX_INSTALLER_MERGE_MODULES += Python
126 endif
127endif
128ifeq ($(KBUILD_TARGET_ARCH),amd64)
129 VBOX_INSTALLER_MERGE_MODULES += COM32On64
130endif
131
132# We only ship the merge modules in locale en_US for the moment.
133ifdef VBOX_WITH_MSM_INSTALL
134 VBOX_INSTALLER_LANGUAGES := en_US
135 VBOX_INSTALLER_MERGE_LANGUAGES = $(VBOX_INSTALLER_LANGUAGES)
136endif
137
138#
139# Language IDs (LCID, decimal)
140#
141VBOX_BRAND_en_US_LANG_ID ?= 1033
142VBOX_BRAND_de_DE_LANG_ID ?= 1031
143VBOX_BRAND_el_GR_LANG_ID ?= 1032
144VBOX_BRAND_fa_IR_LANG_ID ?= 1065
145VBOX_BRAND_fr_FR_LANG_ID ?= 1036
146VBOX_BRAND_it_IT_LANG_ID ?= 1040
147VBOX_BRAND_tr_TR_LANG_ID ?= 1055
148VBOX_BRAND_zh_TW_LANG_ID ?= 1028
149VBOX_BRAND_zh_CN_LANG_ID ?= 2052
150
151# Standard language names (in the native language), to be extended as we go.
152# VBOX_BRAND_$(lang)_LANG_NAME must be defined for each language which occurs
153# in either VBOX_LICENSE_ADD_LANGUAGES or VBOX_MANUAL_ADD_LANGUAGES.
154VBOX_BRAND_en_US_LANG_NAME := English
155VBOX_BRAND_de_DE_LANG_NAME := Deutsch
156VBOX_BRAND_el_GR_LANG_NAME := Ελληνικά
157VBOX_BRAND_fr_FR_LANG_NAME := Français
158VBOX_BRAND_it_IT_LANG_NAME := Italiano
159VBOX_BRAND_tr_TR_LANG_NAME := Türkçe
160VBOX_BRAND_zh_TW_LANG_NAME := 正體中文
161VBOX_BRAND_zh_CN_LANG_NAME := 简体中文
162
163
164#
165# We don't have the license text in another language than English yet,
166# so just define the branding targets to use the English one for now.
167# The installer generation assumes that there is a translation for each
168# of VBOX_INSTALLER_LANGUAGES.
169#
170$(foreach lang,$(VBOX_INSTALLER_LANGUAGES), \
171 $(eval VBOX_BRAND_$(lang)_LICENSE_RTF := $(VBOX_BRAND_LICENSE_RTF)))
172
173#
174# Set the codepage for all languages to 1252, covers most cases.
175#
176$(foreach lang,$(sort $(VBOX_INSTALLER_LANGUAGES) $(VBOX_LICENSE_ADD_LANGUAGES) $(VBOX_MANUAL_ADD_LANGUAGES)), \
177 $(eval VBOX_BRAND_$(lang)_LANGUAGE_CODEPAGE := 1252))
178# Exceptions:
179VBOX_BRAND_zh_TW_LANGUAGE_CODEPAGE := 950
180VBOX_BRAND_zh_CN_LANGUAGE_CODEPAGE := 936
181VBOX_BRAND_fa_IR_LANGUAGE_CODEPAGE := 1256
182VBOX_BRAND_tr_TR_LANGUAGE_CODEPAGE := 1254
183
184#
185# If we want to build a combined package, we separate all common stuff
186# (that is all 100% identical content between 32-/64-bit builds)
187# into an own .cab file to save space. This .cab file then gets included
188# and used by the 32-/64-bit installers.
189#
190ifdef VBOX_WITH_COMBINED_PACKAGE
191 VBOX_INSTALLER_COMMON_DISKID := 2
192else
193 VBOX_INSTALLER_COMMON_DISKID := 1
194endif
195
196## @todo VBOX_ prefixes!
197PACKAGE_BASE := VirtualBox-$(VBOX_VERSION_STRING)
198PACKAGE_NAME_LANG := $(PACKAGE_BASE)-r$(VBOX_SVN_REV)
199PACKAGE_NAME_FINAL := $(PATH_STAGE_BIN)/$(PACKAGE_NAME_LANG).msi
200
201ifdef VBOX_WITH_COMBINED_PACKAGE
202 PATH_MULTIARCH_TEMP := $(PATH_OUT_BASE)/win.x86/$(KBUILD_TYPE)/obj/Installer
203 PATH_MULTIARCH_GUEST_ADDITIONS_ISO := $(PATH_OUT_BASE)/win.amd64/$(KBUILD_TYPE)/bin/additions
204 PACKAGE_NAME_MULTIARCH := $(PACKAGE_NAME_LANG)-MultiArch
205 PACKAGE_NAME_MULTIARCH.x86 := $(PACKAGE_NAME_MULTIARCH)_x86.msi
206 PACKAGE_NAME_MULTIARCH.amd64 := $(PACKAGE_NAME_MULTIARCH)_amd64.msi
207 PACKAGE_NAME_FINAL := $(PATH_MULTIARCH_TEMP)/$(PACKAGE_NAME_MULTIARCH.$(KBUILD_TARGET_ARCH))
208 PACKAGE_NAME_MULTIARCH_FINAL := $(PACKAGE_NAME_MULTIARCH).exe
209 # Always take the common.cab from the amd64 build, as it
210 # might contain certain files for x86 compatibility such
211 # as our 32-on-64-bit COM stuff.
212 PACKAGE_NAME_MULTIARCH_COMMONCAB := $(PATH_OUT_BASE)/win.amd64/$(KBUILD_TYPE)/obj/Installer/win/common.cab
213
214 BLDDIRS += $(PATH_MULTIARCH_TEMP)
215 PACKING += $(PACKAGE_NAME_FINAL)
216 ifeq ($(KBUILD_TARGET_ARCH),x86)
217 PACKING += $(PATH_STAGE_BIN)/$(PACKAGE_NAME_MULTIARCH_FINAL)
218 endif
219else
220 PACKAGE_NAME_MULTIARCH := $(PACKAGE_NAME_LANG)-MultiArch
221 PACKAGE_NAME_MULTIARCH_FINAL := $(PACKAGE_NAME_MULTIARCH).exe
222 PACKING += $(PACKAGE_NAME_FINAL) $(PATH_STAGE_BIN)/$(PACKAGE_NAME_MULTIARCH_FINAL)
223endif
224BLDDIRS += \
225 $(VBOX_WIN_INST_OUT_DIR) \
226 $(VBOX_WIN_INST_REPACK_DIR)/ \
227 $(foreach lang,$(VBOX_INSTALLER_LANGUAGES), \
228 $(VBOX_WIN_INST_OUT_DIR)/$(lang)/ \
229 $(VBOX_WIN_INST_REPACK_DIR)/files-VirtualBox_$(lang)/ ) \
230 $(VBOX_WIN_INST_OUT_DIR)/NLS/
231
232OTHER_CLEAN += \
233 $(VBOX_WIN_INST_OUT_DIR)/VirtualBox.wixobj \
234 $(VBOX_WIN_INST_OUT_DIR)/VirtualBox.wix \
235 $(VBOX_WIN_INST_REPACK_DIR)/VirtualBox.wix \
236 $(VBOX_WIN_INST_OUT_DIR)/VirtualBox.wixobj.dep \
237 $(VBOX_WIN_INST_OUT_DIR)/VirtualBox_TypeLib.wxi \
238 $(VBOX_WIN_INST_OUT_DIR)/VirtualBox_TypeLib_x86.wxi \
239 $(VBOX_WIN_INST_OUT_DIR)/VirtualBox_ProxyStub.wxi \
240 $(if $(VBOX_WITH_QTGUI),$(VBOX_WIN_INST_OUT_DIR)/VBoxGuiNLS.wxi) \
241 $(VBOX_WIN_INST_OUT_DIR)/VBoxKey.wxi \
242 $(VBOX_WIN_INST_OUT_DIR)/VBoxUnattendedTemplateComponent.wxi \
243 $(foreach lang,$(VBOX_INSTALLER_LANGUAGES), \
244 $(VBOX_WIN_INST_OUT_DIR)/NLS/Language_$(lang).wxl \
245 $(VBOX_WIN_INST_OUT_DIR)/NLS/License_$(lang).wxl \
246 $(VBOX_WIN_INST_OUT_DIR)/$(lang)/$(lang).mst \
247 $(VBOX_WIN_INST_OUT_DIR)/$(lang)/$(PACKAGE_NAME_LANG)_$(lang).wixpdb \
248 $(VBOX_WIN_INST_OUT_DIR)/$(lang)/$(PACKAGE_NAME_LANG)_$(lang).msi \
249 $(VBOX_WIN_INST_OUT_DIR)/$(lang)/VirtualBox_$(lang).wix \
250 $(VBOX_WIN_INST_OUT_DIR)/$(lang)/VirtualBox_$(lang).wixobj \
251 $(VBOX_WIN_INST_OUT_DIR)/$(lang)/VirtualBox_$(lang).wixobj.dep \
252 $(VBOX_WIN_INST_REPACK_DIR)/VirtualBox_$(lang).wix \
253 $(VBOX_WIN_INST_REPACK_DIR)/VirtualBox_$(lang).files \
254 $(VBOX_WIN_INST_REPACK_DIR)/2-link-$(PACKAGE_NAME_LANG).cmd \
255 $(VBOX_WIN_INST_REPACK_DIR)/files-VirtualBox_$(lang)/Language_$(lang).wxl \
256 $(VBOX_WIN_INST_REPACK_DIR)/files-VirtualBox_$(lang)/License_$(lang).wxl ) \
257 $(VBOX_WIN_INST_OUT_DIR)/DirComponentsAndFiles_DTrace.wxi \
258 $(VBOX_WIN_INST_OUT_DIR)/Files_Main.wxi \
259 $(VBOX_WIN_INST_OUT_DIR)/Files_Doc.wxi \
260 $(VBOX_WIN_INST_OUT_DIR)/Files_License.wxi \
261 $(VBOX_WIN_INST_OUT_DIR)/Shortcuts_StartMenu.wxi \
262 $(VBOX_WIN_INST_OUT_DIR)/$(PACKAGE_NAME_LANG).msi \
263 $(VBOX_WIN_INST_REPACK_DIR)/3-multilingual-$(PACKAGE_NAME_LANG).cmd \
264 $(PATH_STAGE_BIN)/$(PACKAGE_NAME_MULTIARCH_FINAL)
265
266ifdef VBOX_WITH_COMBINED_PACKAGE
267 ifeq ($(KBUILD_TARGET_ARCH),x86)
268 OTHER_CLEAN += \
269 $(VBOX_WIN_INST_REPACK_DIR)/4-multiarch-$(PACKAGE_NAME_MULTIARCH_FINAL).cmd \
270 $(PATH_MULTIARCH_TEMP)/$(PACKAGE_NAME_MULTIARCH.x86)
271 endif
272 ifndef VBOX_WITH_MSM_INSTALL
273 OTHER_CLEAN += \
274 $(VBOX_WIN_INST_OUT_DIR)/common.cab
275 endif
276else
277 OTHER_CLEAN += \
278 $(VBOX_WIN_INST_REPACK_DIR)/4-multiarch-$(PACKAGE_NAME_MULTIARCH_FINAL).cmd \
279 $(PACKAGE_NAME_FINAL)
280endif
281
282ifdef VBOX_WITH_MSM_INSTALL
283 OTHER_CLEAN += \
284 $(foreach module,$(VBOX_INSTALLER_MERGE_MODULES), \
285 $(foreach lang,$(VBOX_INSTALLER_MERGE_LANGUAGES), \
286 $(VBOX_WIN_INST_OUT_DIR)/VBoxMerge$(module)_$(lang)_$(KBUILD_TARGET_ARCH).msm \
287 $(VBOX_WIN_INST_OUT_DIR)/VBoxMerge$(module)_$(lang).wixobj \
288 $(VBOX_WIN_INST_OUT_DIR)/VBoxMerge$(module)_$(lang).wixobj.dep \
289 $(VBOX_WIN_INST_OUT_DIR)/VBoxMerge$(module)_$(lang).wixpdb \
290 $(VBOX_WIN_INST_REPACK_DIR)/VBoxMerge$(module)_$(lang).wix \
291 $(VBOX_WIN_INST_REPACK_DIR)/VBoxMerge$(module)_$(lang).files)
292 BLDDIRS += $foreach lang,$(VBOX_INSTALLER_MERGE_LANGUAGES), \
293 $(VBOX_WIN_INST_REPACK_DIR)/files-VBoxMerge$(module)_$(lang)/)
294endif
295
296#
297# Suppress/skip the following ICE (Internal Consistency Evaluators):
298# - ICE64: Checks that new directories in the user profile are removed correctly in roaming scenarios.
299# -> We don't want to remove system folders (like "Microsoft/Internet Explorer/Quick Launch").
300# - ICE69: Checks if file references are within the same component.
301# -> We reference to files within different components, but these components are installed using
302# the same feature, so that's fine.
303#
304VBOX_MSI_ICE_IGNORE := \
305 -ice:64 \
306 -ice:69
307
308#
309# Create intermediate XML file for languages (needed for .MSI linking).
310#
311# Note: The double escaping of $(dir $@) in the prereq/dep list is because we first have
312# to escape the expansion of the $(eval ) argument and then the definition of the
313# rule. The statement is finally expanded during second dependency expansion, which
314# takes place after all makefiles has been loaded and with the @ variable defined.
315#
316define def_vbox_lang_xml
317 $(VBOX_WIN_INST_OUT_DIR)/NLS/Language_$(lang).wxl: $(VBOX_PATH_WIN_INST_SRC)/NLS/$(lang).wxl | $$$$(dir $$$$@)
318 $$(call MSG_GENERATE,,$$@,$$<)
319 $(QUIET)$(INSTALL) -m 0644 $$< $$@
320endef
321
322$(foreach lang,$(VBOX_INSTALLER_LANGUAGES), \
323 $(eval $(def_vbox_lang_xml)))
324
325#
326# Create intermediate XML file for licenses (needed for .MSI linking).
327# These files are created from the original .RTF files in the /docs directory.
328#
329# Note: The redirect command below will open $$@ as stdout in append+text mode
330# and then exec cat, thus appending the license file to the result file.
331#
332# Note: The license_file variable has to be created before def_vbox_license_xml
333# is expanded by the 2nd eval because we rely on the that expansion
334# replacing all $(license_file) (and $(lang)) references before evaluation.
335#
336# Note: The REDIRECT + ECHO_EXT is because WiX gets upset if there a newline
337# between the tag and the RTF license text.
338#
339define def_vbox_license_xml
340 $(VBOX_WIN_INST_OUT_DIR)/NLS/License_$(lang).wxl: $(license_file) $(VBOX_WIN_INST_MAKEFILE_DEP) | $$$$(dir $$$$@)
341 $$(call MSG_GENERATE,,$$@,$$<)
342 $(APPEND) -t $$@ '<?xml version="1.0" encoding="utf-8"?>'
343 $(APPEND) $$@ '<WixLocalization xmlns="http://schemas.microsoft.com/wix/2006/localization" Codepage="$(VBOX_BRAND_$(lang)_LANGUAGE_CODEPAGE)" Culture="$(lang)">'
344
345 $(REDIRECT) -a+to $$@ -- $(ECHO_EXT) -n '<String Id="LicenseText">'
346 $(REDIRECT) -a+to $$@ -- $(SED) -e "s|<|\&lt;|g" -e "s|>|\&gt;|g" $(license_file)
347 $(APPEND) $$@ '</String>'
348
349 $(APPEND) $$@ '<String Id="LicenseFile">$(license_file)</String>'
350 $(APPEND) $$@ '<String Id="LicenseInstallFileLong">License_$(lang).rtf</String>'
351 $(APPEND) $$@ '<String Id="LicenseInstallFileShort">L_$(lang).rtf</String>'
352
353 $(APPEND) $$@ '</WixLocalization>'
354endef
355
356$(foreach lang,$(VBOX_INSTALLER_LANGUAGES), \
357 $(eval local license_file := $(VBOX_BRAND_$(subst en_US_,,$(lang)_)LICENSE_RTF)) \
358 $(eval $(def_vbox_license_xml)))
359
360#
361# Create one intermediate WXI (Windows Installer Include) file for all installers (needed for .MSI compiling).
362# This file includes all language-specific files (PDFs, CHMs, ...) to install.
363#
364# Note: When using the -n switch, append will append a new line after each
365# argument. The -t switch makes it truncate the file.
366#
367$(VBOX_WIN_INST_OUT_DIR)/Files_Main.wxi: $(VBOX_WIN_INST_MAKEFILE_DEP) | $$(dir $$@)
368 $(call MSG_GENERATE,,$@,$<)
369 $(APPEND) -t $@ '<?xml version="1.0" ?>'
370 $(APPEND) $@ '<Include xmlns="http://schemas.microsoft.com/wix/2006/wi">'
371ifdef VBOX_WITH_DOCS_PACKING
372 ifdef VBOX_WITH_DOCS_QHELP_PACKING
373 $(APPEND) $@ ' <File Id="file_UserManual.qch" Name="UserManual.qch" DiskId="$(VBOX_INSTALLER_COMMON_DISKID)" Vital="yes" Source="$(subst /,\,$(PATH_STAGE_BIN)/UserManual.qch)"></File>'
374 $(APPEND) $@ ' <File Id="file_UserManual.qhc" Name="UserManual.qhc" DiskId="$(VBOX_INSTALLER_COMMON_DISKID)" Vital="yes" Source="$(subst /,\,$(PATH_STAGE_BIN)/UserManual.qhc)"></File>'
375 $(APPEND) -n $@ $(foreach lang,$(VBOX_MANUAL_ADD_LANGUAGES), \
376 ' <File Id="file_UserManual_$(lang).qch" Name="UserManual_$(lang).qch" DiskId="$(VBOX_INSTALLER_COMMON_DISKID)" Vital="yes" Source="$(subst /,\,$(PATH_STAGE_BIN)/UserManual_$(lang).qch)"></File>' \
377 ' <File Id="file_UserManual_$(lang).qhc" Name="UserManual_$(lang).qhc" DiskId="$(VBOX_INSTALLER_COMMON_DISKID)" Vital="yes" Source="$(subst /,\,$(PATH_STAGE_BIN)/UserManual_$(lang).qhc)"></File>')
378 endif
379endif
380 $(APPEND) $@ '</Include>'
381
382$(VBOX_WIN_INST_OUT_DIR)/Files_Doc.wxi: $(VBOX_WIN_INST_MAKEFILE_DEP) | $$(dir $$@)
383 $(call MSG_GENERATE,,$@,$<)
384 $(APPEND) -t $@ '<?xml version="1.0" ?>'
385 $(APPEND) $@ '<Include xmlns="http://schemas.microsoft.com/wix/2006/wi">'
386ifdef VBOX_WITH_DOCS_PACKING
387 $(APPEND) $@ ' <File Id="file_UserManual.pdf" Name="UserManual.pdf" DiskId="$(VBOX_INSTALLER_COMMON_DISKID)" Vital="yes" Source="$(subst /,\,$(PATH_STAGE_BIN)/UserManual.pdf)">'
388 $(APPEND) $@ ' </File>'
389 $(APPEND) -n $@ $(foreach lang,$(VBOX_MANUAL_ADD_LANGUAGES), \
390 ' <File Id="file_UserManual_$(lang).pdf" Name="UserManual_$(lang).pdf" DiskId="$(VBOX_INSTALLER_COMMON_DISKID)" Vital="yes" Source="$(subst /,\,$(PATH_STAGE_BIN)/UserManual_$(lang).pdf)">' \
391 ' </File>')
392endif
393 $(APPEND) $@ '</Include>'
394
395$(VBOX_WIN_INST_OUT_DIR)/Files_License.wxi: $(VBOX_WIN_INST_MAKEFILE_DEP) | $$(dir $$@)
396 $(call MSG_GENERATE,,$@,$<)
397 $(APPEND) -t $@ '<?xml version="1.0" ?>'
398 $(APPEND) $@ '<Include xmlns="http://schemas.microsoft.com/wix/2006/wi">'
399 $(APPEND) $@ ' <File Id="file_License_en_US.rtf" Name="License_en_US.rtf" DiskId="$(VBOX_INSTALLER_COMMON_DISKID)" Vital="yes" Source="$(subst /,\,$(VBOX_BRAND_LICENSE_RTF))">' \
400 ' </File>'
401 $(APPEND) -n $@ $(foreach lang,$(VBOX_LICENSE_ADD_LANGUAGES), \
402 ' <File Id="file_License_$(lang).rtf" Name="License_$(lang).rtf" DiskId="$(VBOX_INSTALLER_COMMON_DISKID)" Vital="yes" Source="$(subst /,\,$(VBOX_BRAND_$(lang)_LICENSE_RTF))">' \
403 ' </File>')
404 $(APPEND) $@ '</Include>'
405
406$(VBOX_WIN_INST_OUT_DIR)/DirComponentsAndFiles_DTrace.wxi: $(VBOX_WIN_INST_MAKEFILE_DEP) $(PATH_SUB_CURRENT)/../Config.kmk | $$(dir $$@)
407 $(call MSG_GENERATE,,$@,$<)
408 $(QUIET)$(APPEND) -nt "$@" \
409 '<?xml version="1.0" ?>' \
410 '<Include xmlns="http://schemas.microsoft.com/wix/2006/wi">'
411ifdef VBOX_WITH_DTRACE
412 $(QUIET)$(APPEND) -n "$@" \
413 '<Directory Id="dir_DTrace" Name="dtrace">' \
414 ' <Directory Id="dir_DTrace_lib" Name="lib">' \
415 ' <Directory Id="dir_DTrace_lib_arch" Name="$(KBUILD_TARGET_ARCH)">' \
416 ' <Component Id="cp_dir_DTrace_lib_arch" Guid="7476CDF6-4157-2E17-5CCC-FF92528D2854" Win64="$$(var.Property_Win64)">' \
417 $(foreach file, $(VBOXINST_DTRACE_LIB_ARCH_FILES) \
418 , ' <File Id="file_dtrace_lib_arch_$(subst -,_,$(file))" Name="$(file)" Vital="yes" ' \
419 ' Source="$(subst /,\,$(PATH_STAGE_BIN)/dtrace/lib/$(KBUILD_TARGET_ARCH)/$(file))" />' ) \
420 ' </Component>' \
421 ' </Directory>' \
422 ' </Directory>' \
423 $(if $(VBOXINST_DTRACE_TESTCASE_ARCH_FILES), \
424 ' <Directory Id="dir_DTrace_testcase" Name="testcase">' \
425 ' <Directory Id="dir_DTrace_testcase_arch" Name="$(KBUILD_TARGET_ARCH)">' \
426 ' <Component Id="cp_dir_DTrace_testcase_arch" Guid="45DF7014-4431-6C40-6DB0-35AF7C690EE1" Win64="$$(var.Property_Win64)">' \
427 $(foreach file, $(VBOXINST_DTRACE_TESTCASE_ARCH_FILES) \
428 , ' <File Id="file_dtrace_testcase_arch_$(subst -,_,$(file))" Name="$(file)" Vital="yes" ' \
429 ' Source="$(subst /,\,$(PATH_STAGE_BIN)/dtrace/testcase/$(KBUILD_TARGET_ARCH)/$(file))" />' ) \
430 ' </Component>' \
431 ' </Directory>' \
432 ' </Directory>') \
433 $(if $(VBOXINST_DTRACE_SCRIPTS_FILES), \
434 ' <Directory Id="dir_DTrace_scripts" Name="scripts">' \
435 ' <Component Id="cp_dir_DTrace_scripts" Guid="AE07F9D5-4FD9-ACC7-C760-E9923CE01E16" Win64="$$(var.Property_Win64)">' \
436 $(foreach file, $(VBOXINST_DTRACE_SCRIPTS_FILES) \
437 , ' <File Id="file_dtrace_scripts_$(subst -,_,$(file))" Name="$(file)" Vital="yes" ' \
438 ' Source="$(subst /,\,$(PATH_STAGE_BIN)/dtrace/scripts/$(file))" />' ) \
439 ' </Component>' \
440 ' </Directory>') \
441 '</Directory>'
442endif
443 $(QUIET)$(APPEND) "$@" '</Include>'
444
445
446$(VBOX_WIN_INST_OUT_DIR)/Shortcuts_StartMenu.wxi: $(VBOX_WIN_INST_MAKEFILE_DEP) | $$(dir $$@)
447 $(call MSG_GENERATE,,$@,$<)
448 $(APPEND) -t $@ '<?xml version="1.0" ?>'
449 $(APPEND) $@ '<Include xmlns="http://schemas.microsoft.com/wix/2006/wi">'
450 #
451 # Documentation (PDF/CHM)
452 #
453ifdef VBOX_WITH_DOCS_PACKING
454 $(APPEND) $@ ' <Shortcut Id="sc_StartMenu_ManualPDF_en_US" Directory="dir_StartMenuVBox" Name="!(loc.StartMenu_UserManual) (PDF, English)" Description="!(loc.StartMenu_UserManual)"' \
455 ' Target="[INSTALLDIR]\doc\UserManual.pdf" WorkingDirectory="dir_Documents" Advertise="no"/>'
456 $(APPEND) -n $@ $(foreach lang,$(VBOX_MANUAL_ADD_LANGUAGES), \
457 ' <Shortcut Id="sc_StartMenu_ManualPDF_$(lang)" Directory="dir_StartMenuVBox" Name="!(loc.StartMenu_UserManual) (PDF, $(VBOX_BRAND_$(lang)_LANG_NAME))"' \
458 ' Description="!(loc.StartMenu_UserManual) ($(VBOX_BRAND_$(lang)_LANG_NAME))" Target="[INSTALLDIR]\doc\UserManual_$(lang).pdf" WorkingDirectory="dir_Documents"/>')
459endif
460 #
461 # License(s) (RTF)
462 #
463 $(APPEND) $@ ' <Shortcut Id="sc_StartMenu_License_en_US" Directory="dir_StartMenuVBox" Name="!(loc.StartMenu_License) (English)" Description="!(loc.StartMenu_License)"' \
464 ' Target="[INSTALLDIR]License_en_US.rtf" WorkingDirectory="INSTALLDIR" Advertise="no"/>'
465 $(APPEND) -n $@ $(foreach lang,$(VBOX_LICENSE_ADD_LANGUAGES), \
466 ' <Shortcut Id="sc_StartMenu_License_$(lang)" Directory="dir_StartMenuVBox" Name="!(loc.StartMenu_License) ($(VBOX_BRAND_$(lang)_LANG_NAME))"' \
467 ' Description="!(loc.StartMenu_License) ($(VBOX_BRAND_$(lang)_LANG_NAME))" Target="License_$(lang).rtf" WorkingDirectory="INSTALLDIR"/>')
468 $(APPEND) $@ '</Include>'
469
470#
471# .MSI linking of the main installer (en_US).
472#
473# Note: This will clean up any previous .msi and .wixpdb files to prevent dep
474# build boxes from filling up with old files.
475#
476define def_vbox_link_msi
477 $(VBOX_WIN_INST_OUT_DIR)/$(lang)/$(PACKAGE_NAME_LANG)_$(lang).msi \
478 $(if-expr defined(VBOX_WITH_COMBINED_PACKAGE) && !defined(VBOX_WITH_MSM_INSTALL), + $(VBOX_WIN_INST_OUT_DIR)/common.cab,): \
479 $(VBOX_WIN_INST_OUT_DIR)/$(lang)/VirtualBox_$(lang).wixobj \
480 $(VBOX_WIN_INST_OUT_DIR)/NLS/Language_$(lang).wxl \
481 $(VBOX_WIN_INST_OUT_DIR)/NLS/License_$(lang).wxl \
482 $(PATH_STAGE_BIN)/VBoxInstallHelper.dll \
483 $(VBOX_SVN_REV_KMK) \
484 $(VBOX_WIN_INST_MAKEFILE_DEP) \
485 $(if-expr defined(VBOX_WITH_MSI_HACK),$(MsiHack_0_OUTDIR)/MsiHack.dll,) \
486 $(if-expr defined(VBOX_WITH_MSI_HACK),$(MsiHack_0_OUTDIR)/MsiHackExtension.dll,) \
487 | $$$$(dir $$$$@)
488 $$(call MSG_L1,Linking installer $$@)
489 $(QUIET)$(RM) -f $$(wildcard $$(subst r$$(VBOX_SVN_REV),r*,\
490 $$@ \
491 $$(basename $$@).wixpdb \
492 $$(VBOX_WIN_INST_REPACK_DIR)/2-link-$$(PACKAGE_NAME_LANG).cmd ))
493 kmk_time $$(REDIRECT_EXT) -E WIX_TEMP='$$(subst /,\,$$(@D))' -- $(VBOX_PATH_WIX)/light.exe -v -nologo \
494 -loc $(VBOX_WIN_INST_OUT_DIR)/NLS/Language_$(lang).wxl \
495 -loc $(VBOX_WIN_INST_OUT_DIR)/NLS/License_$(lang).wxl \
496 -ext $(VBOX_PATH_WIX)/WixUIExtension.dll \
497 -ext $(VBOX_PATH_WIX)/WixDifxAppExtension.dll \
498 -ext $(VBOX_PATH_WIX)/WixUtilExtension.dll \
499 $(if-expr defined(VBOX_WITH_MSI_HACK),-ext $(MsiHack_0_OUTDIR)/MsiHackExtension.dll,) \
500 $(VBOX_MSI_ICE_IGNORE) \
501 -out $$@ \
502 $$< \
503 $(VBOX_PATH_WIX)/difxapp_$(if-expr "$(KBUILD_TARGET_ARCH)" == "x86",x86,x64).wixlib
504 if defined(VBOX_WITH_COMBINED_PACKAGE) && !defined(VBOX_WITH_MSM_INSTALL)
505 $(MV) -f -- $$(@D)/common.cab $$(@D)/../common.cab
506 endif
507 ifeq ($(lang),en_US)
508 $(CP) -f -- "$(VBOX_WIN_INST_OUT_DIR)/NLS/Language_$(lang).wxl" "$(VBOX_WIN_INST_OUT_DIR)/NLS/License_$(lang).wxl" \
509 "$(VBOX_WIN_INST_REPACK_DIR)/files-VirtualBox_$(lang)/"
510 # Create repack script for this step.
511 $(APPEND) -tn "$$(VBOX_WIN_INST_REPACK_DIR)/2-link-$$(PACKAGE_NAME_LANG).cmd" \
512 'if ".%KBUILD_DEVTOOLS%" == "." (echo KBUILD_DEVTOOLS is not set & exit /b1)' \
513 $(subst $(KBUILD_DEVTOOLS),%KBUILD_DEVTOOLS%,\
514 '$(VBOX_PATH_WIX)/light.exe -v -nologo ^' \
515 ' -loc files-VirtualBox_$(lang)/Language_$(lang).wxl ^' \
516 ' -loc files-VirtualBox_$(lang)/License_$(lang).wxl ^' \
517 ' -ext $(VBOX_PATH_WIX)/WixUIExtension.dll ^' \
518 ' -ext $(VBOX_PATH_WIX)/WixDifxAppExtension.dll ^' \
519 ' -ext $(VBOX_PATH_WIX)/WixUtilExtension.dll ^' \
520 $(if-expr defined(VBOX_WITH_MSI_HACK),'-ext $(MsiHack_0_OUTDIR)/MsiHackExtension.dll ^',) \
521 ' $(VBOX_MSI_ICE_IGNORE) ^' \
522 ' -out $$(@F) ^' \
523 ' $$(<F) ^' \
524 ' $(VBOX_PATH_WIX)/difxapp_$(if-expr "$(KBUILD_TARGET_ARCH)" == "x86",x86,x64).wixlib ^' \
525 ' || exit /b1' \
526 ) \
527 '@echo Created MSI installer: $$(@F)' \
528 $(if-expr defined(VBOX_WITH_COMBINED_PACKAGE) && !defined(VBOX_WITH_MSM_INSTALL),'@echo Created: common.cab',)
529
530 endif
531endef
532
533$(foreach lang, en_US, $(eval $(def_vbox_link_msi)))
534
535
536#
537# Merge module linking (all languages).
538#
539# Note: This will clean up any previous .msm to prevent dep build boxes from
540# filling up with old files.
541#
542define def_vbox_link_msm
543 $(VBOX_WIN_INST_OUT_DIR)/VBoxMerge$(module)_$(lang)_$(KBUILD_TARGET_ARCH).msm: \
544 $(VBOX_WIN_INST_OUT_DIR)/VBoxMerge$(module)_$(lang).wixobj \
545 $(VBOX_WIN_INST_OUT_DIR)/NLS/Language_$(lang).wxl \
546 $(VBOX_WIN_INST_OUT_DIR)/NLS/License_$(lang).wxl \
547 $(PATH_STAGE_BIN)/VBoxInstallHelper.dll \
548 $(VBOX_SVN_REV_KMK) \
549 $(VBOX_WIN_INST_MAKEFILE_DEP) \
550 | $$$$(dir $$$$@)
551 $$(call MSG_L1,Linking installer $$@)
552 $(QUIET)$(RM) -f $$(wildcard $(VBOX_WIN_INST_OUT_DIR)/$(PACKAGE_BASE)-r*_$(lang).msi)
553 kmk_time $$(REDIRECT_EXT) -E WIX_TEMP='$$(subst /,\,$$(@D))' -- $(VBOX_PATH_WIX)/light.exe -v -nologo \
554 -loc $(VBOX_WIN_INST_OUT_DIR)/NLS/Language_$(lang).wxl \
555 -loc $(VBOX_WIN_INST_OUT_DIR)/NLS/License_$(lang).wxl \
556 -ext $(VBOX_PATH_WIX)/WixDifxAppExtension.dll \
557 -ext $(VBOX_PATH_WIX)/WixUtilExtension.dll \
558 $(VBOX_MSI_ICE_IGNORE) \
559 -out $$@ \
560 $$< \
561 $(VBOX_PATH_WIX)/difxapp_$(if-expr "$(KBUILD_TARGET_ARCH)" == "x86",x86,x64).wixlib
562 $(RM) -f $(VBOX_WIN_INST_OUT_DIR)/NLS/$(lang).mst
563 $(call VBOX_SIGN_MSM_FN,$$@,$(VBOX_PRODUCT) $(VBOX_VERSION_STRING)r$(VBOX_SVN_REV) ($(KBUILD_TARGET_ARCH)),,,disable-dual-signing)
564 # Create repack script for this step.
565 $(APPEND) -tn "$$(VBOX_WIN_INST_REPACK_DIR)/2-link-VBoxMerge$(module)_$(lang).cmd" \
566 'if ".%KBUILD_DEVTOOLS%" == "." (echo KBUILD_DEVTOOLS is not set & exit /b1)' \
567 $(subst $(KBUILD_DEVTOOLS),%KBUILD_DEVTOOLS%,\
568 '$(VBOX_PATH_WIX)/light.exe -v -nologo ^' \
569 ' -loc files-VirtualBox_$(lang)/Language_$(lang).wxl ^' \
570 ' -loc files-VirtualBox_$(lang)/License_$(lang).wxl ^' \
571 ' -ext $(VBOX_PATH_WIX)/WixDifxAppExtension.dll ^' \
572 ' -ext $(VBOX_PATH_WIX)/WixUtilExtension.dll ^' \
573 ' $(VBOX_MSI_ICE_IGNORE) ^' \
574 ' -out $$(@F) ^' \
575 ' $$(<F) ^' \
576 ' $(VBOX_PATH_WIX)/difxapp_$(if-expr "$(KBUILD_TARGET_ARCH)" == "x86",x86,x64).wixlib ^' \
577 ' || exit /b1' \
578 'call sign-sha1.cmd $$(@F) || exit /b1' \
579 ) \
580 '@echo Created MSM module: $$(@F)'
581endef
582
583ifdef VBOX_WITH_MSM_INSTALL
584 $(foreach module,$(VBOX_INSTALLER_MERGE_MODULES), \
585 $(foreach lang,$(VBOX_INSTALLER_MERGE_LANGUAGES), \
586 $(eval $(def_vbox_link_msm)))),)
587endif
588
589
590#
591# Add dependencies that makes sure necessary bits gets built.
592# For combined packages we always use the .ISO from the amd64 build.
593#
594ifdef VBOX_WITH_COMBINED_PACKAGE
595 VBOX_MSI_DEPENDENCIES := \
596 $(if $(VBOX_WITH_ADDITIONS_PACKING),$(PATH_MULTIARCH_GUEST_ADDITIONS_ISO)/VBoxGuestAdditions.iso)
597else
598 VBOX_MSI_DEPENDENCIES := \
599 $(if $(VBOX_WITH_ADDITIONS_PACKING),$(VBOX_PATH_ADDITIONS_ISO)/VBoxGuestAdditions.iso)
600endif
601
602#
603# A few manual dependencies to make sure everything is rebuilt when they should.
604#
605$(PATH_SUB_CURRENT)/VirtualBox.wxs: \
606 $(PATH_SUB_CURRENT)/CommonProperties.wxi \
607 $(PATH_SUB_CURRENT)/Defines.wxi \
608 $(PATH_SUB_CURRENT)/VBoxMergeApp.wxi
609
610$(PATH_SUB_CURRENT)/VBoxMergeApp.wxi $(PATH_SUB_CURRENT)/VirtualBox.wxs: \
611 $(VBOX_WIN_INST_OUT_DIR)/Files_Doc.wxi \
612 $(VBOX_WIN_INST_OUT_DIR)/DirComponentsAndFiles_DTrace.wxi \
613 $(VBOX_WIN_INST_OUT_DIR)/Files_License.wxi \
614 $(VBOX_WIN_INST_OUT_DIR)/Files_Main.wxi \
615 $(VBOX_WIN_INST_OUT_DIR)/VBoxKey.wxi \
616 $(VBOX_WIN_INST_OUT_DIR)/VBoxGuiNLS.wxi \
617 $(VBOX_WIN_INST_OUT_DIR)/VirtualBox_TypeLib.wxi \
618 $(VBOX_WIN_INST_OUT_DIR)/VBoxUnattendedTemplateComponent.wxi
619
620#
621# MSI compile.
622# We've separated the processing from the compilation for repacking reasons.
623#
624define def_vbox_compile_wixobj
625 includedep $(VBOX_WIN_INST_OUT_DIR)/$(lang)/VirtualBox_$(lang).wixobj.dep
626 $(VBOX_WIN_INST_OUT_DIR)/$(lang)/VirtualBox_$(lang).wixobj \
627 + $(VBOX_WIN_INST_OUT_DIR)/$(lang)/VirtualBox_$(lang).wix \
628 $(if-expr "$(lang)" != "en_US",, \
629 + $(VBOX_WIN_INST_REPACK_DIR)/VirtualBox_$(lang).wix $(VBOX_WIN_INST_REPACK_DIR)/VirtualBox_$(lang).files ): \
630 $(PATH_SUB_CURRENT)/VirtualBox.wxs \
631 $(PATH_SUB_CURRENT)/UserInterface.wxi \
632 $(if-expr defined(VBOX_WITH_MSM_INSTALL), \
633 $(foreach module,$(VBOX_INSTALLER_MERGE_MODULES), \
634 $(VBOX_WIN_INST_OUT_DIR)/VBoxMerge$(module)_$(lang)_$(KBUILD_TARGET_ARCH).msm), \
635 $(VBOX_WIN_INST_OUT_DIR)/Shortcuts_StartMenu.wxi \
636 $(VBOX_WIN_INST_OUT_DIR)/VirtualBox_TypeLib.wxi \
637 $(if $(VBOX_WITH_32_ON_64_MAIN_API),$(VBOX_WIN_INST_OUT_DIR)/VirtualBox_TypeLib_x86.wxi,) \
638 $(VBOX_WIN_INST_OUT_DIR)/VBoxKey.wxi \
639 $(if $(VBOX_WITH_CRT_PACKING),$(VBOX_WIN_INST_OUT_DIR)/VBoxCrtDlls.wxi,) \
640 $(if $(VBOX_WITH_CRT_PACKING),$(VBOX_WIN_INST_OUT_DIR)/VBoxCrtDlls32.wxi,) \
641 $(VBOX_WIN_INST_OUT_DIR)/VBoxUnattendedTemplateComponent.wxi \
642 $(if $(VBOX_WITH_QTGUI),$(VBOX_WIN_INST_OUT_DIR)/VBoxGuiNLS.wxi) \
643 $(VBOX_MSI_DEPENDENCIES)) \
644 $(VBOX_VERSION_STAMP) \
645 | $$$$(dir $$$$@) $(if-expr "$(lang)" != "en_US",, \
646 $(VBOX_WIN_INST_REPACK_DIR)/ $(VBOX_WIN_INST_REPACK_DIR)/files-VirtualBox_$(lang)/ )
647 $(QUIET)$(RM) -f -- "$$@" "$(VBOX_WIN_INST_OUT_DIR)/$(lang)/VirtualBox_$(lang).wix" "$(VBOX_WIN_INST_REPACK_DIR)/VirtualBox_$(lang).wix"
648 $(REDIRECT) \
649 -E 'PATH_OUT=$(subst /,\,$(PATH_OUT))' \
650 -E 'PATH_TARGET=$(subst /,\,$(VBOX_WIN_INST_OUT_DIR))' \
651 -E 'PATH_ROOT=$(subst /,\,$(PATH_ROOT))' \
652 -E 'PATH_MULTIARCH_GUEST_ADDITIONS_ISO=$(subst /,\,$(PATH_MULTIARCH_GUEST_ADDITIONS_ISO))' \
653 -E 'VBOX_PATH_WIN_INST_SRC=$(subst /,\,$(VBOX_PATH_WIN_INST_SRC))' \
654 -E 'VBOX_BRAND_WIN_INST_DLGJPG=$(subst /,\,$(VBOX_BRAND_WIN_INST_DLGJPG))' \
655 -E 'VBOX_ADD_LANGUAGES=$(VBOX_INSTALLER_ADD_LANGUAGES)' \
656 -E 'VBOX_BRAND_LICENSE_RTF=$(subst /,\,$(VBOX_BRAND_LICENSE_RTF))' \
657 $(foreach lang,$(VBOX_INSTALLER_LANGUAGES), \
658 -E 'VBOX_BRAND_$(lang)_LICENSE_RTF=$(subst /,\,$(VBOX_BRAND_$(subst en_US_,,$(lang)_)LICENSE_RTF))') \
659 -E 'VBOX_BUILD_NR_FOR_INST=$(VBOX_VERSION_BUILD)' \
660 -E 'VBOX_VENDOR=$(VBOX_VENDOR)' \
661 -E 'VBOX_VENDOR_SHORT=$(VBOX_VENDOR_SHORT)' \
662 -E 'VBOX_PRODUCT=$(VBOX_PRODUCT)' \
663 -E 'VBOX_C_YEAR=$(VBOX_C_YEAR)' \
664 -E 'VBOX_VERSION_STRING=$(VBOX_VERSION_STRING)' \
665 -E 'VBOX_VERSION_STRING_RAW=$(VBOX_VERSION_STRING_RAW)' \
666 -E 'VBOX_VERSION_MAJOR_INST=$(VBOX_VERSION_MAJOR)' \
667 -E 'VBOX_VERSION_MINOR_INST=$(VBOX_VERSION_MINOR)' \
668 -E 'VBOX_SIGNING_MODE=$(strip $(if $(VBOX_SIGNING_MODE),$(VBOX_SIGNING_MODE),none))' \
669 -E 'VBOX_CAB_COMPRESSION_LEVEL=$(if-expr $(lang) == "en_US",$(VBOX_CAB_COMPRESSION_LEVEL),none)' \
670 -E 'VBOX_CAB_COMPRESSION_LEVEL_COMMON=$(if-expr $(lang) == "en_US" && $(KBUILD_TARGET_ARCH) == "amd64",$(VBOX_CAB_COMPRESSION_LEVEL),none)' \
671 -E 'VBOX_GUI_USE_QGL=$(if $(VBOX_GUI_USE_QGL),yes,no)' \
672 -E 'VBOX_MIDL_PROXY_CLSID=$(VBOX_MIDL_PROXY_CLSID)' \
673 $(if-expr defined(VBOX_WITH_MSM_INSTALL), \
674 $(foreach module,$(VBOX_INSTALLER_MERGE_MODULES), \
675 -E 'VBOX_WIN_INST_MERGE_$(toupper $(module))=$(subst /,\,$(VBOX_WIN_INST_OUT_DIR)/VBoxMerge$(module)_$(lang)_$(KBUILD_TARGET_ARCH).msm')),) \
676 -E 'VBOX_WINDOWS_ICON_FILE=$(subst /,\,$(VBOX_WINDOWS_ICON_FILE))' \
677 -E 'VBOX_QT_INFIX=$(VBOX_QT_INFIX)' \
678 -E 'VBOX_WITH_32_ON_64_MAIN_API=$(if $(VBOX_WITH_32_ON_64_MAIN_API),yes,no)' \
679 -E 'VBOX_WITH_ADDITIONS_PACKING=$(if $(VBOX_WITH_ADDITIONS_PACKING),yes,no)' \
680 -E 'VBOX_WITH_COMBINED_PACKAGE=$(if-expr defined(VBOX_WITH_COMBINED_PACKAGE),yes,no)' \
681 -E 'VBOX_WITH_CRT_PACKING=$(if-expr defined(VBOX_WITH_CRT_PACKING),yes,no)' \
682 -E 'VBOX_WITH_DEBUGGER_GUI=$(if-expr defined(VBOX_WITH_DEBUGGER_GUI) && defined(VBOX_WITH_QTGUI),yes,no)' \
683 -E 'VBOX_WITH_DOCS_PACKING=$(if $(VBOX_WITH_DOCS_PACKING),yes,no)' \
684 -E 'VBOX_WITH_DRAG_AND_DROP=$(if $(VBOX_WITH_DRAG_AND_DROP),yes,no)' \
685 -E 'VBOX_WITH_DTRACE=$(if $(VBOX_WITH_DTRACE),yes,no)' \
686 -E 'VBOX_WITH_HOST_SHIPPING_AUDIO_TEST=$(if $(VBOX_WITH_HOST_SHIPPING_AUDIO_TEST),yes,no)' \
687 -E 'VBOX_WITH_EFIFW_PACKING=$(if $(VBOX_WITH_EFIFW_PACKING),yes,no)' \
688 -E 'VBOX_WITH_EXTPACK=$(if $(VBOX_WITH_EXTPACK),yes,no)' \
689 -E 'VBOX_WITH_GUEST_CONTROL=$(if $(VBOX_WITH_GUEST_CONTROL),yes,no)' \
690 -E 'VBOX_WITH_GUEST_PROPS=$(if $(VBOX_WITH_GUEST_PROPS),yes,no)' \
691 -E 'VBOX_WITH_HARDENING=$(if $(VBOX_WITH_HARDENING),yes,no)' \
692 -E 'VBOX_WITH_HEADLESS=$(if $(VBOX_WITH_HEADLESS),yes,no)' \
693 -E 'VBOX_WITH_FE_BALLOONCTRL=$(if $(VBOX_WITH_FE_BALLOONCTRL),yes,no)' \
694 -E 'VBOX_WITH_FE_AUTOSTART=$(if $(VBOX_WITH_FE_AUTOSTART),yes,no)' \
695 -E 'VBOX_WITH_FE_BUGREPORT=$(if $(VBOX_WITH_FE_BUGREPORT),yes,no)' \
696 -E 'VBOX_WITH_LIBSSH=$(if $(VBOX_WITH_LIBSSH),yes,no)' \
697 -E 'VBOX_WITH_LICENSE_DISPLAY=$(if $(VBOX_WITH_LICENSE_DISPLAY),yes,no)' \
698 -E 'VBOX_WITH_MIDL_PROXY_STUB=$(if $(VBOX_WITH_MIDL_PROXY_STUB),yes,no)' \
699 -E 'VBOX_WITH_MSM_INSTALL=$(if-expr defined(VBOX_WITH_MSM_INSTALL),yes,no)' \
700 -E 'VBOX_WITH_NETADP=$(if $(VBOX_WITH_NETADP),yes,no)' \
701 -E 'VBOX_WITH_NETFLT=$(if $(VBOX_WITH_NETFLT),yes,no)' \
702 -E 'VBOX_WITH_PYTHON=$(if $(VBOX_WITH_PYTHON),yes,no)' \
703 -E 'VBOX_WITH_QTGUI=$(if $(VBOX_WITH_QTGUI),yes,no)' \
704 -E 'VBOX_WITH_RAW_MODE=$(if $(VBOX_WITH_RAW_MODE),yes,no)' \
705 -E 'VBOX_WITH_SERIALNUMBER_INSTALL=$(if $(VBOX_WITH_SERIALNUMBER_INSTALL),yes,no)' \
706 -E 'VBOX_WITH_VIDEOHWACCEL=$(if $(VBOX_WITH_VIDEOHWACCEL),yes,no)' \
707 -E 'VBOX_WITH_VRDP=$(if-expr defined(VBOX_WITH_VRDP) && !defined(VBOX_WITH_EXTPACK_PUEL),yes,no)' \
708 -E 'VBOX_WITH_WEBSERVICES=$(if $(VBOX_WITH_WEBSERVICES),yes,no)' \
709 -E 'VBOX_WITH_SDS=$(if $(VBOX_WITH_SDS),yes,no)' \
710 -E 'VBOX_WITH_UNATTENDED=$(if $(VBOX_WITH_UNATTENDED),yes,no)' \
711 -E 'VBOX_WITH_USB=$(if $(VBOX_WITH_USB),yes,no)' \
712 -E 'VBOX_WITH_VBOX_IMG=$(if $(VBOX_WITH_VBOX_IMG)$(VBOX_WITH_TESTCASES),yes,no)' \
713 -E 'VBOX_WITH_VBOXSDL=$(if $(VBOX_WITH_VBOXSDL),yes,no)' \
714 -E 'VBOX_WITH_VMSVGA3D=$(if $(VBOX_WITH_VMSVGA3D),yes,no)' \
715 -E 'VBOX_WITH_VIDEOHWACCEL=$(if $(VBOX_WITH_VIDEOHWACCEL),yes,no)' \
716 -E 'KBUILD_TYPE=$(KBUILD_TYPE)' \
717 -E 'KBUILD_TARGET_ARCH=$(KBUILD_TARGET_ARCH)' \
718 -E 'VBOX_INSTALLER_QUICK=$(VBOX_INSTALLER_QUICK)' \
719 -E 'VBOX_VCC_TOOL_STEM=$(VBOX_VCC_TOOL_STEM)' \
720 -- \
721 $(VBOX_PATH_WIX)/candle.exe $(filter-out $(VBOX_VERSION_STAMP),$$<) \
722 -ext $(VBOX_PATH_WIX)/WixUIExtension.dll \
723 -ext $(VBOX_PATH_WIX)/WixDifxAppExtension.dll \
724 -ext $(VBOX_PATH_WIX)/WixUtilExtension.dll \
725 -p$(VBOX_WIN_INST_OUT_DIR)/$(lang)/VirtualBox_$(lang).wix
726 $(VBOX_PATH_WIX)/candle.exe $(VBOX_WIN_INST_OUT_DIR)/$(lang)/VirtualBox_$(lang).wix \
727 -ext $(VBOX_PATH_WIX)/WixUIExtension.dll \
728 -ext $(VBOX_PATH_WIX)/WixDifxAppExtension.dll \
729 -ext $(VBOX_PATH_WIX)/WixUtilExtension.dll \
730 -out $$@
731 ifeq ($(lang),en_US)
732 # Copy preprocessed wix and change source paths to be relative. Stuff not in ../bin needs copying.
733 $(SED) -e 's,$(subst /,\\,$(PATH_OUT))\\bin,..\\bin,g' \
734 -e 's,$(subst /,\\,$(PATH_OUT_BASE))\\win.amd64\\$(KBUILD_TYPE)\\bin,..\\..\\..\\win.amd64\\$(KBUILD_TYPE)\\bin,g' \
735 -e 's,$(subst /,\\,$(PATH_OUT_BASE))\\win.x86\\$(KBUILD_TYPE)\\bin,..\\..\\..\\win.x86\\$(KBUILD_TYPE)\\bin,g' \
736 \
737 -e 's,$(subst /,\\,$(PATH_ROOT))\\doc\\,files-VirtualBox_$(lang)\\,g' \
738 -e 's,$(subst /,\\,$(VBOX_PATH_WIN_INST_SRC))\\Binary\\,files-VirtualBox_$(lang)\\,g' \
739 -e 's,$(subst /,\\,$(VBOX_WIN_INST_OUT_DIR))\\,,g' \
740 -e 's,$(subst /,\\,$(dir $(VBOX_WINDOWS_ICON_FILE))),files-VirtualBox_$(lang)\\,g' \
741 --output "$(VBOX_WIN_INST_REPACK_DIR)/VirtualBox_$(lang).wix" \
742 "$(VBOX_WIN_INST_OUT_DIR)/$(lang)/VirtualBox_$(lang).wix"
743 $(SED) -n \
744 -e '/<\?ln /d' \
745 -e '/$(subst /,\\,$(PATH_ROOT))/p' \
746 -e '/$(subst /,\\,$(PATH_ROOT))/q2' \
747 "$(VBOX_WIN_INST_REPACK_DIR)/VirtualBox_$(lang).wix"
748 $(SED) -n \
749 -e '/<\?ln /d' \
750 -e 's/\\/\//g' \
751 -e 's,^.*"\($(PATH_ROOT)/doc/[^"]*\)".*$$(DOLLAR),\1,p' \
752 -e 's,^.*"\($(VBOX_PATH_WIN_INST_SRC)/Binary/[^"]*\)".*$$(DOLLAR),\1,p' \
753 -e 's,^.*"\($(dir $(VBOX_WINDOWS_ICON_FILE))[^"]*\)".*$$(DOLLAR),\1,p' \
754 --output "$(VBOX_WIN_INST_REPACK_DIR)/VirtualBox_$(lang).files" \
755 "$(VBOX_WIN_INST_OUT_DIR)/$(lang)/VirtualBox_$(lang).wix"
756 set -xe && for file in `$(CAT_EXT) "$(VBOX_WIN_INST_REPACK_DIR)/VirtualBox_$(lang).files"`; \
757 do $(CP_EXT) -f -- "$$(DOLLAR){file}" "$(VBOX_WIN_INST_REPACK_DIR)/files-VirtualBox_$(lang)/"; done
758 # Create repack script for this step.
759 $(APPEND) -tn "$(VBOX_WIN_INST_REPACK_DIR)/1-compile-VirtualBox_$(lang).cmd" \
760 'if ".%KBUILD_DEVTOOLS%" == "." (echo KBUILD_DEVTOOLS is not set & exit /b1)' \
761 $(subst $(KBUILD_DEVTOOLS),%KBUILD_DEVTOOLS%,\
762 '$(VBOX_PATH_WIX)/candle.exe VirtualBox_$(lang).wix ^' \
763 ' -ext $(VBOX_PATH_WIX)/WixUIExtension.dll ^' \
764 ' -ext $(VBOX_PATH_WIX)/WixDifxAppExtension.dll ^' \
765 ' -ext $(VBOX_PATH_WIX)/WixUtilExtension.dll ^' \
766 ' -out $$(@F) || exit /b1' \
767 ) \
768 '@echo Created: $$(@F)'
769 endif
770 # Generate wxi dependencies based on the sourceLineNumber references in the output. Add repack file list for cleanup.
771 $(QUIET)$(APPEND) -t '[email protected]' '$$@: \'
772 $(QUIET)$(VBOX_XSLTPROC) $(VBOX_PATH_WIN_INST_SRC)/dep.xsl "$$@" >> "[email protected]"
773 $(QUIET)$(VBOX_XSLTPROC) $(VBOX_PATH_WIN_INST_SRC)/dep2.xsl "$$@" | sort | $(SED) '$!N; /^\(.*\)\n\1$$$$/!P; D' >> "[email protected]"
774 $(QUIET)$(APPEND) -n '[email protected]' '' ''
775 ifeq ($(lang),en_US)
776 $(QUIET)$(APPEND) -n '[email protected]' 'define VBOX_REPACK_FILES_VirtualBox_$(lang)'
777 $(QUIET)$(CAT_EXT) "$(VBOX_WIN_INST_REPACK_DIR)/VirtualBox_$(lang).files" >> '[email protected]'
778 $(QUIET)$(APPEND) -n '[email protected]' '' 'endef'
779 endif
780
781 $(eval OTHER_CLEAN += $(VBOX_REPACK_FILES_VirtualBox_$(lang)))
782endef
783
784$(foreach lang,$(VBOX_INSTALLER_LANGUAGES), \
785 $(eval $(def_vbox_compile_wixobj)))
786
787#
788# MSM (merge module) compile.
789#
790define def_vbox_compile_msm
791 includedep $(VBOX_WIN_INST_OUT_DIR)/VBoxMerge$(module)_$(lang).wixobj.dep
792 $(VBOX_WIN_INST_OUT_DIR)/VBoxMerge$(module)_$(lang).wixobj \
793 + $(VBOX_WIN_INST_OUT_DIR)/VBoxMerge$(module)_$(lang).wix \
794 $(if-expr "$(lang)" != "en_US",, \
795 + $(VBOX_WIN_INST_REPACK_DIR)/VBoxMerge$(module)_$(lang).wix): \
796 $(PATH_SUB_CURRENT)/VBoxMerge$(module).wxs \
797 $(PATH_SUB_CURRENT)/VBoxMerge$(module).wxi \
798 $(PATH_SUB_CURRENT)/VBoxMerge$(module)CA.wxi \
799 $(PATH_SUB_CURRENT)/VBoxMerge$(module)Seq.wxi \
800 $(PATH_SUB_CURRENT)/UserInterface.wxi \
801 $(VBOX_WIN_INST_OUT_DIR)/Shortcuts_StartMenu.wxi \
802 $(VBOX_WIN_INST_OUT_DIR)/VirtualBox_TypeLib.wxi \
803 $(if $(VBOX_WITH_32_ON_64_MAIN_API),$(VBOX_WIN_INST_OUT_DIR)/VirtualBox_TypeLib_x86.wxi,) \
804 $(VBOX_WIN_INST_OUT_DIR)/VBoxKey.wxi \
805 $(if $(VBOX_WITH_CRT_PACKING),$(VBOX_WIN_INST_OUT_DIR)/VBoxCrtDlls.wxi,) \
806 $(if $(VBOX_WITH_CRT_PACKING),$(VBOX_WIN_INST_OUT_DIR)/VBoxCrtDlls32.wxi,) \
807 $(VBOX_WIN_INST_OUT_DIR)/VBoxUnattendedTemplateComponent.wxi \
808 $(if $(VBOX_WITH_QTGUI),$(VBOX_WIN_INST_OUT_DIR)/VBoxGuiNLS.wxi) \
809 $(VBOX_MSI_DEPENDENCIES) \
810 $(VBOX_VERSION_STAMP) \
811 | $$$$(dir $$$$@) $(VBOX_WIN_INST_REPACK_DIR)/
812 $(QUIET)$(RM) -f -- "$$@" "$(VBOX_WIN_INST_OUT_DIR)/VBoxMerge$(module)_$(lang).wix" "$(VBOX_WIN_INST_REPACK_DIR)/VBoxMerge$(module)_$(lang).wix"
813 $(REDIRECT) \
814 -E 'PATH_OUT=$(subst /,\,$(PATH_OUT))' \
815 -E 'PATH_TARGET=$(subst /,\,$(VBOX_WIN_INST_OUT_DIR))' \
816 -E 'PATH_ROOT=$(subst /,\,$(PATH_ROOT))' \
817 -E 'PATH_MULTIARCH_GUEST_ADDITIONS_ISO=$(subst /,\,$(PATH_MULTIARCH_GUEST_ADDITIONS_ISO))' \
818 -E 'VBOX_PATH_WIN_INST_SRC=$(subst /,\,$(VBOX_PATH_WIN_INST_SRC))' \
819 -E 'VBOX_BRAND_WIN_INST_DLGJPG=$(subst /,\,$(VBOX_BRAND_WIN_INST_DLGJPG))' \
820 -E 'VBOX_ADD_LANGUAGES=$(VBOX_INSTALLER_ADD_LANGUAGES)' \
821 -E 'VBOX_BRAND_LICENSE_RTF=$(subst /,\,$(VBOX_BRAND_LICENSE_RTF))' \
822 $(foreach lang,$(VBOX_INSTALLER_LANGUAGES), \
823 -E 'VBOX_BRAND_$(lang)_LICENSE_RTF=$(subst /,\,$(VBOX_BRAND_$(subst en_US_,,$(lang)_)LICENSE_RTF))') \
824 -E 'VBOX_BUILD_NR_FOR_INST=$(VBOX_VERSION_BUILD)' \
825 -E 'VBOX_VENDOR=$(VBOX_VENDOR)' \
826 -E 'VBOX_VENDOR_SHORT=$(VBOX_VENDOR_SHORT)' \
827 -E 'VBOX_PRODUCT=$(VBOX_PRODUCT)' \
828 -E 'VBOX_C_YEAR=$(VBOX_C_YEAR)' \
829 -E 'VBOX_VERSION_STRING=$(VBOX_VERSION_STRING)' \
830 -E 'VBOX_VERSION_STRING_RAW=$(VBOX_VERSION_STRING_RAW)' \
831 -E 'VBOX_VERSION_MAJOR_INST=$(VBOX_VERSION_MAJOR)' \
832 -E 'VBOX_VERSION_MINOR_INST=$(VBOX_VERSION_MINOR)' \
833 -E 'VBOX_SIGNING_MODE=$(strip $(if $(VBOX_SIGNING_MODE),$(VBOX_SIGNING_MODE),none))' \
834 -E 'VBOX_CAB_COMPRESSION_LEVEL=$(VBOX_CAB_COMPRESSION_LEVEL)' \
835 -E 'VBOX_CAB_COMPRESSION_LEVEL_COMMON=$(VBOX_CAB_COMPRESSION_LEVEL)' \
836 -E 'VBOX_GUI_USE_QGL=$(if $(VBOX_GUI_USE_QGL),yes,no)' \
837 -E 'VBOX_MIDL_PROXY_CLSID=$(VBOX_MIDL_PROXY_CLSID)' \
838 -E 'VBOX_WINDOWS_ICON_FILE=$(subst /,\,$(VBOX_WINDOWS_ICON_FILE))' \
839 -E 'VBOX_QT_INFIX=$(VBOX_QT_INFIX)' \
840 -E 'VBOX_WITH_32_ON_64_MAIN_API=$(if $(VBOX_WITH_32_ON_64_MAIN_API),yes,no)' \
841 -E 'VBOX_WITH_ADDITIONS_PACKING=$(if $(VBOX_WITH_ADDITIONS_PACKING),yes,no)' \
842 -E 'VBOX_WITH_COMBINED_PACKAGE=$(if-expr defined(VBOX_WITH_COMBINED_PACKAGE),yes,no)' \
843 -E 'VBOX_WITH_CRT_PACKING=$(if-expr defined(VBOX_WITH_CRT_PACKING),yes,no)' \
844 -E 'VBOX_WITH_DEBUGGER_GUI=$(if-expr defined(VBOX_WITH_DEBUGGER_GUI) && defined(VBOX_WITH_QTGUI),yes,no)' \
845 -E 'VBOX_WITH_DOCS_PACKING=$(if $(VBOX_WITH_DOCS_PACKING),yes,no)' \
846 -E 'VBOX_WITH_DRAG_AND_DROP=$(if $(VBOX_WITH_DRAG_AND_DROP),yes,no)' \
847 -E 'VBOX_WITH_DTRACE=$(if $(VBOX_WITH_DTRACE),yes,no)' \
848 -E 'VBOX_WITH_HOST_SHIPPING_AUDIO_TEST=$(if $(VBOX_WITH_HOST_SHIPPING_AUDIO_TEST),yes,no)' \
849 -E 'VBOX_WITH_EFIFW_PACKING=$(if $(VBOX_WITH_EFIFW_PACKING),yes,no)' \
850 -E 'VBOX_WITH_EXTPACK=$(if $(VBOX_WITH_EXTPACK),yes,no)' \
851 -E 'VBOX_WITH_GUEST_CONTROL=$(if $(VBOX_WITH_GUEST_CONTROL),yes,no)' \
852 -E 'VBOX_WITH_GUEST_PROPS=$(if $(VBOX_WITH_GUEST_PROPS),yes,no)' \
853 -E 'VBOX_WITH_HARDENING=$(if $(VBOX_WITH_HARDENING),yes,no)' \
854 -E 'VBOX_WITH_HEADLESS=$(if $(VBOX_WITH_HEADLESS),yes,no)' \
855 -E 'VBOX_WITH_FE_BALLOONCTRL=$(if $(VBOX_WITH_FE_BALLOONCTRL),yes,no)' \
856 -E 'VBOX_WITH_FE_AUTOSTART=$(if $(VBOX_WITH_FE_AUTOSTART),yes,no)' \
857 -E 'VBOX_WITH_FE_BUGREPORT=$(if $(VBOX_WITH_FE_BUGREPORT),yes,no)' \
858 -E 'VBOX_WITH_LIBSSH=$(if $(VBOX_WITH_LIBSSH),yes,no)' \
859 -E 'VBOX_WITH_LICENSE_DISPLAY=$(if $(VBOX_WITH_LICENSE_DISPLAY),yes,no)' \
860 -E 'VBOX_WITH_MIDL_PROXY_STUB=$(if $(VBOX_WITH_MIDL_PROXY_STUB),yes,no)' \
861 -E 'VBOX_WITH_MSM_INSTALL=$(if-expr defined(VBOX_WITH_MSM_INSTALL),yes,no)' \
862 -E 'VBOX_WITH_NETADP=$(if $(VBOX_WITH_NETADP),yes,no)' \
863 -E 'VBOX_WITH_NETFLT=$(if $(VBOX_WITH_NETFLT),yes,no)' \
864 -E 'VBOX_WITH_PYTHON=$(if $(VBOX_WITH_PYTHON),yes,no)' \
865 -E 'VBOX_WITH_QTGUI=$(if $(VBOX_WITH_QTGUI),yes,no)' \
866 -E 'VBOX_WITH_RAW_MODE=$(if $(VBOX_WITH_RAW_MODE),yes,no)' \
867 -E 'VBOX_WITH_SERIALNUMBER_INSTALL=$(if $(VBOX_WITH_SERIALNUMBER_INSTALL),yes,no)' \
868 -E 'VBOX_WITH_VIDEOHWACCEL=$(if $(VBOX_WITH_VIDEOHWACCEL),yes,no)' \
869 -E 'VBOX_WITH_VRDP=$(if-expr defined(VBOX_WITH_VRDP) && !defined(VBOX_WITH_EXTPACK_PUEL),yes,no)' \
870 -E 'VBOX_WITH_WEBSERVICES=$(if $(VBOX_WITH_WEBSERVICES),yes,no)' \
871 -E 'VBOX_WITH_SDS=$(if $(VBOX_WITH_SDS),yes,no)' \
872 -E 'VBOX_WITH_UNATTENDED=$(if $(VBOX_WITH_UNATTENDED),yes,no)' \
873 -E 'VBOX_WITH_VBOX_IMG=$(if $(VBOX_WITH_VBOX_IMG),yes,no)' \
874 -E 'VBOX_WITH_VBOXSDL=$(if $(VBOX_WITH_VBOXSDL),yes,no)' \
875 -E 'VBOX_WITH_VMSVGA3D=$(if $(VBOX_WITH_VMSVGA3D),yes,no)' \
876 -E 'VBOX_WITH_VIDEOHWACCEL=$(if $(VBOX_WITH_VIDEOHWACCEL),yes,no)' \
877 -E 'KBUILD_TYPE=$(KBUILD_TYPE)' \
878 -E 'KBUILD_TARGET_ARCH=$(KBUILD_TARGET_ARCH)' \
879 -E 'VBOX_INSTALLER_QUICK=$(VBOX_INSTALLER_QUICK)' \
880 -E 'VBOX_VCC_TOOL_STEM=$(VBOX_VCC_TOOL_STEM)' \
881 -- \
882 $(VBOX_PATH_WIX)/candle.exe $(filter-out $(VBOX_VERSION_STAMP),$$<) \
883 -ext $(VBOX_PATH_WIX)/WixUIExtension.dll \
884 -ext $(VBOX_PATH_WIX)/WixDifxAppExtension.dll \
885 -ext $(VBOX_PATH_WIX)/WixUtilExtension.dll \
886 -p$(VBOX_WIN_INST_OUT_DIR)/VBoxMerge$(module)_$(lang).wix
887 $(VBOX_PATH_WIX)/candle.exe $(VBOX_WIN_INST_OUT_DIR)/VBoxMerge$(module)_$(lang).wix \
888 -ext $(VBOX_PATH_WIX)/WixUIExtension.dll \
889 -ext $(VBOX_PATH_WIX)/WixDifxAppExtension.dll \
890 -ext $(VBOX_PATH_WIX)/WixUtilExtension.dll \
891 -out $$@
892 ifeq ($(lang),en_US)
893 # Copy preprocessed wix and change source paths to be relative. Stuff not in ../bin needs copying.
894 $(SED) -e 's,$(subst /,\\,$(PATH_OUT))\\bin,..\\bin,g' \
895 -e 's,$(subst /,\\,$(PATH_OUT_BASE))\\win.amd64\\$(KBUILD_TYPE)\\bin,..\\..\\..\\win.amd64\\$(KBUILD_TYPE)\\bin,g' \
896 -e 's,$(subst /,\\,$(PATH_OUT_BASE))\\win.x86\\$(KBUILD_TYPE)\\bin,..\\..\\..\\win.x86\\$(KBUILD_TYPE)\\bin,g' \
897 -e 's,$(subst /,\\,$(PATH_ROOT))\\doc\\,files-VBoxMerge$(module)_$(lang)\\,g' \
898 -e 's,$(subst /,\\,$(VBOX_PATH_WIN_INST_SRC))\\Binary\\,files-VBoxMerge$(module)_$(lang)\\,g' \
899 -e 's,$(subst /,\\,$(dir $(VBOX_WINDOWS_ICON_FILE))),files-VBoxMerge$(module)_$(lang)\\,g' \
900 -e 's,$(subst /,\\,$(VBOX_PATH_WIN_INST_SRC))\\,,g' \
901 --output "$(VBOX_WIN_INST_REPACK_DIR)/VBoxMerge$(module)_$(lang).wix" \
902 "$(VBOX_WIN_INST_OUT_DIR)/VBoxMerge$(module)_$(lang).wix"
903 $(SED) -n \
904 -e '/<\?ln /d' \
905 -e '/$(subst /,\\,$(PATH_ROOT))/p' \
906 -e '/$(subst /,\\,$(PATH_ROOT))/q2' \
907 "$(VBOX_WIN_INST_REPACK_DIR)/VBoxMerge$(module)_$(lang).wix"
908 $(SED) -n \
909 -e '/<\?ln /d' \
910 -e 's/\\/\//g' \
911 -e 's,^.*"\($(PATH_ROOT)/doc/[^"]*\)".*$$(DOLLAR),\1,p' \
912 -e 's,^.*"\($(VBOX_PATH_WIN_INST_SRC)/Binary/[^"]*\)".*$$(DOLLAR),\1,p' \
913 -e 's,^.*"\($(dir $(VBOX_WINDOWS_ICON_FILE))[^"]*\)".*$$(DOLLAR),\1,p' \
914 --output "$(VBOX_WIN_INST_REPACK_DIR)/VBoxMerge$(module)_$(lang).files" \
915 "$(VBOX_WIN_INST_OUT_DIR)/VBoxMerge$(module)_$(lang).wix"
916 $(MKDIR) -p -- "$(VBOX_WIN_INST_REPACK_DIR)/files-VBoxMerge$(module)_$(lang)/"
917 set -xe && for file in `$(CAT_EXT) "$(VBOX_WIN_INST_REPACK_DIR)/VBoxMerge$(module)_$(lang).files"`; \
918 do $(CP_EXT) -f -- "$$(DOLLAR){file}" "$(VBOX_WIN_INST_REPACK_DIR)/files-VBoxMerge$(module)_$(lang)/"; done
919 # Create repack script for this step.
920 $(APPEND) -tn "$(VBOX_WIN_INST_REPACK_DIR)/1-compile-VBoxMerge$(module)_$(lang).cmd" \
921 'if ".%KBUILD_DEVTOOLS%" == "." (echo KBUILD_DEVTOOLS is not set & exit /b1)' \
922 $(subst $(KBUILD_DEVTOOLS),%KBUILD_DEVTOOLS%,\
923 '$(VBOX_PATH_WIX)/candle.exe VBoxMerge$(module)_$(lang).wix ^' \
924 ' -ext $(VBOX_PATH_WIX)/WixUIExtension.dll ^'\
925 ' -ext $(VBOX_PATH_WIX)/WixDifxAppExtension.dll ^' \
926 ' -ext $(VBOX_PATH_WIX)/WixUtilExtension.dll ^' \
927 ' -out $$(@F) || exit /b1' \
928 ) \
929 '@echo Created: $$(@F)'
930 endif
931 # Generate wxi dependencies based on the sourceLineNumber references in the output. Add repack file list for cleanup.
932 $(QUIET)$(APPEND) -t '[email protected]' '$$@: \'
933 $(QUIET)$(VBOX_XSLTPROC) $(VBOX_PATH_WIN_INST_SRC)/dep.xsl "$$@" >> "[email protected]"
934 $(QUIET)$(VBOX_XSLTPROC) $(VBOX_PATH_WIN_INST_SRC)/dep2.xsl "$$@" | sort | $(SED) '$!N; /^\(.*\)\n\1$$$$/!P; D' >> "[email protected]"
935 $(QUIET)$(APPEND) -n '[email protected]' '' ''
936 ifeq ($(lang),en_US)
937 $(QUIET)$(APPEND) -n '[email protected]' 'define VBOX_REPACK_FILES_VBoxMerge$(module)_$(lang)'
938 $(QUIET)$(CAT_EXT) "$(VBOX_WIN_INST_REPACK_DIR)/VBoxMerge$(module)_$(lang).files" >> '[email protected]'
939 $(QUIET)$(APPEND) -n '[email protected]' '' 'endef'
940 endif
941
942 $(eval OTHER_CLEAN += $(VBOX_REPACK_FILES_VBoxMerge$(module)_$(lang)))
943endef
944
945$(foreach module,$(VBOX_INSTALLER_MERGE_MODULES), \
946 $(foreach lang,$(VBOX_INSTALLER_MERGE_LANGUAGES), \
947 $(eval $(def_vbox_compile_msm))))
948
949#
950# VirtualBox Type Library definition.
951#
952$(VBOX_WIN_INST_OUT_DIR)/VirtualBox_TypeLib.wxi: \
953 $(PATH_SUB_CURRENT)/$(if-expr defined(VBOX_WITH_MIDL_PROXY_STUB),VirtualBox_TypeLibWithInterfaces.xsl,VirtualBox_TypeLib.xsl) \
954 $(VBOX_XIDL_FILE) \
955 $(MAKEFILE) \
956 | $$(dir $$@)
957 $(VBOX_XSLTPROC) \
958 $(if-expr defined(VBOX_WITH_MIDL_PROXY_STUB),--stringparam "a_sProxyStubClsid" "$(VBOX_MIDL_PROXY_CLSID)",) \
959 $(if-expr defined(VBOX_WITH_SDS),--stringparam "a_sWithSDS" "yes",) \
960 -o $@ $< $(VBOX_XIDL_FILE)
961
962$(VBOX_WIN_INST_OUT_DIR)/VirtualBox_TypeLib_x86.wxi: \
963 $(PATH_SUB_CURRENT)/$(if-expr defined(VBOX_WITH_MIDL_PROXY_STUB),VirtualBox_TypeLibWithInterfaces.xsl,VirtualBox_TypeLib.xsl) \
964 $(VBOX_XIDL_FILE) \
965 | $$(dir $$@)
966 $(VBOX_XSLTPROC) --stringparam "a_sTarget" "VBoxClient-x86" \
967 $(if-expr defined(VBOX_WITH_MIDL_PROXY_STUB),--stringparam "a_sProxyStubClsid" "$(VBOX_MIDL_PROXY_CLSID)",) \
968 $(if-expr defined(VBOX_WITH_SDS),--stringparam "a_sWithSDS" "yes",) \
969 -o $@ $< $(VBOX_XIDL_FILE)
970
971#
972# Construct the list of GUI translations.
973# ('-t' -- truncate file; '-n' -- new line between arguments)
974#
975include $(PATH_ROOT)/src/VBox/Frontends/VirtualBox/nls/ApprovedLanguages.kmk
976$(call KB_FN_AUTO_CMD_DEPS,$(VBOX_WIN_INST_OUT_DIR)/VBoxGuiNLS.wxi)
977$(VBOX_WIN_INST_OUT_DIR)/VBoxGuiNLS.wxi: $(PATH_ROOT)/src/VBox/Frontends/VirtualBox/nls/ApprovedLanguages.kmk | $$(dir $$@)
978 $(APPEND) -t $@ '<?xml version="1.0" ?>'
979 $(APPEND) $@ '<Include>'
980 $(APPEND) -n $@ $(foreach lang,$(VBOX_APPROVED_GUI_LANGUAGES), \
981 ' <File Id="nlsqt${lang}" Name="qt_${lang}.qm" DiskId="$(VBOX_INSTALLER_COMMON_DISKID)" Vital="yes" Source="$$(env.PATH_OUT)\bin\nls\qt_${lang}.qm" />' \
982 ' <File Id="nlsgui${lang}" Name="VirtualBox_${lang}.qm" DiskId="$(VBOX_INSTALLER_COMMON_DISKID)" Vital="yes" Source="$$(env.PATH_OUT)\bin\nls\VirtualBox_${lang}.qm" />')
983 $(APPEND) $@ '</Include>'
984
985#
986# Edit the version stored in the registry.
987#
988$(call KB_FN_AUTO_CMD_DEPS,$(VBOX_WIN_INST_OUT_DIR)/VBoxKey.wxi)
989$(VBOX_WIN_INST_OUT_DIR)/VBoxKey.wxi: $(PATH_SUB_CURRENT)/VBoxKey.wxi $(VBOX_VERSION_STAMP) | $$(dir $$@)
990 $(SED) -e 's/%VER%/$(VBOX_VERSION_STRING_RAW)/' \
991 -e 's/%VER_EXT%/$(VBOX_VERSION_STRING)/' \
992 --output $@ $<
993
994#
995# Generate the list of CRT DLLs.
996#
997ifndef TOOL_$(VBOX_VCC_TOOL)
998 include $(KBUILD_PATH)/tools/$(VBOX_VCC_TOOL).kmk
999endif
1000$(call KB_FN_AUTO_CMD_DEPS,$(VBOX_WIN_INST_OUT_DIR)/VBoxCrtDlls.wxi)
1001$(VBOX_WIN_INST_OUT_DIR)/VBoxCrtDlls.wxi: | $$(dir $$@)
1002 $(APPEND) -t -n $@ \
1003 '<?xml version="1.0" ?>' \
1004 '<Include>' \
1005 $(foreach dll \
1006 ,$(if-expr "$(VBOX_VCC_TOOL_STEM)"=="VCC100",msvcr100.dll msvcp100.dll \
1007 ,$(if-expr "$(VBOX_VCC_TOOL_STEM)"=="VCC110",msvcr110.dll msvcp110.dll \
1008 ,$(TOOL_$(VBOX_VCC_TOOL)_REDIST_CRT_DLLS) $(TOOL_$(VBOX_VCC_TOOL)_REDIST_CPP_DLLS))) \
1009 $(if-expr "$(KBUILD_TYPE)"=="asan",clang_rt.asan_dynamic-x86_64.dll,) \
1010 ,' <File Id="file_$(translate $(dll),-,_)" Name="$(dll)" Source="$$(env.PATH_OUT)\bin\$(dll)" />') \
1011 '</Include>'
1012
1013#
1014# Generate the list of 32-bit CRT DLLs.
1015#
1016ifndef TOOL_$(VBOX_VCC_TOOL_STEM)X86
1017 include $(KBUILD_PATH)/tools/$(VBOX_VCC_TOOL_STEM)X86.kmk
1018endif
1019$(call KB_FN_AUTO_CMD_DEPS,$(VBOX_WIN_INST_OUT_DIR)/VBoxCrtDlls32.wxi)
1020$(VBOX_WIN_INST_OUT_DIR)/VBoxCrtDlls32.wxi: | $$(dir $$@)
1021 $(APPEND) -t -n $@ \
1022 '<?xml version="1.0" ?>' \
1023 '<Include>' \
1024 $(foreach dll \
1025 ,$(if-expr "$(VBOX_VCC_TOOL_STEM)"=="VCC100",msvcr100.dll msvcp100.dll \
1026 ,$(if-expr "$(VBOX_VCC_TOOL_STEM)"=="VCC110",msvcr110.dll msvcp110.dll \
1027 ,$(TOOL_$(VBOX_VCC_TOOL_STEM)X86_REDIST_CRT_DLLS) $(TOOL_$(VBOX_VCC_TOOL_STEM)X86_REDIST_CPP_DLLS))) \
1028 $(if-expr "$(KBUILD_TYPE)"=="asan",clang_rt.asan_dynamic-i386.dll,) \
1029 ,' <File Id="file_$(translate $(dll),-,_)_x86" Name="$(dll)" Source="$$(env.PATH_OUT)\bin\x86\$(dll)" DiskId="$$(var.Property_DiskIdCommon)" />') \
1030 '</Include>'
1031#
1032# Generate the list of unattended template script files.
1033#
1034$(call KB_FN_AUTO_CMD_DEPS,$(VBOX_WIN_INST_OUT_DIR)/VBoxUnattendedTemplateComponent.wxi)
1035$(VBOX_WIN_INST_OUT_DIR)/VBoxUnattendedTemplateComponent.wxi: | $$(dir $$@)
1036 $(APPEND) -t -n $@ \
1037 '<?xml version="1.0" ?>' \
1038 '<Include>'
1039ifdef VBOX_UNATTENDED_TEMPLATES
1040 $(APPEND) -n $@ \
1041 ' <Directory Id="dir_VBoxUnattendedTemplates" Name="UnattendedTemplates">' \
1042 ' <Component Id="cp_UnattendedTemplates" Guid="0571550d-aaa5-4723-c17b-5ddcc29f5686" Win64="$$(var.Property_Win64)">' \
1043 $(foreach file,$(VBOX_UNATTENDED_TEMPLATES), \
1044 ' <File Id="$(file)" Name="$(file)" Source="$$(env.PATH_OUT)\bin\UnattendedTemplates\$(file)" />') \
1045 ' </Component>' \
1046 ' </Directory>'
1047endif
1048 $(APPEND) $@ '</Include>'
1049
1050
1051#
1052# Build the multi-language version of the .MSI installer (final installer).
1053#
1054# This is done by creating binary .MST diffs of all the language-specific installers
1055# against the en_US one, and then merging the diffs into the en_US one using tools
1056# from the MS Installer SDK.
1057#
1058define def_vbox_create_mst
1059 $(VBOX_WIN_INST_OUT_DIR)/$(lang)/$(lang).mst \
1060 + $(VBOX_WIN_INST_REPACK_DIR)/$(lang).mst: \
1061 $(VBOX_WIN_INST_OUT_DIR)/en_US/$(PACKAGE_NAME_LANG)_en_US.msi \
1062 $(VBOX_WIN_INST_OUT_DIR)/$(lang)/VirtualBox_$(lang).wixobj \
1063 $(VBOX_WIN_INST_OUT_DIR)/NLS/Language_$(lang).wxl \
1064 $(VBOX_WIN_INST_OUT_DIR)/NLS/License_$(lang).wxl \
1065 $(PATH_STAGE_BIN)/VBoxInstallHelper.dll \
1066 $(VBOX_SVN_REV_KMK) \
1067 $(VBOX_WIN_INST_MAKEFILE_DEP) \
1068 $(if-expr defined(VBOX_WITH_MSI_HACK),$(MsiHack_0_OUTDIR)/MsiHack.dll,) \
1069 $(if-expr defined(VBOX_WITH_MSI_HACK),$(MsiHack_0_OUTDIR)/MsiHackExtension.dll,) \
1070 | $$$$(dir $$$$@) $(VBOX_WIN_INST_REPACK_DIR)/
1071 $(call MSG_L1,Creating language diff for $(lang))
1072 kmk_time $$(REDIRECT_EXT) -E WIX_TEMP='$$(subst /,\,$$(@D))' -- $(VBOX_PATH_WIX)/light.exe -v -nologo \
1073 -loc $(VBOX_WIN_INST_OUT_DIR)/NLS/Language_$(lang).wxl \
1074 -loc $(VBOX_WIN_INST_OUT_DIR)/NLS/License_$(lang).wxl \
1075 -ext $(VBOX_PATH_WIX)/WixUIExtension.dll \
1076 -ext $(VBOX_PATH_WIX)/WixDifxAppExtension.dll \
1077 -ext $(VBOX_PATH_WIX)/WixUtilExtension.dll \
1078 $(if-expr defined(VBOX_WITH_MSI_HACK),-ext $(MsiHack_0_OUTDIR)/MsiHackExtension.dll,) \
1079 $(VBOX_MSI_ICE_IGNORE) \
1080 -out $$(@D)/$(PACKAGE_NAME_LANG)_$(lang).msi \
1081 $$(@D)/VirtualBox_$(lang).wixobj \
1082 $(VBOX_PATH_WIX)/difxapp_$(if-expr "$(KBUILD_TARGET_ARCH)" == "x86",x86,x64).wixlib
1083 $(REDIRECT) -C $$(@D) -- $$(VBOX_PATH_MSITRAN) -g $$< $(PACKAGE_NAME_LANG)_$(lang).msi $(lang).mst
1084 $(CP) -f -- "$(VBOX_WIN_INST_OUT_DIR)/$(lang)/$(lang).mst" "$(VBOX_WIN_INST_REPACK_DIR)/$(lang).mst"
1085 $(RM) -f -- $$(@D)/$(PACKAGE_NAME_LANG)_$(lang).msi \
1086 $$(@D)/$(PACKAGE_NAME_LANG)_$(lang).wixpdb \
1087 $$(@D)/common.cab
1088
1089endef
1090
1091$(foreach lang,$(filter-out en_US, $(VBOX_INSTALLER_LANGUAGES)), \
1092 $(eval local lang_id := $(VBOX_BRAND_$(lang)_LANG_ID)) \
1093 $(eval $(def_vbox_create_mst)))
1094
1095
1096# Create WISUMINFO argument.
1097VBOX_INS_PROD_ARCH.amd64 = x64
1098VBOX_INS_PROD_ARCH.x86 = Intel
1099VBOX_INS_PROD_ARCH := $(VBOX_INS_PROD_ARCH.$(KBUILD_TARGET_ARCH))
1100ifeq ($(VBOX_INS_PROD_ARCH),)
1101 $(error VBOX_INS_PROD_ARCH is empty!)
1102endif
1103VBOX_INS_PROD_LANG := 7="$(VBOX_INS_PROD_ARCH);1033
1104$(foreach lang, $(filter-out en_US,$(VBOX_INSTALLER_LANGUAGES))\
1105 , $(eval VBOX_INS_PROD_LANG := $(VBOX_INS_PROD_LANG)$(COMMA)$(VBOX_BRAND_$(lang)_LANG_ID)))
1106VBOX_INS_PROD_LANG := $(VBOX_INS_PROD_LANG)"
1107
1108# The multilingual installer rule.
1109$(VBOX_WIN_INST_OUT_DIR)/$(PACKAGE_NAME_LANG).msi \
1110+ $(VBOX_WIN_INST_REPACK_DIR)/3-multilingual-$(PACKAGE_NAME_LANG).cmd: \
1111 $(VBOX_WIN_INST_OUT_DIR)/en_US/$(PACKAGE_NAME_LANG)_en_US.msi \
1112 $(foreach lang,$(filter-out en_US,$(VBOX_INSTALLER_LANGUAGES)),$(VBOX_WIN_INST_OUT_DIR)/$(lang)/$(lang).mst)
1113 $(call MSG_L1,Creating final multilingual MSI)
1114 $(QUIET)$(RM) -f -- \
1115 $(wildcard $(@D)/$(PACKAGE_BASE)-r*.msi $(VBOX_WIN_INST_REPACK_DIR)/3-multilingual-$(PACKAGE_BASE)-r*.cmd )
1116 $(CP) -f -- "$<" "$@"
1117
1118 $(foreach lang,$(filter-out en_US,$(VBOX_INSTALLER_LANGUAGES)), \
1119 $(NLTAB)$(REDIRECT) -C $(@D)/$(lang) -- $(VBOX_PATH_MSIDB) -d $@ -r $(lang).mst \
1120 $(NLTAB)$(REDIRECT) -C $(@D)/$(lang) -- cscript.exe /nologo $(VBOX_PATH_WISUBSTG) $@ $(lang).mst $(VBOX_BRAND_$(lang)_LANG_ID) )
1121
1122 $(REDIRECT) -C $(@D) -- cscript.exe /nologo $(VBOX_PATH_WISUBSTG) $(@F)
1123 $(REDIRECT) -C $(@D) -- cscript.exe /nologo $(VBOX_PATH_WISUMINFO) $@ $(VBOX_INS_PROD_LANG)
1124 $(call VBOX_SIGN_MSI_FN,$@,$(VBOX_PRODUCT) $(VBOX_VERSION_STRING)r$(VBOX_SVN_REV) ($(KBUILD_TARGET_ARCH)),,,disable-dual-signing)
1125
1126# Create repack script for this step.
1127 $(APPEND) -nt "$(VBOX_WIN_INST_REPACK_DIR)/3-multilingual-$(PACKAGE_NAME_LANG).cmd" \
1128 'if ".%KBUILD_DEVTOOLS%" == "." (echo KBUILD_DEVTOOLS is not set & exit /b1)' \
1129 'if ".%KBUILD_BIN_PATH%" == "." (echo KBUILD_BIN_PATH is not set & exit /b1)' \
1130 'copy /y "$(<F)" "$(@F)" || exit /b1' \
1131 $(subst $(KBUILD_BIN_PATH),%KBUILD_BIN_PATH%,$(subst $(KBUILD_DEVTOOLS),%KBUILD_DEVTOOLS%,\
1132 $(foreach lang,$(filter-out en_US,$(VBOX_INSTALLER_LANGUAGES)), \
1133 '$(VBOX_PATH_MSIDB) -d $(@F) -r $(lang).mst || exit /b1' \
1134 'cscript.exe /nologo $(VBOX_PATH_WISUBSTG) $(@F) $(lang).mst $(VBOX_BRAND_$(lang)_LANG_ID) || exit /b1') \
1135 'cscript.exe /nologo $(VBOX_PATH_WISUBSTG) $(@F) || exit /b1' \
1136 'cscript.exe /nologo $(VBOX_PATH_WISUMINFO) $(@F) $(VBOX_INS_PROD_LANG) || exit /b1' \
1137 'call sign-sha1.cmd $(@F) || exit /b1' \
1138 ) ) \
1139 $(if-expr defined(VBOX_WITH_COMBINED_PACKAGE),'copy /y "$(@F)" "$(notdir $(PACKAGE_NAME_FINAL))" || exit /b1',) \
1140 '@echo Created multilanguage MSI: $(notdir $(PACKAGE_NAME_FINAL))'
1141
1142# Copy multilingual installer to bin.
1143$(PACKAGE_NAME_FINAL): $(VBOX_WIN_INST_OUT_DIR)/$(PACKAGE_NAME_LANG).msi | $$(dir $$@)
1144 $(QUIET)$(RM) -f $(wildcard $(@D)/$(PACKAGE_BASE)-r*$(if-expr defined(VBOX_WITH_COMBINED_PACKAGE),_$(KBUILD_TARGET_ARCH),).msi)
1145 $(INSTALL_STAGING) -- $< $@
1146
1147
1148if defined(VBOX_WITH_COMBINED_PACKAGE) && "$(KBUILD_TARGET_ARCH)" == "x86"
1149 #
1150 # Make the multi-architecture installer by calling our stub builder
1151 # with both platform installers (x86 and amd64) + common cab. The common
1152 # cab only is needed when we don't use merge modules. We only
1153 # need to do this once; so do it on x86 only.
1154 #
1155 $(PATH_STAGE_BIN)/$(PACKAGE_NAME_MULTIARCH_FINAL) \
1156 + $(VBOX_WIN_INST_REPACK_DIR)/4-multiarch-$(PACKAGE_NAME_MULTIARCH_FINAL).cmd: \
1157 $(PATH_MULTIARCH_TEMP)/$(PACKAGE_NAME_MULTIARCH.x86) \
1158 $(PATH_MULTIARCH_TEMP)/$(PACKAGE_NAME_MULTIARCH.amd64) \
1159 $(PATH_STAGE_BIN)/VBoxStub.exe \
1160 $$(VBoxStubBld_1_TARGET)
1161 $(call MSG_L1,Building Windows combined package)
1162 $(QUIET)$(RM) -f -- $(wildcard $(subst r$(VBOX_SVN_REV),r*, \
1163 $@ \
1164 $(VBOX_WIN_INST_REPACK_DIR)/4-multiarch-$(PACKAGE_NAME_MULTIARCH_FINAL).cmd ) )
1165 $(if-expr defined(VBOX_WITH_MSM_INSTALL),,$(call VBOX_SIGN_CAB_FN,$(PACKAGE_NAME_MULTIARCH_COMMONCAB)))
1166 $(REDIRECT) -C $(@D) -- \
1167 $(VBoxStubBld_1_TARGET) -out $@ \
1168 -target-x86 $(PATH_MULTIARCH_TEMP)/$(PACKAGE_NAME_MULTIARCH.x86) \
1169 -target-amd64 $(PATH_MULTIARCH_TEMP)/$(PACKAGE_NAME_MULTIARCH.amd64) \
1170 $(if-expr defined(VBOX_WITH_MSM_INSTALL),,-target-all $(PACKAGE_NAME_MULTIARCH_COMMONCAB)) \
1171 -stub $(PATH_STAGE_BIN)/VBoxStub.exe
1172 $(VBOX_VCC_EDITBIN) /IntegrityCheck:NO $@
1173 $(call VBOX_SIGN_FILE_FN,$@)
1174 # Create repack script for this step.
1175 $(APPEND) -nt "$(VBOX_WIN_INST_REPACK_DIR)/4-multiarch-$(@F).cmd" \
1176 'if ".%KBUILD_DEVTOOLS%" == "." (echo KBUILD_DEVTOOLS is not set & exit /b1)' \
1177 'if ".%KBUILD_BIN_PATH%" == "." (echo KBUILD_BIN_PATH is not set & exit /b1)' \
1178 $(subst $(KBUILD_BIN_PATH),%KBUILD_BIN_PATH%,$(subst $(KBUILD_DEVTOOLS),%KBUILD_DEVTOOLS%, \
1179 $(if-expr defined(VBOX_WITH_MSM_INSTALL), \
1180 ,'call sign-dual.cmd ../../../win.amd64/$(KBUILD_TYPE)/repack/$(notdir $(PACKAGE_NAME_MULTIARCH_COMMONCAB)) || exit /b1') \
1181 '..\bin\VBoxStubBld.exe ^' \
1182 ' -out $(@F) ^' \
1183 ' -target-x86 $(PACKAGE_NAME_MULTIARCH.x86) ^' \
1184 ' -target-amd64 ../../../win.amd64/$(KBUILD_TYPE)/repack/$(PACKAGE_NAME_MULTIARCH.amd64) ^' \
1185 $(if-expr defined(VBOX_WITH_MSM_INSTALL),\
1186 ,' -target-all ../../../win.amd64/$(KBUILD_TYPE)/repack/$(notdir $(PACKAGE_NAME_MULTIARCH_COMMONCAB)) ^' ) \
1187 ' -stub ../bin/VBoxStub.exe || exit /b1' \
1188 '$(VBOX_VCC_EDITBIN) /IntegrityCheck:NO $(@F) || exit /b1' \
1189 'call sign-dual.cmd $(@F) || exit /b1' \
1190 ) ) \
1191 '@echo Created multiarch EXE: $(@F)'
1192else
1193 #
1194 # We still do the installer stub thing even if we only ship 64-bit, because we've
1195 # gotten used to having it around to install the certificate and such.
1196 #
1197 $(PATH_STAGE_BIN)/$(PACKAGE_NAME_MULTIARCH_FINAL) \
1198 + $(VBOX_WIN_INST_REPACK_DIR)/4-multiarch-$(PACKAGE_NAME_MULTIARCH_FINAL).cmd: \
1199 $(PACKAGE_NAME_FINAL) \
1200 $(PATH_STAGE_BIN)/VBoxStub.exe \
1201 $$(VBoxStubBld_1_TARGET)
1202 $(call MSG_L1,Building Windows package w/ installer stub)
1203 $(QUIET)$(RM) -f -- $(wildcard $(subst r$(VBOX_SVN_REV),r*, \
1204 $@ \
1205 $(VBOX_WIN_INST_REPACK_DIR)/4-multiarch-$(PACKAGE_NAME_MULTIARCH_FINAL).cmd ) )
1206 $(REDIRECT) -C $(@D) -- \
1207 $(VBoxStubBld_1_TARGET) -out $@ \
1208 -target-$(KBUILD_TARGET_ARCH) $(PACKAGE_NAME_FINAL) \
1209 -stub $(PATH_STAGE_BIN)/VBoxStub.exe
1210 $(VBOX_VCC_EDITBIN) /IntegrityCheck:NO $@
1211 $(call VBOX_SIGN_FILE_FN,$@)
1212 # Create repack script for this step.
1213 $(APPEND) -nt "$(VBOX_WIN_INST_REPACK_DIR)/4-multiarch-$(@F).cmd" \
1214 'if ".%KBUILD_DEVTOOLS%" == "." (echo KBUILD_DEVTOOLS is not set & exit /b1)' \
1215 'if ".%KBUILD_BIN_PATH%" == "." (echo KBUILD_BIN_PATH is not set & exit /b1)' \
1216 $(subst $(KBUILD_BIN_PATH),%KBUILD_BIN_PATH%,$(subst $(KBUILD_DEVTOOLS),%KBUILD_DEVTOOLS%, \
1217 '..\bin\VBoxStubBld.exe ^' \
1218 ' -out $(@F) ^' \
1219 ' -target-$(KBUILD_TARGET_ARCH) $(notdir $(PACKAGE_NAME_FINAL)) ^' \
1220 ' -stub ../bin/VBoxStub.exe || exit /b1' \
1221 '$(VBOX_VCC_EDITBIN) /IntegrityCheck:NO $(@F) || exit /b1' \
1222 'call sign-dual.cmd $(@F) || exit /b1' \
1223 ) ) \
1224 '@echo Created multiarch EXE: $(@F)'
1225 ifdef VBOX_WIN_ATTESTATION_SIGNING
1226 echo "Repacking HERE"
1227 cd $(PATH_OUT)/repack && ls -la
1228 $(RM) -f $(VBOX_WIN_INST_REPACK_DIR)/*.ddf
1229 $(RM) -f $(VBOX_WIN_INST_REPACK_DIR)/$(PACKAGE_NAME_LANG)-$(KBUILD_TARGET_ARCH).cab
1230 $(RM) -f $(VBOX_WIN_INST_REPACK_DIR)/PackDriversForSubmission_internal.cmd
1231 $(APPEND) -nt "$(VBOX_WIN_INST_REPACK_DIR)/PackDriversForSubmission_internal.cmd" \
1232 "SET KBUILD_BIN_PATH=$(KBUILD_BIN_PATH)" \
1233 "call PackDriversForSubmission.cmd -b $(PATH_STAGE_BIN) -a $(KBUILD_TARGET_ARCH) \
1234 -x -n --no-extpack -o $(VBOX_WIN_INST_REPACK_DIR)/$(PACKAGE_NAME_LANG)-$(KBUILD_TARGET_ARCH).cab"
1235 cd $(PATH_OUT)/repack && ls -la
1236
1237 cd $(VBOX_WIN_INST_REPACK_DIR) && $(EXEC_X86_WIN32) cmd.exe /c PackDriversForSubmission_internal.cmd
1238 cd $(VBOX_WIN_INST_REPACK_DIR) && $(VBOX_RETRY) $(VBOX_WIN_ATTESTATION_SIGNING_EXE) "Oracle VM VirtualBox Base drivers $(KBUILD_TARGET_ARCH) $(VBOX_VERSION_MAJOR).$(VBOX_VERSION_MINOR).$(VBOX_VERSION_BUILD)r$(VBOX_SVN_REV)" "$(KBUILD_TARGET_ARCH)" "r$(VBOX_SVN_REV)" "$(PACKAGE_NAME_LANG)-$(KBUILD_TARGET_ARCH).cab"
1239
1240 $(RM) -f $(VBOX_WIN_INST_REPACK_DIR)/Single-3-Repack_internal.cmd
1241 $(APPEND) -nt "$(VBOX_WIN_INST_REPACK_DIR)/Single-3-Repack_internal.cmd" \
1242 "SET KBUILD_BIN_PATH=$(KBUILD_BIN_PATH)" \
1243 "SET KBUILD_DEVTOOLS=$(KBUILD_DEVTOOLS)" \
1244 "call Single-3-Repack.cmd --no-extpack --signed "$(PACKAGE_NAME_LANG)-$(KBUILD_TARGET_ARCH).cab.Signed.zip"
1245 cd $(VBOX_WIN_INST_REPACK_DIR) && $(EXEC_X86_WIN32) cmd.exe /c Single-3-Repack_internal.cmd
1246
1247 $(RM) -f $(PATH_STAGE_BIN)/$(PACKAGE_NAME_MULTIARCH_FINAL)
1248 $(RM) -f $(PATH_STAGE_BIN)/$(PACKAGE_NAME_LANG).msi
1249 $(CP) $(VBOX_WIN_INST_REPACK_DIR)/$(PACKAGE_NAME_MULTIARCH_FINAL) $(PATH_STAGE_BIN)/
1250 $(CP) $(VBOX_WIN_INST_REPACK_DIR)/$(PACKAGE_NAME_LANG).msi $(PATH_STAGE_BIN)/
1251 endif
1252endif
1253
1254#
1255# Repackaging scripts and files.
1256#
1257INSTALLS += RePackScripts
1258RePackScripts_TEMPLATE = DUMMY
1259RePackScripts_INST = repack/
1260RePackScripts_INSTTYPE = stage
1261RePackScripts_SOURCES = \
1262 Scripts/UnpackBlessedDrivers.cmd \
1263 $(RePackScripts_0_OUTDIR)/PackDriversForSubmission.cmd \
1264 $(RePackScripts_0_OUTDIR)/sign-dual.cmd \
1265 $(RePackScripts_0_OUTDIR)/sign-sha1.cmd \
1266 $(if-expr defined(VBOX_SIGN_EV_FILE_FN),$(RePackScripts_0_OUTDIR)/sign-ev.cmd,) \
1267 $(RePackScripts_0_OUTDIR)/VMMR0.inf \
1268 $(RePackScripts_0_OUTDIR)/VBoxExtPackPuel.inf
1269if !defined(VBOX_WITH_COMBINED_PACKAGE) || "$(KBUILD_TARGET_ARCH)" == "x86"
1270 RePackScripts_SOURCES += \
1271 $(RePackScripts_0_OUTDIR)/RepackExtPack.cmd
1272endif
1273ifdef VBOX_WITH_COMBINED_PACKAGE
1274 if "$(KBUILD_TARGET_ARCH)" == "x86"
1275 RePackScripts_SOURCES += \
1276 $(RePackScripts_0_OUTDIR)/Combined-1-Prepare.cmd \
1277 $(RePackScripts_0_OUTDIR)/Combined-3-Repack.cmd \
1278 $(RePackScripts_0_OUTDIR)/Combined-3-RepackAdditions.cmd
1279 endif
1280else
1281 RePackScripts_SOURCES += \
1282 $(RePackScripts_0_OUTDIR)/Single-1-Prepare.cmd \
1283 $(RePackScripts_0_OUTDIR)/Single-3-Repack.cmd
1284
1285 ifndef VBOX_OSE
1286 RePackScripts_SOURCES += \
1287 $(RePackScripts_0_OUTDIR)/Single-0-All.cmd
1288 endif
1289
1290endif
1291RePackScripts_CLEAN = \
1292 $(RePackScripts_0_OUTDIR)/PackDriversForSubmission.cmd \
1293 $(RePackScripts_0_OUTDIR)/sign-dual.cmd \
1294 $(RePackScripts_0_OUTDIR)/sign-sha1.cmd \
1295 $(RePackScripts_0_OUTDIR)/sign-ev.cmd \
1296 $(RePackScripts_0_OUTDIR)/VMMR0.inf \
1297 $(RePackScripts_0_OUTDIR)/VBoxExtPackPuel.inf
1298
1299$(call VBOX_EDIT_VERSION_AND_BUILD_RULE_FN,RePackScripts,Scripts/PackDriversForSubmission.cmd,PackDriversForSubmission.cmd)
1300$(call VBOX_EDIT_VERSION_AND_BUILD_RULE_FN,RePackScripts,Scripts/RepackExtPack.cmd,RepackExtPack.cmd)
1301ifdef VBOX_WITH_COMBINED_PACKAGE
1302 $(call VBOX_EDIT_VERSION_AND_BUILD_RULE_FN,RePackScripts,Scripts/Combined-1-Prepare.cmd,Combined-1-Prepare.cmd)
1303 $(call VBOX_EDIT_VERSION_AND_BUILD_RULE_FN,RePackScripts,Scripts/Combined-3-Repack.cmd,Combined-3-Repack.cmd)
1304 $(call VBOX_EDIT_VERSION_AND_BUILD_RULE_FN,RePackScripts,Scripts/Combined-3-RepackAdditions.cmd,Combined-3-RepackAdditions.cmd)
1305else
1306 ifndef VBOX_OSE
1307 $(call VBOX_EDIT_VERSION_AND_BUILD_RULE_FN,RePackScripts,Scripts/Single-0-All.cmd,Single-0-All.cmd)
1308 endif
1309 $(call VBOX_EDIT_VERSION_AND_BUILD_RULE_FN,RePackScripts,Scripts/Single-1-Prepare.cmd,Single-1-Prepare.cmd)
1310 $(call VBOX_EDIT_VERSION_AND_BUILD_RULE_FN,RePackScripts,Scripts/Single-3-Repack.cmd,Single-3-Repack.cmd)
1311endif
1312
1313$$(RePackScripts_0_OUTDIR)/sign-dual.cmd: | $$(dir $$@)
1314 $(APPEND) -nt "$@" \
1315 'if ".%KBUILD_DEVTOOLS%" == "." (echo KBUILD_DEVTOOLS is not set & exit /b 1)' \
1316 'if ".%KBUILD_BIN_PATH%" == "." (echo KBUILD_BIN_PATH is not set & exit /b 1)' \
1317 'if ".%1" == "." (echo No .cat file specified & exit /b 1)' \
1318 $(subst /win-6.1/,/win-rel/,$(subst $(KBUILD_BIN_PATH),%KBUILD_BIN_PATH%,$(subst $(KBUILD_DEVTOOLS),%KBUILD_DEVTOOLS%, \
1319 '( $(call VBOX_SIGN_FILE_FN,%1,$(VBOX_PRODUCT) $(VBOX_VERSION_STRING)r$(VBOX_SVN_REV) ($(KBUILD_TARGET_ARCH)),,,,&&) ) || exit /b1' \
1320 ) ) )
1321
1322$$(RePackScripts_0_OUTDIR)/sign-sha1.cmd: | $$(dir $$@)
1323 $(APPEND) -nt "$@" \
1324 'if ".%KBUILD_DEVTOOLS%" == "." (echo KBUILD_DEVTOOLS is not set & exit /b 1)' \
1325 'if ".%KBUILD_BIN_PATH%" == "." (echo KBUILD_BIN_PATH is not set & exit /b 1)' \
1326 'if ".%1" == "." (echo No .cat file specified & exit /b 1)' \
1327 $(subst $(KBUILD_BIN_PATH),%KBUILD_BIN_PATH%,$(subst $(KBUILD_DEVTOOLS),%KBUILD_DEVTOOLS%, \
1328 '( $(call VBOX_SIGN_FILE_FN,%1,$(VBOX_PRODUCT) $(VBOX_VERSION_STRING)r$(VBOX_SVN_REV) ($(KBUILD_TARGET_ARCH)),,,disable-dual-signing,&&) ) || exit /b1' \
1329 ) )
1330
1331# The %~dp1\ oddity is working around otherwise ending with \" during
1332# expansion of the CCS command line which for a reason I cannot immediately
1333# understand appends a " to the path.
1334$$(RePackScripts_0_OUTDIR)/sign-ev.cmd: | $$(dir $$@)
1335 $(APPEND) -nt "$@" \
1336 'if ".%KBUILD_DEVTOOLS%" == "." (echo KBUILD_DEVTOOLS is not set & exit /b 1)' \
1337 'if ".%KBUILD_BIN_PATH%" == "." (echo KBUILD_BIN_PATH is not set & exit /b 1)' \
1338 'if ".%1" == "." (echo No .cab file specified & exit /b 1)' \
1339 $(subst $(KBUILD_BIN_PATH),%KBUILD_BIN_PATH%,$(subst $(KBUILD_DEVTOOLS),%KBUILD_DEVTOOLS%, \
1340 '( $(call VBOX_SIGN_EV_FILE_FN,%1,%~dp1\) ) || exit /b1' \
1341 ) )
1342
1343$$(RePackScripts_0_OUTDIR)/VMMR0.inf: $(PATH_SUB_CURRENT)/Scripts/VMMR0.inf $(MAKEFILE_CURRENT) | $$(dir $$@)
1344 $(call MSG_GENERATE,RePackScripts,$@,$<)
1345 $(call VBOX_EDIT_INF_FN,$<,$@)
1346
1347$$(RePackScripts_0_OUTDIR)/VBoxExtPackPuel.inf: $(PATH_SUB_CURRENT)/Scripts/VBoxExtPackPuel.inf $(MAKEFILE_CURRENT) | $$(dir $$@)
1348 $(call MSG_GENERATE,RePackScripts,$@,$<)
1349 $(call VBOX_EDIT_INF_FN,$<,$@)
1350
1351
1352include $(FILE_KBUILD_SUB_FOOTER)
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