Index: trunk/src/VBox/Additions/WINNT/Installer/Makefile.kmk
===================================================================
--- trunk/src/VBox/Additions/WINNT/Installer/Makefile.kmk	(revision 96687)
+++ trunk/src/VBox/Additions/WINNT/Installer/Makefile.kmk	(revision 96688)
@@ -29,13 +29,26 @@
 include $(KBUILD_PATH)/subheader.kmk
 
+#
 # Include Sub-Makefiles.
+#
 include $(PATH_SUB_CURRENT)/Loader/Makefile.kmk
 include $(PATH_SUB_CURRENT)/InstallHelper/Makefile.kmk
 
+
+#
 # Globals
+#
 VBOX_PATH_WIN_ADD_INS_SRC := $(PATH_SUB_CURRENT)
 VBOX_PATH_ADDITIONS.win.x86 := $(PATH_OUT_BASE)/win.x86/$(KBUILD_TYPE)/bin/additions
 VBOX_WITH_GUEST_INSTALL_HELPER := 1 # Use our guest install helper DLL.
 ## @todo VBOX_WIN_ADD_INS_OUT_DIR := $(PATH_TARGET)/Additions/Installer/win
+
+ifdef VBOX_GA_ATTESTATION_SIGNING
+ VBOX_DRIVERS_PACK_NAME := VBoxDrivers-$(VBOX_VERSION_MAJOR).$(VBOX_VERSION_MINOR).$(VBOX_VERSION_BUILD)r$(VBOX_SVN_REV)-$(KBUILD_TARGET_ARCH).cab
+ VBOX_SIGNED_DRIVERS_ZIP_NAME := $(VBOX_DRIVERS_PACK_NAME).Signed.zip
+ include $(KBUILD_PATH)/tools/ZIP.kmk
+ TOOL_ZIP_PACK ?= zip
+endif
+
 
 #
@@ -59,4 +72,5 @@
 VBoxDrvInst_VBOX_IMPORT_CHECKER.win.x86 := nt4 # setupapi was introduced in NT4
 
+
 #
 # RegCleanup - A NT4 post-install registry cleanup helper preventing the
@@ -72,14 +86,12 @@
 RegCleanup_VBOX_IMPORT_CHECKER.win.x86 := nt4
 
+
 #
 # The installer.
 #
 PACKING     += $(PATH_STAGE_BIN)/additions/VBoxWindowsAdditions-$(KBUILD_TARGET_ARCH).exe
-OTHER_CLEAN += \
-	$(PATH_STAGE_BIN)/additions/VBoxWindowsAdditions-$(KBUILD_TARGET_ARCH).exe
-
-## @todo r=andy Rename DRIVER_FILES to INST_FILES or something, as those files are not strictly driver-related files.
-
-DRIVER_FILES := \
+OTHER_CLEAN += $(PATH_STAGE_BIN)/additions/VBoxWindowsAdditions-$(KBUILD_TARGET_ARCH).exe
+
+VBOX_WINDOWS_ADDITIONS_DEPS := \
 	$(PATH_STAGE_BIN)/additions/RegCleanup.exe \
 	$(PATH_STAGE_BIN)/additions/VBoxMouse.sys \
@@ -93,20 +105,20 @@
 	$(PATH_STAGE_BIN)/additions/VBoxService.exe
 ifeq ($(KBUILD_TARGET_ARCH),amd64)
-      # Also include 32-bit network provider DLLs on 64-bit guests to enable
-      # running 32-bit apps which use that.
-      DRIVER_FILES += \
-		$(PATH_STAGE_BIN)/additions/VBoxMRXNP-x86.dll
+# Also include 32-bit network provider DLLs on 64-bit guests to enable
+# running 32-bit apps which use that.
+VBOX_WINDOWS_ADDITIONS_DEPS += \
+	$(PATH_STAGE_BIN)/additions/VBoxMRXNP-x86.dll
 endif
 ifeq ($(KBUILD_TARGET_ARCH),x86)
-DRIVER_FILES += \
+VBOX_WINDOWS_ADDITIONS_DEPS += \
 	$(PATH_STAGE_BIN)/additions/VBoxMouseNT.sys \
 	$(PATH_STAGE_BIN)/additions/VBoxSFW2K.sys
 endif
-DRIVER_FILES += \
+VBOX_WINDOWS_ADDITIONS_DEPS += \
 	$(PATH_STAGE_BIN)/additions/VBoxVideo.inf \
 	$(PATH_STAGE_BIN)/additions/VBoxGuest.inf \
 	$(PATH_STAGE_BIN)/additions/VBoxMouse.inf
 ifdef VBOX_SIGN_ADDITIONS
-DRIVER_FILES += \
+VBOX_WINDOWS_ADDITIONS_DEPS += \
 	$(PATH_STAGE_BIN)/additions/VBoxVideo.cat \
 	$(PATH_STAGE_BIN)/additions/VBoxVideo-PreW10.cat \
@@ -117,14 +129,14 @@
 endif
 ifdef VBOX_WITH_WDDM
-DRIVER_FILES += \
+VBOX_WINDOWS_ADDITIONS_DEPS += \
 	$(PATH_STAGE_BIN)/additions/VBoxWddm.sys \
 	$(PATH_STAGE_BIN)/additions/VBoxWddm.inf \
 	$(PATH_STAGE_BIN)/additions/VBoxDispD3D.dll
  ifdef VBOX_WITH_WDDM_DX
-DRIVER_FILES += \
+VBOX_WINDOWS_ADDITIONS_DEPS += \
 	$(PATH_STAGE_BIN)/additions/VBoxDX.dll
  endif
  ifdef VBOX_WITH_MESA3D
-DRIVER_FILES += \
+VBOX_WINDOWS_ADDITIONS_DEPS += \
 	$(PATH_STAGE_BIN)/additions/VBoxNine.dll \
 	$(PATH_STAGE_BIN)/additions/VBoxSVGA.dll \
@@ -132,17 +144,17 @@
  endif
  ifdef VBOX_SIGN_ADDITIONS
-DRIVER_FILES += \
+VBOX_WINDOWS_ADDITIONS_DEPS += \
 	$(PATH_STAGE_BIN)/additions/VBoxWddm.cat \
 	$(PATH_STAGE_BIN)/additions/VBoxWddm-PreW10.cat
  endif
  ifeq ($(KBUILD_TARGET_ARCH),amd64)
-DRIVER_FILES += \
+VBOX_WINDOWS_ADDITIONS_DEPS += \
 	$(PATH_STAGE_BIN)/additions/VBoxDispD3D-x86.dll
   ifdef VBOX_WITH_WDDM_DX
-DRIVER_FILES += \
+VBOX_WINDOWS_ADDITIONS_DEPS += \
 	$(PATH_STAGE_BIN)/additions/VBoxDX-x86.dll
   endif
   ifdef VBOX_WITH_MESA3D
-DRIVER_FILES += \
+VBOX_WINDOWS_ADDITIONS_DEPS += \
 	$(PATH_STAGE_BIN)/additions/VBoxNine-x86.dll \
 	$(PATH_STAGE_BIN)/additions/VBoxSVGA-x86.dll \
@@ -153,6 +165,6 @@
 
 ifdef env.VBOX_WITH_ADDITIONS_SHIPPING_AUDIO_TEST
- DRIVER_FILES += \
-  $(PATH_STAGE_BIN)/additions/VBoxAudioTest.exe
+VBOX_WINDOWS_ADDITIONS_DEPS += \
+	$(PATH_STAGE_BIN)/additions/VBoxAudioTest.exe
 endif
 
@@ -188,4 +200,37 @@
 	-E 'KBUILD_TARGET_ARCH=$(KBUILD_TARGET_ARCH)'
 
+$(PATH_STAGE_BIN)/additions/VBoxWindowsAdditions-$(KBUILD_TARGET_ARCH).exe: \
+		$(PATH_SUB_CURRENT)/VBoxGuestAdditions.nsi \
+		$(PATH_SUB_CURRENT)/VBoxGuestAdditionsCommon.nsh \
+		$(PATH_SUB_CURRENT)/VBoxGuestAdditionsExternal.nsh \
+		$(PATH_SUB_CURRENT)/VBoxGuestAdditionsLog.nsh \
+		$(PATH_SUB_CURRENT)/VBoxGuestAdditionsUninstall.nsh \
+		$(PATH_SUB_CURRENT)/VBoxGuestAdditionsUninstallOld.nsh \
+		$(PATH_SUB_CURRENT)/VBoxGuestAdditionsW2KXP.nsh \
+		$(PATH_SUB_CURRENT)/VBoxGuestAdditionsVista.nsh \
+		$(PATH_SUB_CURRENT)/VBoxGuestAdditionsNT4.nsh \
+		$(VBOX_WINDOWS_ADDITIONS_DEPS) \
+		$(VBOX_WINDOWS_ADDITIONS_ICON_FILE) \
+		$(VBOX_NSIS_ICON_FILE) \
+		$(if $(VBOX_SIGNING_MODE),$(PATH_TARGET)/uninst.exe) \
+		$(if $(VBOX_GA_ATTESTATION_SIGNING),$(PATH_OUT)/repackadd/$(VBOX_SIGNED_DRIVERS_ZIP_NAME)) \
+		$(VBOX_VERSION_STAMP) \
+		$$(VBoxDrvInst_1_STAGE_TARGET)
+	$(call MSG_L1,Creating $@, from $<)
+ifdef VBOX_GA_ATTESTATION_SIGNING # Unpack the attestation signed drivers
+	$(TOOL_ZIP_UNPACK) -voj $(PATH_OUT)/repackadd/$(VBOX_SIGNED_DRIVERS_ZIP_NAME) -d $(PATH_STAGE_BIN)/additions/
+endif
+	$(QUIET)$(REDIRECT) -C $(VBOX_PATH_WIN_ADD_INS_SRC) \
+		$(VB_WIN_ADD_NSIS_ENV) \
+		-- $(EXEC_X86_WIN32) $(VBOX_PATH_NSIS)/makensis.exe /NOCD /V2 \
+			$(if $(VBOX_SIGN_ADDITIONS),'/DVBOX_SIGN_ADDITIONS=1') \
+			$(if $(VBOX_SIGNING_MODE),'/DEXTERNAL_UNINSTALLER=1') \
+			$(if $(VBOX_WITH_VBOX_LEGACY_TS_CA),'/DVBOX_WITH_VBOX_LEGACY_TS_CA=1') \
+			$(if $(VBOX_INSTALLER_ADD_LANGUAGES),'/DVBOX_INSTALLER_ADD_LANGUAGES=1') \
+			$(foreach lang,$(VBOX_INSTALLER_ADD_LANGUAGES),'/DVBOX_BRAND_$(lang)_LICENSE_RTF=1') \
+			'$(subst /,\,$<)'
+	$(call VBOX_SIGN_FILE_FN,$@)
+
+
 ifdef VBOX_SIGNING_MODE
 #
@@ -193,6 +238,7 @@
 # See http://nsis.sourceforge.net/Signing_an_Uninstaller for more details.
 #
-OTHER_CLEAN += $(PATH_TARGET)/VBoxWindowsAdditions-$(KBUILD_TARGET_ARCH)-uninst.exe
-
+OTHER_CLEAN += \
+	$(PATH_TARGET)/VBoxWindowsAdditions-$(KBUILD_TARGET_ARCH)-uninst.exe \
+	$(PATH_TARGET)/uninst.exe
 $(PATH_TARGET)/VBoxWindowsAdditions-$(KBUILD_TARGET_ARCH)-uninst.exe: \
 		$(PATH_SUB_CURRENT)/VBoxGuestAdditions.nsi \
@@ -205,5 +251,5 @@
 		$(PATH_SUB_CURRENT)/VBoxGuestAdditionsVista.nsh \
 		$(PATH_SUB_CURRENT)/VBoxGuestAdditionsNT4.nsh \
-		$(DRIVER_FILES) \
+		$(VBOX_WINDOWS_ADDITIONS_DEPS) \
 		$(VBOX_WINDOWS_ADDITIONS_ICON_FILE) \
 		$(VBOX_NSIS_ICON_FILE) \
@@ -222,5 +268,4 @@
 			'$(subst /,\,$<)'
 
-OTHER_CLEAN += $(PATH_TARGET)/uninst.exe
 $(PATH_TARGET)/uninst.exe: $(PATH_TARGET)/VBoxWindowsAdditions-$(KBUILD_TARGET_ARCH)-uninst.exe | $$(dir $$@)
 	$(call MSG_L1,Creating $@, from $<)
@@ -229,48 +274,12 @@
 	$(TEST) -f $@
 	$(call VBOX_SIGN_FILE_FN,$@)
-endif
+
+endif # VBOX_SIGNING_MODE
+
 
 ifdef VBOX_GA_ATTESTATION_SIGNING
-VBOX_DRIVERS_PACK_NAME := VBoxDrivers-$(VBOX_VERSION_MAJOR).$(VBOX_VERSION_MINOR).$(VBOX_VERSION_BUILD)r$(VBOX_SVN_REV)-$(KBUILD_TARGET_ARCH).cab
-VBOX_SIGNED_DRIVERS_ZIP_NAME := $(VBOX_DRIVERS_PACK_NAME).Signed.zip
-include $(KBUILD_PATH)/tools/ZIP.kmk
-ifndef TOOL_ZIP_PACK
- TOOL_ZIP_PACK = zip
-endif
-endif
-
-$(PATH_STAGE_BIN)/additions/VBoxWindowsAdditions-$(KBUILD_TARGET_ARCH).exe: \
-		$(PATH_SUB_CURRENT)/VBoxGuestAdditions.nsi \
-		$(PATH_SUB_CURRENT)/VBoxGuestAdditionsCommon.nsh \
-		$(PATH_SUB_CURRENT)/VBoxGuestAdditionsExternal.nsh \
-		$(PATH_SUB_CURRENT)/VBoxGuestAdditionsLog.nsh \
-		$(PATH_SUB_CURRENT)/VBoxGuestAdditionsUninstall.nsh \
-		$(PATH_SUB_CURRENT)/VBoxGuestAdditionsUninstallOld.nsh \
-		$(PATH_SUB_CURRENT)/VBoxGuestAdditionsW2KXP.nsh \
-		$(PATH_SUB_CURRENT)/VBoxGuestAdditionsVista.nsh \
-		$(PATH_SUB_CURRENT)/VBoxGuestAdditionsNT4.nsh \
-		$(DRIVER_FILES) \
-		$(VBOX_WINDOWS_ADDITIONS_ICON_FILE) \
-		$(VBOX_NSIS_ICON_FILE) \
-		$(if $(VBOX_SIGNING_MODE),$(PATH_TARGET)/uninst.exe) \
-		$(if $(VBOX_GA_ATTESTATION_SIGNING),$(PATH_OUT)/repackadd/$(VBOX_SIGNED_DRIVERS_ZIP_NAME)) \
-		$(VBOX_VERSION_STAMP) \
-		$$(VBoxDrvInst_1_STAGE_TARGET)
-	$(call MSG_L1,Creating $@, from $<)
-ifdef VBOX_GA_ATTESTATION_SIGNING
-	$(TOOL_ZIP_UNPACK) -oj $(PATH_OUT)/repackadd/$(VBOX_SIGNED_DRIVERS_ZIP_NAME) -d $(PATH_STAGE_BIN)/additions/
-endif
-	$(QUIET)$(REDIRECT) -C $(VBOX_PATH_WIN_ADD_INS_SRC) \
-		$(VB_WIN_ADD_NSIS_ENV) \
-		-- $(EXEC_X86_WIN32) $(VBOX_PATH_NSIS)/makensis.exe /NOCD /V2 \
-			$(if $(VBOX_SIGN_ADDITIONS),'/DVBOX_SIGN_ADDITIONS=1') \
-			$(if $(VBOX_SIGNING_MODE),'/DEXTERNAL_UNINSTALLER=1') \
-			$(if $(VBOX_WITH_VBOX_LEGACY_TS_CA),'/DVBOX_WITH_VBOX_LEGACY_TS_CA=1') \
-			$(if $(VBOX_INSTALLER_ADD_LANGUAGES),'/DVBOX_INSTALLER_ADD_LANGUAGES=1') \
-			$(foreach lang,$(VBOX_INSTALLER_ADD_LANGUAGES),'/DVBOX_BRAND_$(lang)_LICENSE_RTF=1') \
-			'$(subst /,\,$<)'
-	$(call VBOX_SIGN_FILE_FN,$@)
-
-ifdef VBOX_GA_ATTESTATION_SIGNING
+#
+# This automagically attestation signs the GA drivers.
+#
 $(PATH_OUT)/repackadd/$(VBOX_SIGNED_DRIVERS_ZIP_NAME): \
 		$(PATH_OUT)/repackadd/sign-attestation.sh \
@@ -280,13 +289,18 @@
 	$(MV_EXT) $(PATH_OUT)/repackadd/$(VBOX_DRIVERS_PACK_NAME).*.zip $(PATH_OUT)/repackadd/$(VBOX_SIGNED_DRIVERS_ZIP_NAME)
 
+#
+# This creates a .CAB file of the driver files that should be attestation signed.
+#
 $(PATH_OUT)/repackadd/$(VBOX_DRIVERS_PACK_NAME): \
-		$(PATH_OUT)/repackadd/PackDriversForSubmission.cmd
+		$(PATH_OUT)/repackadd/PackDriversForSubmission.cmd ## @todo r=bird: Missing almost all driver file dependencies.
 	$(RM_EXT) -f $(PATH_OUT)/repackadd/*.cab
 	$(RM_EXT) -f $(PATH_OUT)/repackadd/*.ddf
 	$(RM_EXT) -f $(PATH_OUT)/repackadd/*.inf
 	$(RM_EXT) -f $(PATH_OUT)/repackadd/*.rpt
-	$(EXEC_X86_WIN32) cmd /c $(PATH_OUT)/repackadd/PackDriversForSubmission.cmd -b $(PATH_STAGE_BIN) -a $(KBUILD_TARGET_ARCH) -x -n --no-main --ga -o $(PATH_OUT)/repackadd/$(VBOX_DRIVERS_PACK_NAME)
+	$(EXEC_X86_WIN32) cmd /c $(PATH_OUT)/repackadd/PackDriversForSubmission.cmd -b $(PATH_STAGE_BIN) -a $(KBUILD_TARGET_ARCH) \
+		-x -n --no-main --ga -o $(PATH_OUT)/repackadd/$(VBOX_DRIVERS_PACK_NAME)
 	$(call VBOX_SIGN_EV_FILE_FN,$@)
-endif #VBOX_GA_ATTESTATION_SIGNING
+endif # VBOX_GA_ATTESTATION_SIGNING
+
 
 #
