Index: /trunk/src/VBox/Installer/win/InstallHelper/VBoxInstallHelper.cpp
===================================================================
--- /trunk/src/VBox/Installer/win/InstallHelper/VBoxInstallHelper.cpp	(revision 41023)
+++ /trunk/src/VBox/Installer/win/InstallHelper/VBoxInstallHelper.cpp	(revision 41024)
@@ -943,9 +943,9 @@
         if (FAILED(hr))
         {
-            logStringW(hModule, L"RemoveHostOnlyInterfaces: NetAdp uninstalled successfully, but failed to remove infs\n");
+            logStringW(hModule, L"RemoveHostOnlyInterfaces: NetAdp uninstalled successfully, but failed to remove infs");
         }
     }
     else
-        logStringW(hModule, L"RemoveHostOnlyInterfaces: NetAdp uninstall failed, hr = 0x%x\n", hr);
+        logStringW(hModule, L"RemoveHostOnlyInterfaces: NetAdp uninstall failed, hr = 0x%x", hr);
 
     /* Restore original setup mode. */
@@ -965,5 +965,5 @@
     netCfgLoggerEnable(hModule);
 
-    logStringW(hModule, L"StopHostOnlyInterfaces: Stopping all host-only Interfaces");
+    logStringW(hModule, L"StopHostOnlyInterfaces: Stopping all host-only interfaces");
 
     BOOL bSetupModeInteractive = SetupSetNonInteractiveMode(FALSE);
@@ -974,10 +974,8 @@
         hr = VBoxDrvCfgInfUninstallAllSetupDi(&GUID_DEVCLASS_NET, NETADP_ID, L"Net", 0/* could be SUOI_FORCEDELETE */);
         if (FAILED(hr))
-        {
-            logStringW(hModule, L"RemoveHostOnlyInterfaces: VBoxDrvCfgInfUninstallAllSetupDi failed hr = 0x%x\n", hr);
-        }
+            logStringW(hModule, L"StopHostOnlyInterfaces: VBoxDrvCfgInfUninstallAllSetupDi failed, hr = 0x%x", hr);
     }
     else
-        logStringW(hModule, L"RemoveHostOnlyInterfaces: NetAdp uninstall failed, hr = 0x%x\n", hr);
+        logStringW(hModule, L"StopHostOnlyInterfaces: Disabling host interfaces failed, hr = 0x%x", hr);
 
     /* Restore original setup mode. */
@@ -997,5 +995,5 @@
     netCfgLoggerEnable(hModule);
 
-    logStringW(hModule, L"UpdateHostOnlyInterfaces: Updating all host-only Interfaces");
+    logStringW(hModule, L"UpdateHostOnlyInterfaces: Updating all host-only interfaces");
 
     BOOL bSetupModeInteractive = SetupSetNonInteractiveMode(FALSE);
@@ -1023,18 +1021,31 @@
             logStringW(hModule, L"UpdateHostOnlyInterfaces: Resulting INF path = %s", pwszInfPath);
 
-            BOOL fRebootRequired = FALSE;
-            HRESULT hr = VBoxNetCfgWinUpdateHostOnlyNetworkInterface(pwszInfPath, &fRebootRequired);
-            if (SUCCEEDED(hr))
-            {
-                if (fRebootRequired)
+            DWORD attrFile = GetFileAttributesW(pwszInfPath);
+            if (attrFile == INVALID_FILE_ATTRIBUTES)
+            {
+                DWORD dwErr = GetLastError();
+                logStringW(hModule, L"UpdateHostOnlyInterfaces: File \"%s\" not found, dwErr=%ld",
+                           pwszInfPath, dwErr);
+            }
+            else
+            {
+                logStringW(hModule, L"UpdateHostOnlyInterfaces: File \"%s\" exists",
+                           pwszInfPath);
+
+                BOOL fRebootRequired = FALSE;
+                HRESULT hr = VBoxNetCfgWinUpdateHostOnlyNetworkInterface(pwszInfPath, &fRebootRequired);
+                if (SUCCEEDED(hr))
                 {
-                    logStringW(hModule, L"Reboot required, setting REBOOT property to Force");
-                    HRESULT hr2 = MsiSetPropertyW(hModule, L"REBOOT", L"Force");
-                    if (hr2 != ERROR_SUCCESS)
-                        logStringW(hModule, L"Failed to set REBOOT property, error = 0x%x", hr2);
+                    if (fRebootRequired)
+                    {
+                        logStringW(hModule, L"UpdateHostOnlyInterfaces: Reboot required, setting REBOOT property to force");
+                        HRESULT hr2 = MsiSetPropertyW(hModule, L"REBOOT", L"Force");
+                        if (hr2 != ERROR_SUCCESS)
+                            logStringW(hModule, L"UpdateHostOnlyInterfaces: Failed to set REBOOT property, error = 0x%x", hr2);
+                    }
                 }
-            }
-            else
-                logStringW(hModule, L"UpdateHostOnlyInterfaces: VBoxNetCfgWinUpdateHostOnlyNetworkInterface failed, hr = 0x%x", hr);
+                else
+                    logStringW(hModule, L"UpdateHostOnlyInterfaces: VBoxNetCfgWinUpdateHostOnlyNetworkInterface failed, hr = 0x%x", hr);
+            }
         }
         else
Index: /trunk/src/VBox/Installer/win/VirtualBox.wxs
===================================================================
--- /trunk/src/VBox/Installer/win/VirtualBox.wxs	(revision 41023)
+++ /trunk/src/VBox/Installer/win/VirtualBox.wxs	(revision 41024)
@@ -59,5 +59,7 @@
     <!-- Note: GUIDs in WiX *must* be uppercase! -->
     <!-- Always include an upgrade ID or otherwise upgrade installation will not be possible. When doing
-         a major upgrade (more than just fixing a few files) change the product GUID. -->
+         a major upgrade (more than just fixing a few files) change the product GUID. We always do a major
+         upgrade even for minor VBox updates. For that only change the product ID and the product version.
+         The upgrade code *never* must be changed! -->
 
     <!-- Update / Upgrade policies:
@@ -78,5 +80,4 @@
              Manufacturer="$(env.VBOX_VENDOR)">
 
-        <!-- Package GUIDs must be different for each package. The "???" directs WiX to create one. -->
         <Package Id="*" Keywords="Installer"
                  Description="$(env.VBOX_PRODUCT) $(var.Property_VersionExt) installation package"
@@ -686,5 +687,5 @@
                  Description="!(loc.VB_App)"
                  ConfigurableDirectory="INSTALLDIR" TypicalDefault="install" Display="expand"
-                 Absent="disallow">
+                 Absent="disallow" AllowAdvertise="no" >
 
             <ComponentRef Id="cp_StartMenuVBox" />
@@ -717,5 +718,6 @@
             <Feature Id="VBoxUSB" Title="VirtualBox USB Support" Level="1"
                      Description="!(loc.VB_USBDriver)"
-                     ConfigurableDirectory="INSTALLDIR" TypicalDefault="install" Display="expand" >
+                     ConfigurableDirectory="INSTALLDIR" TypicalDefault="install" Display="expand"
+                     Absent="allow" AllowAdvertise="no" >
                 <ComponentRef Id="cp_USBFilterDriver" />
                 <ComponentRef Id="cp_USBDeviceDriver" />
@@ -725,15 +727,18 @@
             <Feature Id="VBoxNetwork" Title="VirtualBox Networking" Level="1"
                      Description="!(loc.VB_Network)"
-                     ConfigurableDirectory="INSTALLDIR" TypicalDefault="install" Display="expand" >
-                 <Feature Id="VBoxNetworkFlt" Title="VirtualBox Bridged Networking" Level="1"
-                          Description="!(loc.VB_NetFltDriver)"
-                          ConfigurableDirectory="INSTALLDIR" TypicalDefault="install" Display="expand" >
-                     <ComponentRef Id="cp_NetFltDriver" />
-                 </Feature>
-                 <Feature Id="VBoxNetworkAdp" Title="VirtualBox Host-Only Networking" Level="1"
-                          Description="!(loc.VB_NetAdpDriver)"
-                          ConfigurableDirectory="INSTALLDIR" TypicalDefault="install" Display="expand" >
-                     <ComponentRef Id="cp_NetAdpDriver" />
-                 </Feature>
+                     ConfigurableDirectory="INSTALLDIR" TypicalDefault="install" Display="expand"
+                     Absent="allow" AllowAdvertise="no" >
+                <Feature Id="VBoxNetworkFlt" Title="VirtualBox Bridged Networking" Level="1"
+                         Description="!(loc.VB_NetFltDriver)"
+                         ConfigurableDirectory="INSTALLDIR" TypicalDefault="install" Display="expand"
+                         Absent="allow" AllowAdvertise="no" >
+                    <ComponentRef Id="cp_NetFltDriver" />
+                </Feature>
+                <Feature Id="VBoxNetworkAdp" Title="VirtualBox Host-Only Networking" Level="1"
+                         Description="!(loc.VB_NetAdpDriver)"
+                         ConfigurableDirectory="INSTALLDIR" TypicalDefault="install" Display="expand"
+                         Absent="allow" AllowAdvertise="no" >
+                    <ComponentRef Id="cp_NetAdpDriver" />
+                </Feature>
             </Feature>
 <?endif?>
@@ -742,5 +747,6 @@
             <Feature Id="VBoxPython" Title="VirtualBox Python 2.x Support" Level="1"
                     Description="!(loc.VB_Python)"
-                    ConfigurableDirectory="INSTALLDIR" TypicalDefault="install" Display="expand" >
+                    ConfigurableDirectory="INSTALLDIR" TypicalDefault="install" Display="expand"
+                    Absent="allow" AllowAdvertise="no" >
                 <ComponentRef Id="cp_VBoxPythonBinding" />
             </Feature>
@@ -753,9 +759,44 @@
 
         <InstallExecuteSequence>
+
+            <!--
+                To debug the action sequences, do: "msiexec /i <VBox.msi> /lar <Logfile>"
+
+                InstallUISequence (client side) is:
+                    AppSearch
+                    LaunchConditions
+                    ValidateProductID
+                    CostInitialize
+                    FileCost
+                    CostFinalize
+                    ExecuteAction -> will pass control over to "InstallExecuteSequence"
+
+                The first six actions above will be repeated but skipped on the server
+                side if already run on the client side.
+
+                InstallExecuteSequence (server side) is:
+                    <First six action from InstallUISequence>
+                    .
+                    InstallInitialize
+                    .
+                    InstallFinalize
+
+                The actions between InstallInitialize and InstallFinalize will be gone through twice:
+                - The first time the installer creates an installation script containing all actions in the right
+                  sequence which need to get executed in a batch later. At this point the launch conditions for
+                  custom actions must be met already!
+                - The second time the generated installation script will be run as-is.
+
+                Also, the InstallUISequence and InstallExecuteSequence tables run in different sessions which
+                need public properties (that is, UPPERCASE properties).
+            -->
 
             <!-- AppSearch must be done before "RemoveExistingProducts" and before "FindRelatedProducts". -->
             <AppSearch Sequence="1"></AppSearch>
             <LaunchConditions After="AppSearch" />
-            <RemoveExistingProducts After="InstallValidate"><![CDATA[NEWERVERSIONDETECTED OR PREVIOUSVERSIONSINSTALLED]]></RemoveExistingProducts>
+
+            <!-- First install the new version and then remove the old version. This is more efficient. -->
+            <InstallExecute Before="RemoveExistingProducts" />
+            <RemoveExistingProducts Before="InstallFinalize" />
 
             <Custom Action="ca_OriginalTargetDir" After="FileCost"><![CDATA[(NOT INSTALLDIR) AND (NOT EXISTINGINSTALLDIR)]]></Custom>
@@ -765,13 +806,13 @@
 <?if $(env.VBOX_WITH_NETFLT) = "yes" ?>
             <!-- Create host-only interfaces on first-time install. -->
-            <Custom Action="ca_CreateHostOnlyInterfaceArgs" Before="ca_CreateHostOnlyInterface" ><![CDATA[&VBoxNetworkAdp=3 AND (NOT UPGRADINGPRODUCTCODE)]]></Custom>
-            <Custom Action="ca_CreateHostOnlyInterface" Before="InstallFinalize" ><![CDATA[&VBoxNetworkAdp=3 AND (NOT UPGRADINGPRODUCTCODE)]]></Custom>
+            <Custom Action="ca_CreateHostOnlyInterfaceArgs" Before="ca_CreateHostOnlyInterface" ><![CDATA[&VBoxNetworkAdp=3 AND (NOT PREVIOUSVERSIONSINSTALLED)]]></Custom>
+            <Custom Action="ca_CreateHostOnlyInterface" Before="InstallFinalize" ><![CDATA[&VBoxNetworkAdp=3 AND (NOT PREVIOUSVERSIONSINSTALLED)]]></Custom>
             <!-- Don't remove the host-only interfaces on update, only on uninstall. -->
             <Custom Action="ca_RemoveHostOnlyInterfaces" After="ca_UninstallNetFlt" ><![CDATA[(NOT UPGRADINGPRODUCTCODE) AND (REMOVE="ALL")]]></Custom>
             <!-- First stop the existing host-only interfaces on updat ... -->
-            <Custom Action="ca_StopHostOnlyInterfaces" Before="ca_UpdateHostOnlyInterfaces" ><![CDATA[&VBoxNetworkAdp=3 AND (UPGRADINGPRODUCTCODE)]]></Custom>
+            <Custom Action="ca_StopHostOnlyInterfaces" Before="ca_UpdateHostOnlyInterfaces" ><![CDATA[UPGRADINGPRODUCTCODE]]></Custom>
             <!-- ... then do the actual driver update. -->
-            <Custom Action="ca_UpdateHostOnlyInterfacesArgs" Before="ca_UpdateHostOnlyInterfaces" ><![CDATA[&VBoxNetworkAdp=3 AND (UPGRADINGPRODUCTCODE)]]></Custom>
-            <Custom Action="ca_UpdateHostOnlyInterfaces" Before="InstallFinalize" ><![CDATA[&VBoxNetworkAdp=3 AND (UPGRADINGPRODUCTCODE)]]></Custom>
+            <Custom Action="ca_UpdateHostOnlyInterfacesArgs" Before="ca_UpdateHostOnlyInterfaces" ><![CDATA[Installed AND UPGRADINGPRODUCTCODE]]></Custom>
+            <Custom Action="ca_UpdateHostOnlyInterfaces" Before="InstallFiles" ><![CDATA[Installed AND UPGRADINGPRODUCTCODE]]></Custom>
 
             <Custom Action="ca_RollbackInstallNetFltArgs" Before="ca_RollbackInstallNetFlt" ><![CDATA[&VBoxNetworkFlt=3]]></Custom>
