wixtoolset / issues

WiX Toolset Issues Tracker
http://wixtoolset.org/
130 stars 24 forks source link

Failed to write send message to pipe #8758

Closed EvgenPervenenko closed 1 month ago

EvgenPervenenko commented 2 months ago

WiX Version

5.0.1

.NET or MSBuild or Visual Studio Version

Microsoft Visual Studio Community 2022 Version 17.8.2 ASP.NET and Web Tools 17.8.358.6298 .NET 4.6.2

HeatWave Version

1.0.4.5

Windows Version

Win 8.1 Pro x86

Repro Repo

No response

Repro Steps

  1. Install BA with CustomUI (built for x32 platform)
  2. In the end got next errors on Win8.1 x32 (on Win 11 Pro 21H2 x64 and Win 7 Pro x64 all works as expected the same installer)

[8378:873C][2024-09-18T06:24:26]i000: OnExecuteComplete status = 0 [8378:8578][2024-09-18T06:24:26]e000: Error 0x80070006: Failed to write send message to pipe. [8378:8578][2024-09-18T06:24:26]e000: Error 0x80070006: Failed to send BURN_ELEVATION_MESSAGE_TYPE_CLEAN_PACKAGE message to per-machine process. [8378:8578][2024-09-18T06:24:26]i351: Removing cached package: TestSetup, from path: C:\Users\yauheni.pervenenka\AppData\Local\Package Cache{F0E46D23-6967-403A-ABB2-EBE17203F705}v1.0.0.24\ [8378:8578][2024-09-18T06:24:26]i373: Calculating whether to keep registration [8378:8578][2024-09-18T06:24:26]i374: package: NetFx462Web, install registration state: (permanent), cache registration state: (permanent) [8378:8578][2024-09-18T06:24:26]i374: package: TestSetup, install registration state: Absent, cache registration state: Absent [8378:8578][2024-09-18T06:24:26]i374: package: TestSetup_x86, install registration state: Present, cache registration state: Present [8378:8578][2024-09-18T06:24:26]i372: Session end, registration key: SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall{E40853B3-E9A2-4CB0-81B5-BD7FDE8D1EE5}, resume: ARP, restart: None, disable resume: No, default registration: Full, ba requested registration: Full [8378:8578][2024-09-18T06:24:26]i371: Updating session, registration key: SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall{E40853B3-E9A2-4CB0-81B5-BD7FDE8D1EE5}, resume: ARP, restart initiated: No, disable resume: No [8378:873C][2024-09-18T06:24:26]e000: Error 0x80131513: BA OnApplyComplete failed. [8378:8578][2024-09-18T06:24:26]e000: Error 0x80131513: BA OnApplyComplete failed. [8378:8578][2024-09-18T06:24:26]i399: Apply complete, result: 0x0, restart: None, ba requested restart: No

Note: callback OnApplyComplete does't called and bootstrapper do not closed

Actual Result

Bootstapper hand up, BOOTSTAPPER_APPLICATION_MESSAGE_ONAPPLYCOMPLETE not delivered

Expected Result

There is no errors, all messages delivered to customBA and all callbacks called

Acknowledgements

bevanweiss commented 2 months ago

You're going to need to provide a reproducible repo for it. With the MINIMAL required reproduction.

The HRESULT 0x80131513 is a .NET Framework exception that suggests whilst processing the OnApplyComplete that a method was not found that was expected. Given the WiX side is Native code. I would suspect that it is something in your application that is the problem here. You should review the various test / example cases within the WiX sourcecode to verify that you are doing things aligned with that code. https://github.com/wixtoolset/wix/tree/main/src/ext/Bal/test/examples

EvgenPervenenko commented 2 months ago

@bevanweiss htanke for your reply, yep will try to prepare simple example, not sure that problem with code, because it is working as expected on other win versions which I tested the same installer(Win 11 Pro 21H2 x64 and Win 7 Pro x64)

EvgenPervenenko commented 2 months ago

@bevanweiss hi, there is a simple example with WixToolset.WixBA

Simple example: CustomUIBundle.zip

Log: CustomUIBundle_20240920053618.log

from logs: [2F60:16F4][2024-09-20T05:36:30]e000: Error 0x80131513: BA OnApplyComplete failed. [2F60:9908][2024-09-20T05:36:30]e000: Error 0x80131513: BA OnApplyComplete failed.

and application is stuck

EvgenPervenenko commented 2 months ago

@bevanweiss hi, FYI double checked on Win 8.1 x64 the same installer and it works fine, looks like win 8.1 x32 specific issue

barnson commented 2 months ago

You might try Windows 10 x86 as the last supported x86 variant.

EvgenPervenenko commented 1 month ago

@barnson @bevanweiss checked on win 10 education 22H2 x86 and the same installer works as expected 32-bit operating system, x64-based processor

bevanweiss commented 1 month ago

@barnson @bevanweiss checked on win 10 education 22H2 x86 and the same installer works as expected 32-bit operating system, x64-based processor

For the OS that isn't working, please provide details on what version of .NET is installed BEFORE you attempt to run the bundle. https://learn.microsoft.com/en-us/dotnet/framework/migration-guide/how-to-determine-which-versions-are-installed

And then after the bundle has run (and failed), please provide details on what version of .NET is installed AFTER the failed bundle execution.

EvgenPervenenko commented 1 month ago

@barnson there are .net/clr versions installed on machine, those versions are already installed before bundle run and after

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\NET Framework Setup\NDP\v4\Full Version: 4.5.51641 CLRVersion 4.0.30319.34014

bevanweiss commented 1 month ago

@barnson there are .net/clr versions installed on machine, those versions are already installed before bundle run and after

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\NET Framework Setup\NDP\v4\Full Version: 4.5.51641 CLRVersion 4.0.30319.34014

Hmmm... but your UI requires .NET 4.6.2... so v4.5 is insufficient for it to work. Do you not install v4.6.2 as a pre-requisite? BEFORE your UI is executed..

EvgenPervenenko commented 1 month ago

nope it started and worked fine, you can double check in logs, ui created without errors, https://github.com/user-attachments/files/17075299/CustomUIBundle_20240920053618.log, if it helps I can share screen capture video

barnson commented 1 month ago

Try installing the right .NET Framework before starting the bundle to rule that out as a problem.

EvgenPervenenko commented 1 month ago

@barnson but why it is not installed before running attached example, system .net version less than required and there is a prerequsite package

<Wix xmlns="http://wixtoolset.org/schemas/v4/wxs" xmlns:bal="http://wixtoolset.org/schemas/v4/wxs/bal">
  <Bundle Name="CustomUIBundle" Manufacturer="TODO Manufacturer" Version="1.0.0.0" UpgradeCode="31dd01bd-3fe2-4b36-8d40-25879ae5250e">
    <BootstrapperApplication Name="WixToolset.WixBA" SourceFile="$(var.WixToolset.WixBA.TargetPath)">
        <Payload SourceFile="$(var.WixToolset.WixBA.TargetDir)\WixToolset.BootstrapperApplicationApi.dll"/>
        <Payload SourceFile="$(var.WixToolset.WixBA.TargetDir)\mbanative.dll"/>
        <PayloadGroupRef Id="LicensePayload"/>

        <bal:WixPrerequisiteBootstrapperApplication />
    </BootstrapperApplication>

    <Chain>
        <PackageGroupRef Id="NetFx462WebAsPrereq" />
        <MsiPackage Id="Package1" SourceFile="$(var.Package1.TargetPath)" />
    </Chain>

  </Bundle>

  <Fragment>
    <PayloadGroup Id="LicensePayload">
        <Payload SourceFile="License.txt" />
    </PayloadGroup>
  </Fragment>
</Wix>
barnson commented 1 month ago

I suggested that as a way of narrowing down a root cause.

EvgenPervenenko commented 1 month ago

@barnson @bevanweiss thanks for your help, yep if .net 4.6.2 installed all works as expected, but unfortunately prerequsite package .net starting installation after CustomUIBundle installed, not sure but looks like .net should be installed before installation and after CustomUIBundle should be installed

EvgenPervenenko commented 1 month ago

@barnson @bevanweiss hello, hi should i create a new bug for the prerequisite .net installation issue. Maybe I can help with reproduction or any additional info.

barnson commented 1 month ago

I don't think it's a bug; all the way back to the first release of Burn, it's only shown the pre-req BA if the BA couldn't be loaded.

EvgenPervenenko commented 1 month ago

@barnson thanks, but the pre-req BA shown after installation(I mean if in system installed .net 4.5.1 and run BA which required .net 4.6.2, BA loaded and stuck, if close it force after it pre-req BA shown), not sure that it is expected behaviour

barnson commented 1 month ago

I don't know what you're talking about. Please set up a repro repo and attach logs demonstrating the problem.

EvgenPervenenko commented 1 month ago

@barnson hello, pls take a look and let me know if need any help WiX Version 5.0.1

.NET or MSBuild or Visual Studio Version Microsoft Visual Studio Community 2022 Version 17.8.2 ASP.NET and Web Tools 17.8.358.6298 .NET 4.6.2

HeatWave Version 1.0.4.5

Windows Version Win 8.1 Pro x86

.net framework installed version 4.5.1 required version 4.6.2

Repro example: https://github.com/user-attachments/files/17075288/CustomUIBundle.zip

Logs: CustomUIBundle.zip

Video shows that pre-req BA shown after application installed(application stuck thats why I have to close it using task manager)

https://drive.google.com/file/d/1tRfYZP7vozK4khGDgqDiyxHAIeK10C5g/view?usp=sharing

Description: Application CustomUIBundle(see attached example) required .net version 4.6.2, in my system win8 x86 installed by default .net 4.5.1, CustomUIBundle run but stack in the end with error Error 0x80131513: BA OnApplyComplete failed.

Actual result: After closing CustomUIBundle pre-req BA shown and try to install .net 4.6.2(see attached video)

Expected result: .net 4.6.2 installed before CustomUIBundle start

barnson commented 1 month ago

The pre-req BA is kicking in because you killed the original BA process, so it's like a failure. You need your BA to fail if the right version of .NET isn't installed.