VirtualBox

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

Last change on this file since 77327 was 77327, checked in by vboxsync, 6 years ago

Installer/win: fix escaping (was showing up in the MSM case, but the issue was also present in the regular one, masked by lack of "" which is now also made consistent)

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