VirtualBox

Changeset 41024 in vbox for trunk/src/VBox/Installer/win


Ignore:
Timestamp:
Apr 23, 2012 12:51:21 PM (13 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
77585
Message:

Windows host installer: Fixed deletion of installed host-only adapter on update, fixed allowing features to be installed on demand (advertising), added some more logging to install helper DLL.

Location:
trunk/src/VBox/Installer/win
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Installer/win/InstallHelper/VBoxInstallHelper.cpp

    r40997 r41024  
    943943        if (FAILED(hr))
    944944        {
    945             logStringW(hModule, L"RemoveHostOnlyInterfaces: NetAdp uninstalled successfully, but failed to remove infs\n");
     945            logStringW(hModule, L"RemoveHostOnlyInterfaces: NetAdp uninstalled successfully, but failed to remove infs");
    946946        }
    947947    }
    948948    else
    949         logStringW(hModule, L"RemoveHostOnlyInterfaces: NetAdp uninstall failed, hr = 0x%x\n", hr);
     949        logStringW(hModule, L"RemoveHostOnlyInterfaces: NetAdp uninstall failed, hr = 0x%x", hr);
    950950
    951951    /* Restore original setup mode. */
     
    965965    netCfgLoggerEnable(hModule);
    966966
    967     logStringW(hModule, L"StopHostOnlyInterfaces: Stopping all host-only Interfaces");
     967    logStringW(hModule, L"StopHostOnlyInterfaces: Stopping all host-only interfaces");
    968968
    969969    BOOL bSetupModeInteractive = SetupSetNonInteractiveMode(FALSE);
     
    974974        hr = VBoxDrvCfgInfUninstallAllSetupDi(&GUID_DEVCLASS_NET, NETADP_ID, L"Net", 0/* could be SUOI_FORCEDELETE */);
    975975        if (FAILED(hr))
    976         {
    977             logStringW(hModule, L"RemoveHostOnlyInterfaces: VBoxDrvCfgInfUninstallAllSetupDi failed hr = 0x%x\n", hr);
    978         }
     976            logStringW(hModule, L"StopHostOnlyInterfaces: VBoxDrvCfgInfUninstallAllSetupDi failed, hr = 0x%x", hr);
    979977    }
    980978    else
    981         logStringW(hModule, L"RemoveHostOnlyInterfaces: NetAdp uninstall failed, hr = 0x%x\n", hr);
     979        logStringW(hModule, L"StopHostOnlyInterfaces: Disabling host interfaces failed, hr = 0x%x", hr);
    982980
    983981    /* Restore original setup mode. */
     
    997995    netCfgLoggerEnable(hModule);
    998996
    999     logStringW(hModule, L"UpdateHostOnlyInterfaces: Updating all host-only Interfaces");
     997    logStringW(hModule, L"UpdateHostOnlyInterfaces: Updating all host-only interfaces");
    1000998
    1001999    BOOL bSetupModeInteractive = SetupSetNonInteractiveMode(FALSE);
     
    10231021            logStringW(hModule, L"UpdateHostOnlyInterfaces: Resulting INF path = %s", pwszInfPath);
    10241022
    1025             BOOL fRebootRequired = FALSE;
    1026             HRESULT hr = VBoxNetCfgWinUpdateHostOnlyNetworkInterface(pwszInfPath, &fRebootRequired);
    1027             if (SUCCEEDED(hr))
    1028             {
    1029                 if (fRebootRequired)
     1023            DWORD attrFile = GetFileAttributesW(pwszInfPath);
     1024            if (attrFile == INVALID_FILE_ATTRIBUTES)
     1025            {
     1026                DWORD dwErr = GetLastError();
     1027                logStringW(hModule, L"UpdateHostOnlyInterfaces: File \"%s\" not found, dwErr=%ld",
     1028                           pwszInfPath, dwErr);
     1029            }
     1030            else
     1031            {
     1032                logStringW(hModule, L"UpdateHostOnlyInterfaces: File \"%s\" exists",
     1033                           pwszInfPath);
     1034
     1035                BOOL fRebootRequired = FALSE;
     1036                HRESULT hr = VBoxNetCfgWinUpdateHostOnlyNetworkInterface(pwszInfPath, &fRebootRequired);
     1037                if (SUCCEEDED(hr))
    10301038                {
    1031                     logStringW(hModule, L"Reboot required, setting REBOOT property to Force");
    1032                     HRESULT hr2 = MsiSetPropertyW(hModule, L"REBOOT", L"Force");
    1033                     if (hr2 != ERROR_SUCCESS)
    1034                         logStringW(hModule, L"Failed to set REBOOT property, error = 0x%x", hr2);
     1039                    if (fRebootRequired)
     1040                    {
     1041                        logStringW(hModule, L"UpdateHostOnlyInterfaces: Reboot required, setting REBOOT property to force");
     1042                        HRESULT hr2 = MsiSetPropertyW(hModule, L"REBOOT", L"Force");
     1043                        if (hr2 != ERROR_SUCCESS)
     1044                            logStringW(hModule, L"UpdateHostOnlyInterfaces: Failed to set REBOOT property, error = 0x%x", hr2);
     1045                    }
    10351046                }
    1036             }
    1037             else
    1038                 logStringW(hModule, L"UpdateHostOnlyInterfaces: VBoxNetCfgWinUpdateHostOnlyNetworkInterface failed, hr = 0x%x", hr);
     1047                else
     1048                    logStringW(hModule, L"UpdateHostOnlyInterfaces: VBoxNetCfgWinUpdateHostOnlyNetworkInterface failed, hr = 0x%x", hr);
     1049            }
    10391050        }
    10401051        else
  • trunk/src/VBox/Installer/win/VirtualBox.wxs

    r39003 r41024  
    5959    <!-- Note: GUIDs in WiX *must* be uppercase! -->
    6060    <!-- Always include an upgrade ID or otherwise upgrade installation will not be possible. When doing
    61          a major upgrade (more than just fixing a few files) change the product GUID. -->
     61         a major upgrade (more than just fixing a few files) change the product GUID. We always do a major
     62         upgrade even for minor VBox updates. For that only change the product ID and the product version.
     63         The upgrade code *never* must be changed! -->
    6264
    6365    <!-- Update / Upgrade policies:
     
    7880             Manufacturer="$(env.VBOX_VENDOR)">
    7981
    80         <!-- Package GUIDs must be different for each package. The "???" directs WiX to create one. -->
    8182        <Package Id="*" Keywords="Installer"
    8283                 Description="$(env.VBOX_PRODUCT) $(var.Property_VersionExt) installation package"
     
    686687                 Description="!(loc.VB_App)"
    687688                 ConfigurableDirectory="INSTALLDIR" TypicalDefault="install" Display="expand"
    688                  Absent="disallow">
     689                 Absent="disallow" AllowAdvertise="no" >
    689690
    690691            <ComponentRef Id="cp_StartMenuVBox" />
     
    717718            <Feature Id="VBoxUSB" Title="VirtualBox USB Support" Level="1"
    718719                     Description="!(loc.VB_USBDriver)"
    719                      ConfigurableDirectory="INSTALLDIR" TypicalDefault="install" Display="expand" >
     720                     ConfigurableDirectory="INSTALLDIR" TypicalDefault="install" Display="expand"
     721                     Absent="allow" AllowAdvertise="no" >
    720722                <ComponentRef Id="cp_USBFilterDriver" />
    721723                <ComponentRef Id="cp_USBDeviceDriver" />
     
    725727            <Feature Id="VBoxNetwork" Title="VirtualBox Networking" Level="1"
    726728                     Description="!(loc.VB_Network)"
    727                      ConfigurableDirectory="INSTALLDIR" TypicalDefault="install" Display="expand" >
    728                  <Feature Id="VBoxNetworkFlt" Title="VirtualBox Bridged Networking" Level="1"
    729                           Description="!(loc.VB_NetFltDriver)"
    730                           ConfigurableDirectory="INSTALLDIR" TypicalDefault="install" Display="expand" >
    731                      <ComponentRef Id="cp_NetFltDriver" />
    732                  </Feature>
    733                  <Feature Id="VBoxNetworkAdp" Title="VirtualBox Host-Only Networking" Level="1"
    734                           Description="!(loc.VB_NetAdpDriver)"
    735                           ConfigurableDirectory="INSTALLDIR" TypicalDefault="install" Display="expand" >
    736                      <ComponentRef Id="cp_NetAdpDriver" />
    737                  </Feature>
     729                     ConfigurableDirectory="INSTALLDIR" TypicalDefault="install" Display="expand"
     730                     Absent="allow" AllowAdvertise="no" >
     731                <Feature Id="VBoxNetworkFlt" Title="VirtualBox Bridged Networking" Level="1"
     732                         Description="!(loc.VB_NetFltDriver)"
     733                         ConfigurableDirectory="INSTALLDIR" TypicalDefault="install" Display="expand"
     734                         Absent="allow" AllowAdvertise="no" >
     735                    <ComponentRef Id="cp_NetFltDriver" />
     736                </Feature>
     737                <Feature Id="VBoxNetworkAdp" Title="VirtualBox Host-Only Networking" Level="1"
     738                         Description="!(loc.VB_NetAdpDriver)"
     739                         ConfigurableDirectory="INSTALLDIR" TypicalDefault="install" Display="expand"
     740                         Absent="allow" AllowAdvertise="no" >
     741                    <ComponentRef Id="cp_NetAdpDriver" />
     742                </Feature>
    738743            </Feature>
    739744<?endif?>
     
    742747            <Feature Id="VBoxPython" Title="VirtualBox Python 2.x Support" Level="1"
    743748                    Description="!(loc.VB_Python)"
    744                     ConfigurableDirectory="INSTALLDIR" TypicalDefault="install" Display="expand" >
     749                    ConfigurableDirectory="INSTALLDIR" TypicalDefault="install" Display="expand"
     750                    Absent="allow" AllowAdvertise="no" >
    745751                <ComponentRef Id="cp_VBoxPythonBinding" />
    746752            </Feature>
     
    753759
    754760        <InstallExecuteSequence>
     761
     762            <!--
     763                To debug the action sequences, do: "msiexec /i <VBox.msi> /lar <Logfile>"
     764
     765                InstallUISequence (client side) is:
     766                    AppSearch
     767                    LaunchConditions
     768                    ValidateProductID
     769                    CostInitialize
     770                    FileCost
     771                    CostFinalize
     772                    ExecuteAction -> will pass control over to "InstallExecuteSequence"
     773
     774                The first six actions above will be repeated but skipped on the server
     775                side if already run on the client side.
     776
     777                InstallExecuteSequence (server side) is:
     778                    <First six action from InstallUISequence>
     779                    .
     780                    InstallInitialize
     781                    .
     782                    InstallFinalize
     783
     784                The actions between InstallInitialize and InstallFinalize will be gone through twice:
     785                - The first time the installer creates an installation script containing all actions in the right
     786                  sequence which need to get executed in a batch later. At this point the launch conditions for
     787                  custom actions must be met already!
     788                - The second time the generated installation script will be run as-is.
     789
     790                Also, the InstallUISequence and InstallExecuteSequence tables run in different sessions which
     791                need public properties (that is, UPPERCASE properties).
     792            -->
    755793
    756794            <!-- AppSearch must be done before "RemoveExistingProducts" and before "FindRelatedProducts". -->
    757795            <AppSearch Sequence="1"></AppSearch>
    758796            <LaunchConditions After="AppSearch" />
    759             <RemoveExistingProducts After="InstallValidate"><![CDATA[NEWERVERSIONDETECTED OR PREVIOUSVERSIONSINSTALLED]]></RemoveExistingProducts>
     797
     798            <!-- First install the new version and then remove the old version. This is more efficient. -->
     799            <InstallExecute Before="RemoveExistingProducts" />
     800            <RemoveExistingProducts Before="InstallFinalize" />
    760801
    761802            <Custom Action="ca_OriginalTargetDir" After="FileCost"><![CDATA[(NOT INSTALLDIR) AND (NOT EXISTINGINSTALLDIR)]]></Custom>
     
    765806<?if $(env.VBOX_WITH_NETFLT) = "yes" ?>
    766807            <!-- Create host-only interfaces on first-time install. -->
    767             <Custom Action="ca_CreateHostOnlyInterfaceArgs" Before="ca_CreateHostOnlyInterface" ><![CDATA[&VBoxNetworkAdp=3 AND (NOT UPGRADINGPRODUCTCODE)]]></Custom>
    768             <Custom Action="ca_CreateHostOnlyInterface" Before="InstallFinalize" ><![CDATA[&VBoxNetworkAdp=3 AND (NOT UPGRADINGPRODUCTCODE)]]></Custom>
     808            <Custom Action="ca_CreateHostOnlyInterfaceArgs" Before="ca_CreateHostOnlyInterface" ><![CDATA[&VBoxNetworkAdp=3 AND (NOT PREVIOUSVERSIONSINSTALLED)]]></Custom>
     809            <Custom Action="ca_CreateHostOnlyInterface" Before="InstallFinalize" ><![CDATA[&VBoxNetworkAdp=3 AND (NOT PREVIOUSVERSIONSINSTALLED)]]></Custom>
    769810            <!-- Don't remove the host-only interfaces on update, only on uninstall. -->
    770811            <Custom Action="ca_RemoveHostOnlyInterfaces" After="ca_UninstallNetFlt" ><![CDATA[(NOT UPGRADINGPRODUCTCODE) AND (REMOVE="ALL")]]></Custom>
    771812            <!-- First stop the existing host-only interfaces on updat ... -->
    772             <Custom Action="ca_StopHostOnlyInterfaces" Before="ca_UpdateHostOnlyInterfaces" ><![CDATA[&VBoxNetworkAdp=3 AND (UPGRADINGPRODUCTCODE)]]></Custom>
     813            <Custom Action="ca_StopHostOnlyInterfaces" Before="ca_UpdateHostOnlyInterfaces" ><![CDATA[UPGRADINGPRODUCTCODE]]></Custom>
    773814            <!-- ... then do the actual driver update. -->
    774             <Custom Action="ca_UpdateHostOnlyInterfacesArgs" Before="ca_UpdateHostOnlyInterfaces" ><![CDATA[&VBoxNetworkAdp=3 AND (UPGRADINGPRODUCTCODE)]]></Custom>
    775             <Custom Action="ca_UpdateHostOnlyInterfaces" Before="InstallFinalize" ><![CDATA[&VBoxNetworkAdp=3 AND (UPGRADINGPRODUCTCODE)]]></Custom>
     815            <Custom Action="ca_UpdateHostOnlyInterfacesArgs" Before="ca_UpdateHostOnlyInterfaces" ><![CDATA[Installed AND UPGRADINGPRODUCTCODE]]></Custom>
     816            <Custom Action="ca_UpdateHostOnlyInterfaces" Before="InstallFiles" ><![CDATA[Installed AND UPGRADINGPRODUCTCODE]]></Custom>
    776817
    777818            <Custom Action="ca_RollbackInstallNetFltArgs" Before="ca_RollbackInstallNetFlt" ><![CDATA[&VBoxNetworkFlt=3]]></Custom>
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette