Makefile.kmk revision 3c3d0383bb6ce1db26a5d4ca83da998bbac6eeb5
3d090cc6f34e5970765dd1e7ee5e648a056d180dZbigniew Jędrzejewski-Szmek# Makefile for the Windows installer.
3d090cc6f34e5970765dd1e7ee5e648a056d180dZbigniew Jędrzejewski-Szmek# Copyright (C) 2006-2010 Oracle Corporation
eacbb4d33e2bb5c54311544851140efe3dd0f774Zbigniew Jędrzejewski-Szmek# This file is part of VirtualBox Open Source Edition (OSE), as
eacbb4d33e2bb5c54311544851140efe3dd0f774Zbigniew Jędrzejewski-Szmek# available from http://www.virtualbox.org. This file is free software;
eacbb4d33e2bb5c54311544851140efe3dd0f774Zbigniew Jędrzejewski-Szmek# you can redistribute it and/or modify it under the terms of the GNU
eacbb4d33e2bb5c54311544851140efe3dd0f774Zbigniew Jędrzejewski-Szmek# General Public License (GPL) as published by the Free Software
eacbb4d33e2bb5c54311544851140efe3dd0f774Zbigniew Jędrzejewski-Szmek# Foundation, in version 2 as it comes in the "COPYING" file of the
eacbb4d33e2bb5c54311544851140efe3dd0f774Zbigniew Jędrzejewski-Szmek# VirtualBox OSE distribution. VirtualBox OSE is distributed in the
eacbb4d33e2bb5c54311544851140efe3dd0f774Zbigniew Jędrzejewski-Szmek# hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
eacbb4d33e2bb5c54311544851140efe3dd0f774Zbigniew Jędrzejewski-SzmekSUB_DEPTH = ../../../..
eacbb4d33e2bb5c54311544851140efe3dd0f774Zbigniew Jędrzejewski-Szmekinclude $(KBUILD_PATH)/subheader.kmk
eacbb4d33e2bb5c54311544851140efe3dd0f774Zbigniew Jędrzejewski-Szmekifneq ($(KBUILD_HOST),win)
3d090cc6f34e5970765dd1e7ee5e648a056d180dZbigniew Jędrzejewski-Szmek $(error "The Windows installer can only be built on Windows!")
3d090cc6f34e5970765dd1e7ee5e648a056d180dZbigniew Jędrzejewski-Szmek# Include Sub-Makefiles.
eacbb4d33e2bb5c54311544851140efe3dd0f774Zbigniew Jędrzejewski-Szmekinclude $(PATH_SUB_CURRENT)/InstallHelper/Makefile.kmk
eacbb4d33e2bb5c54311544851140efe3dd0f774Zbigniew Jędrzejewski-Szmekifdef VBOX_WITH_BUNDLED_INSTALLER
eacbb4d33e2bb5c54311544851140efe3dd0f774Zbigniew Jędrzejewski-Szmek ifeq ($(KBUILD_TARGET_ARCH),x86)
eacbb4d33e2bb5c54311544851140efe3dd0f774Zbigniew Jędrzejewski-Szmek include $(PATH_SUB_CURRENT)/BundleMachine/Makefile.kmk
3d090cc6f34e5970765dd1e7ee5e648a056d180dZbigniew Jędrzejewski-Szmekifeq ($(KBUILD_TARGET_ARCH),x86)
3d090cc6f34e5970765dd1e7ee5e648a056d180dZbigniew Jędrzejewski-Szmek include $(PATH_SUB_CURRENT)/Stub/Makefile.kmk
eacbb4d33e2bb5c54311544851140efe3dd0f774Zbigniew Jędrzejewski-Szmek include $(PATH_SUB_CURRENT)/StubBld/Makefile.kmk
eacbb4d33e2bb5c54311544851140efe3dd0f774Zbigniew Jędrzejewski-Szmek ifdef VBOX_BRAND_WIN_AS_MENU
eacbb4d33e2bb5c54311544851140efe3dd0f774Zbigniew Jędrzejewski-Szmek include $(PATH_SUB_CURRENT)/AutoStartMenu/Makefile.kmk
eacbb4d33e2bb5c54311544851140efe3dd0f774Zbigniew Jędrzejewski-Szmekinclude $(PATH_SUB_CURRENT)/Resources/Makefile.kmk
eacbb4d33e2bb5c54311544851140efe3dd0f774Zbigniew Jędrzejewski-Szmek# Globals and targets.
3d090cc6f34e5970765dd1e7ee5e648a056d180dZbigniew Jędrzejewski-SzmekVBOX_INSTALLER_LANGUAGES = en_US
3d090cc6f34e5970765dd1e7ee5e648a056d180dZbigniew Jędrzejewski-SzmekVBOX_INSTALLER_LANGUAGES += $(VBOX_INSTALLER_ADD_LANGUAGES)
eacbb4d33e2bb5c54311544851140efe3dd0f774Zbigniew Jędrzejewski-SzmekVBOX_PATH_WIN_INST_SRC := $(PATH_SUB_CURRENT)
3d090cc6f34e5970765dd1e7ee5e648a056d180dZbigniew Jędrzejewski-SzmekVBOX_WIN_INST_OUT_DIR := $(PATH_TARGET)/Installer/win
3d090cc6f34e5970765dd1e7ee5e648a056d180dZbigniew Jędrzejewski-Szmek# If we want to build a combined package, we separate all common stuff
3d090cc6f34e5970765dd1e7ee5e648a056d180dZbigniew Jędrzejewski-Szmek# (that is all 100% identical content between 32-/64-bit builds)
3d090cc6f34e5970765dd1e7ee5e648a056d180dZbigniew Jędrzejewski-Szmek# into an own .cab file to save space. This .cab file then gets included
eacbb4d33e2bb5c54311544851140efe3dd0f774Zbigniew Jędrzejewski-Szmek# and used by the 32-/64-bit installers.
eacbb4d33e2bb5c54311544851140efe3dd0f774Zbigniew Jędrzejewski-Szmekifdef VBOX_WITH_COMBINED_PACKAGE
eacbb4d33e2bb5c54311544851140efe3dd0f774Zbigniew Jędrzejewski-Szmek VBOX_INSTALLER_COMMON_DISKID := 2
eacbb4d33e2bb5c54311544851140efe3dd0f774Zbigniew Jędrzejewski-Szmek VBOX_INSTALLER_COMMON_DISKID := 1
PACKAGE_NAME_MULTIARCH_COMMONCAB := common.cab
$(VBOX_WIN_INST_OUT_DIR)/VirtualBox.wixobj \
$(VBOX_WIN_INST_OUT_DIR)/VirtualBox.wixobj.dep \
$(VBOX_WIN_INST_OUT_DIR)/VirtualBox_TypeLib.wxi \
$(VBOX_WIN_INST_OUT_DIR)/VBoxGuiNLS.wxi \
$(VBOX_WIN_INST_OUT_DIR)/VBoxKey.wxi \
$(VBOX_WIN_INST_OUT_DIR)/Languages/Language_$(lang).wxl \
$(VBOX_WIN_INST_OUT_DIR)/Languages/License_$(lang).wxl \
$(VBOX_WIN_INST_OUT_DIR)/Files_Doc.wxi \
$(VBOX_WIN_INST_OUT_DIR)/Files_License.wxi
$(PATH_MULTIARCH_TEMP)/$(PACKAGE_NAME_MULTIARCH.x86) \
$(PATH_MULTIARCH_TEMP)/$(PACKAGE_NAME_MULTIARCH.am64) \
ZIP = /usr/bin/zip
VBOX_BRAND_WIN_INST_NAME.x86 = $(PACKAGE_BASE)-Win_x86$(VBOX_BRAND_WIN_INST_EXT).msi
VBOX_BRAND_WIN_INST_NAME.amd64 = $(PACKAGE_BASE)-Win_amd64$(VBOX_BRAND_WIN_INST_EXT).msi
PACKING.win += $(VBOX_PATH_PACK_BUNDLE_ZIP)
# Note: The double escaping of $(dir $@) in the prereq/dep list is because we first have
$(VBOX_WIN_INST_OUT_DIR)/Languages/Language_$(lang).wxl: $(VBOX_PATH_WIN_INST_SRC)/Languages/$(lang).wxl | $$$$(dir $$$$@)
$(VBOX_WIN_INST_OUT_DIR)/Languages/License_$(lang).wxl: $(license_file) $(MAKEFILE_CURRENT) | $$$$(dir $$$$@)
$(APPEND) $$@ '<WixLocalization xmlns="http://schemas.microsoft.com/wix/2003/11/localization" Codepage="1252">'
# Create one intermediate WXI (Windows Installer Include) file for all installers (needed for .MSI compiling).
$(VBOX_WIN_INST_OUT_DIR)/Files_Main.wxi: $(MAKEFILE_CURRENT) | $$(dir $$@)
$(APPEND) $@ ' <File Id="VirtualBox.chm" Name="VBox.chm" LongName="VirtualBox.chm" DiskId="$(VBOX_INSTALLER_COMMON_DISKID)" Vital="yes" Source="$(PATH_BIN)/VirtualBox.chm"></File>'
' <File Id="VirtualBox_$(lang).chm" Name="VB_$(lang).chm" LongName="VirtualBox_$(lang).chm" DiskId="$(VBOX_INSTALLER_COMMON_DISKID)" Vital="yes" Source="$(PATH_BIN)/VirtualBox_$(lang).chm"></File>')
$(VBOX_WIN_INST_OUT_DIR)/Files_Doc.wxi: $(MAKEFILE_CURRENT) | $$(dir $$@)
$(APPEND) $@ ' <File Id="UserManual.pdf" Name="Manual.pdf" LongName="UserManual.pdf" DiskId="$(VBOX_INSTALLER_COMMON_DISKID)" Vital="yes" Source="$(PATH_BIN)/UserManual.pdf">'
$(APPEND) $@ ' <Shortcut Id="startmenuManPDF_en_US" Directory="ProgramMenuDir" Name="M_en_US" LongName="$$(loc.StartMenu_UserManual) (English)" WorkingDirectory="INSTALLDIR"/>'
' <File Id="UserManual_$(lang).pdf" Name="Mn_$(lang).pdf" LongName="UserManual_$(lang).pdf" DiskId="$(VBOX_INSTALLER_COMMON_DISKID)" Vital="yes" Source="$(PATH_BIN)/UserManual_$(lang).pdf">' \
' <Shortcut Id="startmenuManPDF_$(lang)" Directory="ProgramMenuDir" Name="M_$(lang)" LongName="$$(loc.StartMenu_UserManual) ($(VBOX_BRAND_$(lang)_LANG_NAME))" WorkingDirectory="INSTALLDIR"/>' \
$(VBOX_WIN_INST_OUT_DIR)/Files_License.wxi: $(MAKEFILE_CURRENT) | $$(dir $$@)
$(APPEND) $@ ' <File Id="License_en_US.rtf" Name="Li_en_US.rtf" LongName="License_en_US.rtf" DiskId="$(VBOX_INSTALLER_COMMON_DISKID)" Vital="yes" Source="$(VBOX_BRAND_LICENSE_RTF)">'
$(APPEND) $@ ' <Shortcut Id="startmenuLicRTF_en_US" Directory="ProgramMenuDir" Name="L_en_US" LongName="$$(loc.StartMenu_License) (English)" WorkingDirectory="INSTALLDIR"/>'
' <File Id="License_$(lang).rtf" Name="Li_$(lang).rtf" LongName="License_$(lang).rtf" DiskId="$(VBOX_INSTALLER_COMMON_DISKID)" Vital="yes" Source="$(VBOX_BRAND_$(lang)_LICENSE_RTF)">' \
' <Shortcut Id="startmenuLicRTF_$(lang)" Directory="ProgramMenuDir" Name="L_$(lang)" LongName="$$(loc.StartMenu_License) ($(VBOX_BRAND_$(lang)_LANG_NAME))" WorkingDirectory="INSTALLDIR"/>' \
$(VBOX_WIN_INST_OUT_DIR)/Languages/Language_$(lang).wxl \
$(VBOX_WIN_INST_OUT_DIR)/Languages/License_$(lang).wxl \
$(PATH_BIN)/VBoxInstallHelper.dll \
$(VBOX_PATH_WIX)/light.exe -nologo \
-loc $(VBOX_WIN_INST_OUT_DIR)/Languages/Language_$(lang).wxl \
-loc $(VBOX_WIN_INST_OUT_DIR)/Languages/License_$(lang).wxl \
$(VBOX_PATH_WIX)/wixca.wixlib \
$(VBOX_PATH_DIFX)/DIFxApp.wixlib
-include $(VBOX_WIN_INST_OUT_DIR)/VirtualBox.wixobj.dep
VBOX_MSI_DEPENDENCIES := $(filter-out wixca.dll, $(VBOX_MSI_DEPENDENCIES))
VBOX_MSI_DEPENDENCIES := $(filer-out $(PATH_OUT)/bin/VBoxDbg3.dll, $(VBOX_MSI_DEPENDENCIES))
$(PATH_OUT)/bin/msvcrt.dll \
$(PATH_OUT)/bin/msvcr71.dll \
$(PATH_OUT)/bin/msvcp71.dll \
$(PATH_OUT)/bin/SDL_ttf.dll \
$(PATH_OUT)/bin/Microsoft.VC80.CRT/Microsoft.VC80.CRT.manifest \
$(PATH_OUT)/bin/Microsoft.VC80.CRT/msvcr80.dll \
$(PATH_OUT)/bin/Microsoft.VC80.CRT/msvcp80.dll \
$(PATH_OUT)/bin/Microsoft.VC80.CRT/msvcm80.dll \
$(PATH_OUT)/bin/VBoxREM2.rel \
$(PATH_OUT)/bin/VBoxREM32.dll \
$(PATH_OUT)/bin/VBoxREM64.dll \
$(if $(VBOX_WITH_ADDITIONS_PACKING),$(PATH_MULTIARCH_GUEST_ADDITIONS_ISO)/VBoxGuestAdditions.iso)
$(if $(VBOX_WITH_ADDITIONS_PACKING),$(VBOX_PATH_ADDITIONS)/VBoxGuestAdditions.iso)
$(PATH_SUB_CURRENT)/VirtualBox.wxs \
$(PATH_SUB_CURRENT)/UserInterface.wxi \
$(VBOX_WIN_INST_OUT_DIR)/VirtualBox_TypeLib.wxi \
$(VBOX_WIN_INST_OUT_DIR)/VBoxKey.wxi \
$(VBOX_WIN_INST_OUT_DIR)/VBoxGuiNLS.wxi \
-E 'VBOX_BRAND_$(lang)_LICENSE_RTF=$(subst /,\\,$(VBOX_BRAND_$(subst en_US_,,$(lang)_)LICENSE_RTF))') \
-E 'VBOX_WITH_DEBUGGER_GUI=$(if-expr defined(VBOX_WITH_DEBUGGER_GUI) && defined(VBOX_WITH_QTGUI),yes,no)' \
$(VBOX_PATH_WIX)/candle.exe $(filter-out $(VBOX_VERSION_STAMP),$$<) -out $$@
$(APPEND) -t $(VBOX_WIN_INST_OUT_DIR)/VirtualBox.wixobj.dep 'VBOX_MSI_DEPENDENCIES = \'
$(SED) -f $(VBOX_PATH_WIN_INST_SRC)/dep.sed \
--append $(VBOX_WIN_INST_OUT_DIR)/VirtualBox.wixobj.dep \
$(VBOX_PATH_WIN_INST_SRC)/VirtualBox.wxs \
$(VBOX_PATH_WIN_INST_SRC)/UserInterface.wxi \
$(VBOX_WIN_INST_OUT_DIR)/VirtualBox_TypeLib.wxi
$(APPEND) $(VBOX_WIN_INST_OUT_DIR)/VirtualBox.wixobj.dep ''
$(VBOX_WIN_INST_OUT_DIR)/VirtualBox_TypeLib.wxi: \
$(PATH_SUB_CURRENT)/VirtualBox_TypeLib.xsl \
include $(PATH_ROOT)/src/VBox/Frontends/VirtualBox/nls/ApprovedLanguages.kmk
$(VBOX_WIN_INST_OUT_DIR)/VBoxGuiNLS.wxi: $(PATH_ROOT)/src/VBox/Frontends/VirtualBox/nls/ApprovedLanguages.kmk $(MAKEFILE_CURRENT) | $$(dir $$@)
' <File Id="nlsqt${lang}" Name="qt_${lang}.qm" LongName="qt_${lang}.qm" DiskId="$(VBOX_INSTALLER_COMMON_DISKID)" Vital="yes" src="$$(env.PATH_OUT)\bin\nls\qt_${lang}.qm" />' \
' <File Id="nlsgui${lang}" Name="vb_${lang}.qm" LongName="VirtualBox_${lang}.qm" DiskId="$(VBOX_INSTALLER_COMMON_DISKID)" Vital="yes" src="$$(env.PATH_OUT)\bin\nls\VirtualBox_${lang}.qm" />')
$(VBOX_WIN_INST_OUT_DIR)/VBoxKey.wxi: $(PATH_SUB_CURRENT)/VBoxKey.wxi $(VBOX_VERSION_STAMP) | $$(dir $$@)
$(VBOX_WIN_INST_OUT_DIR)/$(PACKAGE_NAME_LANG)_en_US.msi \
$(REDIRECT) -C $$(@D) -- $(VBOX_PATH_MSITRAN) -g $$< $(VBOX_WIN_INST_OUT_DIR)/$(PACKAGE_NAME_LANG)_$(lang).msi $(lang).mst
$(REDIRECT) -C $$(@D) -- wscript.exe $(VBOX_PATH_WISUBSTG) $$< $(lang).mst $(lang_id)
# Create all xxx_<Lang>.msi installers and prepare the final xxx_MultiLang.msi installer.
## @todo this rule must not modify $(VBOX_WIN_INST_OUT_DIR)/$(PACKAGE_NAME_LANG)_en_US.msi but a copy of it. def_vbox_compile_wixobj is
# where en_US.msi is created, it shouldn't be changed after that (if possible). Also, document the path length issue.
VBOX_INS_PROD_ARCH.amd64 = x64
VBOX_INS_PROD_ARCH.x86 = Intel
$(foreach lang, $(VBOX_INSTALLER_ADD_LANGUAGES), $(eval VBOX_INS_PROD_LANG := $(VBOX_INS_PROD_LANG)$(COMMA)$(VBOX_BRAND_$(lang)_LANG_ID)))
$(VBOX_WIN_INST_OUT_DIR)/Files_Main.wxi \
$(VBOX_WIN_INST_OUT_DIR)/Files_Doc.wxi \
$(VBOX_WIN_INST_OUT_DIR)/Files_License.wxi \
$(foreach lang,$(VBOX_INSTALLER_LANGUAGES), $(VBOX_WIN_INST_OUT_DIR)/$(PACKAGE_NAME_LANG)_$(lang).msi) \
wscript.exe $(VBOX_PATH_WISUMINFO) $(VBOX_WIN_INST_OUT_DIR)/$(PACKAGE_NAME_LANG)_en_US.msi $(VBOX_INS_PROD_LANG)
$(CP) -f $(VBOX_WIN_INST_OUT_DIR)/$(PACKAGE_NAME_LANG)_en_US.msi $@
$(PATH_MULTIARCH_TEMP)/$(PACKAGE_NAME_MULTIARCH.x86) \
$(PATH_MULTIARCH_TEMP)/$(PACKAGE_NAME_MULTIARCH.amd64)
-target-x86 $(PATH_MULTIARCH_TEMP)/$(PACKAGE_NAME_MULTIARCH.x86) \
-target-amd64 $(PATH_MULTIARCH_TEMP)/$(PACKAGE_NAME_MULTIARCH.amd64) \
-stub $(PATH_BIN)/VBoxStub.exe
$(PATH_BIN)/VBoxBundleMachine.exe \
$(if $(VBOX_BRAND_WIN_AS_MENU), $(PATH_BIN)/AutoStartMenu.exe) \
$(CP) $(PACKAGE_NAME_FINAL) $(VBOX_PATH_PACK_BUNDLE_TMP)/$(VBOX_BRAND_WIN_INST_NAME.$(KBUILD_TARGET_ARCH))
$(CP) $(PATH_BIN)/$(PACKAGE_NAME_MULTIARCH_FINAL) $(VBOX_PATH_PACK_BUNDLE_TMP)/$(PACKAGE_NAME_MULTIARCH_FINAL)
$(CP) $(PATH_BIN)/VBoxBundleMachine.exe $(VBOX_PATH_PACK_BUNDLE_TMP)/
$(CP) $(PATH_BIN)/AutoStartMenu.exe $(VBOX_PATH_PACK_BUNDLE_TMP)/
$(MKDIR) -p $(VBOX_PATH_PACK_BUNDLE_TMP)/Menu/Graphics/
$(CP) $(VBOX_BRAND_WIN_AS_MENU_CONTENT_GFX) $(VBOX_PATH_PACK_BUNDLE_TMP)/Menu/Graphics/
$(SED) -e 's/VBOXEXE/$(PACKAGE_NAME_MULTIARCH_FINAL)/g' \
--output $(VBOX_PATH_PACK_BUNDLE_TMP)/Menu/index.html \
$(VBOX_BRAND_WIN_AS_MENU)/index_combined.html
--output $(VBOX_PATH_PACK_BUNDLE_TMP)/Menu/index.html \
$(VBOX_BRAND_WIN_AS_MENU)/index.html
include $(KBUILD_PATH)/subfooter.kmk