wixtoolset / issues

WiX Toolset Issues Tracker
http://wixtoolset.org/
129 stars 36 forks source link

NetFx472RedistAsPrereq tryes to install .Net Framework 4.7.2 eventhow it's already installed #8118

Closed Kingju777 closed 5 months ago

Kingju777 commented 5 months ago

WiX Version

4.0.5

.NET or MSBuild or Visual Studio Version

8.0.204

HeatWave Version

-

Windows Version

Win 10 Build 16299

Repro Repo

No response

Repro Steps

Setup: i recommend a VM with .Net Framework 4.7.1 or older, then install the newest .Net Framework 4.7.2 and restart the PC.

Bundel for Referenz

<Wix xmlns:bal="http://wixtoolset.org/schemas/v4/wxs/bal"
     xmlns="http://wixtoolset.org/schemas/v4/wxs">
    <?include $(sys.CURRENTDIR)..\Msi\Common.wxi ?>

    <Bundle Name="$(var.ProductName)"
            Version="$(var.BuildVersion)"
            Manufacturer="$(var.Manufacturer)"
            IconSourceFile="$(var.LogoFile)"
            UpgradeCode="$(var.UpgradeCode)">
        <BootstrapperApplication>
            <Payload SourceFile="..\..\Wix Source\Exe_Setup\WixToolset.Mba.Host.config"/>
            <Payload SourceFile="..\UI\bin\Debug\net472\win-x86\Installer.dll"/>
            <Payload SourceFile="..\UI\bin\Debug\net472\win-x86\WixToolset.Mba.Core.dll"/>
            <Payload SourceFile="..\UI\bin\Debug\net472\win-x86\mbanative.dll"/>

            <bal:WixManagedBootstrapperApplicationHost/>
        </BootstrapperApplication>

        <Chain>
            <PackageGroupRef Id="NetFx472RedistAsPrereq"/>

            <MsiPackage SourceFile="$(var.SourceFile)"
                        Compressed="yes"
                        InstallCondition="VersionNT64 AND VersionNT >= v6.1"
                        Id="Setup"
                        Cache="keep"
                        Visible="no">
                <MsiProperty Name="INSTALLDIR"
                             Value="[INSTALLFOLDER]"/>
            </MsiPackage>
        </Chain>
    </Bundle>
</Wix>
  1. Start installer (with NetFx472RedistAsPrereq) (we are using the WixManagedBootstrapperApplicationHost for our installer)
  2. Installer opens ".Net Framework required" screen
  3. try and install .Net Framework
  4. ".Net Framework" screen shows error and link to log
    • ".Net Framework required" screen shows no specific error

Actual Result

Installer shows the ".Net Framework required" screen. If you Try to install .Net Framework you get an error.

Log NetFx472Redist:

[0BE8:0BEC][2024-04-11T06:00:16]i001: Burn x86 v4.0.5+b9b2f1b4c69a1b509d487dc950b30b4ec9b0d040, Windows v10.0 x64 (Build 16299: Service Pack 0), path: C:\Users\[privat]\AppData\Local\Temp\{2F0337DC-1C21-4E4E-856A-D9CA4A6DE7E4}\.cr\[privat] 4.0.5.exe
[0BE8:0BEC][2024-04-11T06:00:16]i009: Command Line: '"-burn.clean.room=C:\powershell\[privat] 4.0.5.exe" -burn.filehandle.attached=612 -burn.filehandle.self=608'
[0BE8:0BEC][2024-04-11T06:00:16]i000: Setting string variable 'WixBundleOriginalSource' to value 'C:\powershell\[privat] 4.0.5.exe'
[0BE8:0BEC][2024-04-11T06:00:16]i000: Setting string variable 'WixBundleOriginalSourceFolder' to value 'C:\powershell\'
[0BE8:0BEC][2024-04-11T06:00:16]i000: Setting string variable 'WixBundleLog' to value 'C:\Users\[privat]\AppData\Local\Temp\[privat]_20240411060016.log'
[0BE8:0BEC][2024-04-11T06:00:16]i000: Setting string variable 'WixBundleInProgressName' to value ''
[0BE8:0BEC][2024-04-11T06:00:16]i000: Setting string variable 'WixBundleName' to value '[privat]'
[0BE8:0BEC][2024-04-11T06:00:16]i000: Setting string variable 'WixBundleManufacturer' to value '[privat][privat]'
[0BE8:0BEC][2024-04-11T06:00:16]e000: Error 0x80131700: Failed to get the CLR runtime info using the application configuration file path.
[0BE8:0BEC][2024-04-11T06:00:16]i000: Loading prerequisite bootstrapper application because managed host could not be loaded, error: 0x80131700.
[0BE8:0008][2024-04-11T06:00:16]i000: Setting numeric variable 'WixStdBALanguageId' to value 1033
[0BE8:0008][2024-04-11T06:00:16]i000: Setting version variable 'WixBundleFileVersion' to value '9.9.9.9'
[0BE8:0BEC][2024-04-11T06:00:16]i100: Detect begin, 2 packages
[0BE8:0BEC][2024-04-11T06:00:17]i000: Setting string variable 'NETFRAMEWORK45' to value '461814'
[0BE8:0BEC][2024-04-11T06:00:17]i052: Condition 'NETFRAMEWORK45 >= 461808' evaluates to true.
[0BE8:0BEC][2024-04-11T06:00:17]i101: Detected package: NetFx472Redist, state: Present, cached: No, install registration state: (permanent), cache registration state: (permanent)
[0BE8:0BEC][2024-04-11T06:00:17]i101: Detected package: Setup, state: Absent, cached: No, install registration state: Absent, cache registration state: Absent
[0BE8:0BEC][2024-04-11T06:00:17]i199: Detect complete, result: 0x0, registration state: None, cached: No, eligible for cleanup: No
[0BE8:0BEC][2024-04-11T06:00:58]i200: Plan begin, 2 packages, action: Install
[0BE8:0BEC][2024-04-11T06:00:58]i052: Condition 'VersionNT64 AND VersionNT >= v6.1' evaluates to true.
[0BE8:0BEC][2024-04-11T06:00:58]w321: Skipping dependency registration on package with no dependency providers: NetFx472Redist
[0BE8:0BEC][2024-04-11T06:00:58]i222: Planned rollback boundary: 'WixDefaultBoundary', vital: Yes, transaction: No (default: No)
[0BE8:0BEC][2024-04-11T06:00:58]i201: Planned package: NetFx472Redist, state: Present, default requested: Present, ba requested: Present, execute: None, rollback: None, default cache strategy: Remove, ba requested strategy: Remove, cache: No, uncache: Yes, dependency: None, expected install registration state: (permanent), expected cache registration state: (permanent)
[0BE8:0BEC][2024-04-11T06:00:58]i201: Planned package: Setup, state: Absent, default requested: Present, ba requested: None, execute: None, rollback: None, default cache strategy: Keep, ba requested strategy: Keep, cache: No, uncache: No, dependency: None, expected install registration state: Absent, expected cache registration state: Absent
[0BE8:0BEC][2024-04-11T06:00:58]i299: Plan complete, result: 0x0
[0BE8:0BEC][2024-04-11T06:00:58]i300: Apply begin
[0BE8:0BEC][2024-04-11T06:00:58]i010: Launching elevated engine process.
[0BE8:0BEC][2024-04-11T06:01:00]i011: Launched elevated engine process.
[0BE8:0BEC][2024-04-11T06:01:00]i012: Connected to elevated engine.
[0B38:0F54][2024-04-11T06:01:00]i358: Pausing automatic updates.
[0B38:0F54][2024-04-11T06:01:00]i359: Paused automatic updates.
[0B38:0F54][2024-04-11T06:01:00]i360: Creating a system restore point.
[0B38:0F54][2024-04-11T06:01:00]w363: Could not create system restore point, error: 0x80070422. Continuing...
[0B38:0F54][2024-04-11T06:01:00]i370: Session begin, registration key: SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{F8774F94-F89D-4F1B-9531-18470FE72B5E}, options: 0x3, disable resume: No
[0B38:0F54][2024-04-11T06:01:00]i000: Caching bundle from: 'C:\Users\[privat]\AppData\Local\Temp\{29B76431-CC36-4461-B404-AD1EE3312FF6}\.be\[privat].exe' to: 'C:\ProgramData\Package Cache\{F8774F94-F89D-4F1B-9531-18470FE72B5E}\[privat].exe'
[0B38:0F54][2024-04-11T06:01:00]i320: Registering bundle dependency provider: {F8774F94-F89D-4F1B-9531-18470FE72B5E}, version: 9.9.9.9
[0B38:0F54][2024-04-11T06:01:00]i371: Updating session, registration key: SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{F8774F94-F89D-4F1B-9531-18470FE72B5E}, resume: Active, restart initiated: No, disable resume: No
[0B38:0F54][2024-04-11T06:01:00]i351: Removing cached package: NetFx472Redist, from path: C:\ProgramData\Package Cache\NetFx472Redist_ABDCA79AF9DD48A0EA702AD45260B3C03093FB4B\
[0BE8:0BEC][2024-04-11T06:01:00]i373: Calculating whether to keep registration
[0BE8:0BEC][2024-04-11T06:01:00]i374:   package: NetFx472Redist, install registration state: (permanent), cache registration state: (permanent)
[0BE8:0BEC][2024-04-11T06:01:00]i374:   package: Setup, install registration state: Absent, cache registration state: Absent
[0BE8:0BEC][2024-04-11T06:01:00]i372: Session end, registration key: SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{F8774F94-F89D-4F1B-9531-18470FE72B5E}, resume: None, restart: None, disable resume: No, default registration: None, ba requested registration: None
[0B38:0F54][2024-04-11T06:01:00]i330: Removed bundle dependency provider: {F8774F94-F89D-4F1B-9531-18470FE72B5E}
[0B38:0F54][2024-04-11T06:01:00]i326: Removed dependency: {F8774F94-F89D-4F1B-9531-18470FE72B5E} on package provider: {1D930BE5-EC45-496F-A900-5837F4EC4C1F}_v9.9.9.9, package Setup
[0B38:0F54][2024-04-11T06:01:00]i329: Removed package dependency provider: {1D930BE5-EC45-496F-A900-5837F4EC4C1F}_v9.9.9.9, package: Setup
[0B38:0F54][2024-04-11T06:01:00]i352: Removing cached bundle: {F8774F94-F89D-4F1B-9531-18470FE72B5E}, from path: C:\ProgramData\Package Cache\{F8774F94-F89D-4F1B-9531-18470FE72B5E}\
[0BE8:0BEC][2024-04-11T06:01:00]i000: Unsetting variable 'WixStdBARestartRequired'
[0B38:0F54][2024-04-11T06:01:00]i371: Updating session, registration key: SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{F8774F94-F89D-4F1B-9531-18470FE72B5E}, resume: None, restart initiated: No, disable resume: No
[0B38:0F54][2024-04-11T06:01:00]i420: Resuming automatic updates.
[0B38:0F54][2024-04-11T06:01:00]i421: Resumed automatic updates.
[0BE8:0BEC][2024-04-11T06:01:00]i399: Apply complete, result: 0x0, restart: None, ba requested restart:  No
[0BE8:0BEC][2024-04-11T06:01:00]i500: Shutting down, exit code: 0x0
[0BE8:0BEC][2024-04-11T06:01:00]i000: The prerequisites were successfully installed. The bootstrapper application will be reloaded.
[0BE8:0BEC][2024-04-11T06:01:00]i006: Bootstrapper application requested to be reloaded.
[0BE8:0BEC][2024-04-11T06:01:00]e000: Error 0x80131700: Failed to get the CLR runtime info using the application configuration file path.
[0BE8:0BEC][2024-04-11T06:01:00]e000: Error 0x81f403ea: The prerequisites were already installed. The bootstrapper application will not be reloaded to prevent an infinite loop.
[0BE8:0BEC][2024-04-11T06:01:00]i000: Loading prerequisite bootstrapper application because managed host could not be loaded, error: 0x81f403ea.
[0BE8:1318][2024-04-11T06:01:00]i000: Setting numeric variable 'WixStdBALanguageId' to value 1033
[0BE8:1318][2024-04-11T06:01:00]i000: Setting version variable 'WixBundleFileVersion' to value '9.9.9.9'
[0BE8:1318][2024-04-11T06:01:00]i052: Condition 'WixStdBARestartRequired' evaluates to false.

Expected Result

that the installer does not show the ".Net Framework required" screen, and simply starts the normal installer

Workaround: NetFx48RedistAsPrereq works NetFx481RedistAsPrereq has another issue for me.(i will submit another bugreport if i have the time)

Acknowledgements

barnson commented 5 months ago

Burn isn't trying to install the .NET redist:

[0BE8:0BEC][2024-04-11T06:00:58]i201: Planned package: NetFx472Redist, state: Present, default requested: Present, ba requested: Present, execute: None, rollback: None, default cache strategy: Remove, ba requested strategy: Remove, cache: No, uncache: Yes, dependency: None, expected install registration state: (permanent), expected cache registration state: (permanent)

The problem is that your BA can't be loaded:

[0BE8:0BEC][2024-04-11T06:00:16]e000: Error 0x80131700: Failed to get the CLR runtime info using the application configuration file path.

The messages suggests a problem in your WixToolset.Mba.Host.config.

Kingju777 commented 5 months ago

Thanks a lot! i was using WixToolset.Mba.Host.config:

        <supportedRuntime version="v4.0"
            sku=".NETFramework,Version=v4.8" />

and

            <PackageGroupRef Id="NetFx472RedistAsPrereq"/>
Correct "WixToolset.Mba.Host.config For others who found this issue: correct "WixToolset.Mba.Host.config": ``` xml
```