VirtualBox

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

Last change on this file since 72047 was 72047, checked in by vboxsync, 7 years ago

Installer/win,Config.kmk: First draft of toplevel scripts for combined builds. Added revision as comment on inf-files. Added VBOX_EDIT_VERSION_AND_BUILD_RULE_FN macro. bugref:8691

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