Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

WIX 3.9 failed to load managed BA on windows 2008R2 SP1 #4669

Closed
wixbot opened this Issue Feb 10, 2015 · 11 comments

Comments

Projects
None yet
2 participants
Collaborator

wixbot commented Feb 10, 2015

on windows 2008R2 SP1(fresh installed),
WIX 3.9 failed to load managed BA, which is a win form UI based on .net 2.0

The way that WIX 3.9 used to get CLR Host has a dependency on .net framework 4, which would not be installed on a fresh 2008R2 SP1.

Originally opened by 125

Collaborator

wixbot commented Feb 10, 2015

the line below will fail, when .net 4 is not installed.

        hr = pfnCLRCreateInstance(CLSID_CLRMetaHostPolicy, IID_ICLRMetaHostPolicy, reinterpret_cast<LPVOID*>(&pCLRMetaHostPolicy));

Originally posted by 125

Collaborator

wixbot commented Feb 10, 2015

That line is not the problem, because just above it mbahost tries to dynamically load that method. If .NET 4 isn't installed, then it will fail to load that method and fall back to trying to dynamically load the .NET 2 function.

This bug should be closed unless the same exact code and BootstrapperCore.config for the managed BA compiled against WiX 3.8 works on the same exact machine. In that case we would need the BootstrapperCore.config, target .NET framework for the BA (or even the .dll itself), and the Burn log.

Originally posted by rseanhall

Collaborator

wixbot commented Feb 10, 2015

I see the dynamic load of pfnCLRCreateInstance, however, if SP1 installed on 2008R2, the mscoree.dll is updated to version v4.0.40305.0. and the dynamic load of pfnCLRCreateInstance actually succeed.
but when it tries to CreateInstance of CLSID_CLRMetaHostPolicy, then it fails.

additionally, the following case runs well.

  1. Use WIX 3.9 the same code and config file runs on 2008R2, not SP1 installed.
  2. Use WIX 3.8 the same code and config file runs on 2008R2 with SP1 installed.

Originally posted by 125

Collaborator

wixbot commented Feb 10, 2015

Attached the config file below, The target framework for managed BA is .net 2, I just start a win form in the managed BA.
the log:
[038C:0B4C][2015-02-09T21:57:38]i000: Loading prerequisite bootstrapper application because managed host could not be loaded, error: 0x80004001.

I also tried in the config file, It looks like that if the line to dynamic load pfnCorBindToCurrentRuntime is not hit, the config file is useless.

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
  <!-- BEGIN REQUIRED BOOTSTRAPPER CONFIGURATION -->
  <configSections>
    <sectionGroup name="wix.bootstrapper" type="Microsoft.Tools.WindowsInstallerXml.Bootstrapper.BootstrapperSectionGroup, BootstrapperCore">
      <section name="host" type="Microsoft.Tools.WindowsInstallerXml.Bootstrapper.HostSection, BootstrapperCore" />
    </sectionGroup>
  </configSections>
  <startup useLegacyV2RuntimeActivationPolicy="true">
      <supportedRuntime version="v2.0.50727" />
      <supportedRuntime version="v4.0" />
  </startup>
  <wix.bootstrapper>
    <host assemblyName="CDSSetupBA">
       <supportedFramework version="v2.0.50727"/>
    </host>
  </wix.bootstrapper>
  <appSettings>
    <add key="BootstrapperUI" value="HandSetupBA" />
  </appSettings>
</configuration>

Originally posted by 125

Collaborator

wixbot commented Feb 11, 2015

Thanks for the info. I'll make it fallback to calling the .NET 2.0 function if the 4.0 one returns E_NOTIMPL.

Originally posted by rseanhall

Collaborator

wixbot commented Feb 11, 2015

Thank You, shall, that should be the fix.

Originally posted by 125

Collaborator

wixbot commented Feb 14, 2015

v3.10 pull request: 206

v4.0 pull request: 94

Originally posted by rseanhall

Collaborator

wixbot commented Feb 17, 2015

AssignedTo set to shall
Release changed from v3.9 to v3.10
Resolution set to fixed
Status changed from Untriaged to Resolved

Collaborator

wixbot commented Mar 18, 2015

I installed the version 3.10.0.1502 and I still have the same problem using Windows XP

Log file:

[0894:020C][2015-03-17T18:20:35]i001: Burn v3.10.1124.0, Windows v5.1 (Build 2600: Service Pack 3), path: C:\setup.exe, cmdline: ''
[0894:020C][2015-03-17T18:20:36]i000: Loading prerequisite bootstrapper application because managed host could not be loaded, error: 0x80004001.
[0894:020C][2015-03-17T18:22:36]i500: Shutting down, exit code: 0x642
[0894:020C][2015-03-17T18:22:36]i000: The prerequisites were already installed. The bootstrapper application will not be reloaded to prevent an infinite loop.
[0894:020C][2015-03-17T18:22:36]i007: Exit code: 0x642, restarting: No

Config file:

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
    <configSections>
        <sectionGroup name="wix.bootstrapper" type="Microsoft.Tools.WindowsInstallerXml.Bootstrapper.BootstrapperSectionGroup, BootstrapperCore">
            <section name="host" type="Microsoft.Tools.WindowsInstallerXml.Bootstrapper.HostSection, BootstrapperCore" />
        </sectionGroup>
    </configSections>
    <startup useLegacyV2RuntimeActivationPolicy="true">
        <supportedRuntime version="v4.0" />
        <supportedRuntime version="v2.0.50727" />
    </startup>
    <wix.bootstrapper>
        <host assemblyName="Application">
            <supportedFramework version="v3.5" />            
        </host>
    </wix.bootstrapper>
</configuration>

Originally posted by cadima

Collaborator

wixbot commented Mar 18, 2015

@CADIMA Does the exact same bundle code compiled with v3.8 work on the same exact machine? (This rules out corrupted .NET installs and verifies the BootstrapperCore.config is valid) Which .NET framework does your BA target? Which versions of .NET are installed on the machine?

Originally posted by rseanhall

Collaborator

wixbot commented Mar 18, 2015

The log says Burn v3.10.1124.0. Due to the breaking change we made in the version number, you have to manually uninstall v3.10.1124.0 in order to install the newer versions.

Originally posted by rseanhall

@wixbot wixbot added bug burn labels Dec 20, 2015

@wixbot wixbot added this to the v3.10 milestone Dec 20, 2015

@wixbot wixbot closed this Dec 20, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment