VirtualBox

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

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

Installer/win: Fix typos breaking the re-packing scripts. Include the target arch in the name of the MSM files (helps when copying them all to the output directory after repacking). Move most of the clean up out of the defines (where it needs eval) to normal OTHER_CLEAN. bugref:8691

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