Skip to content
New issue

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

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WixSharp fails to build MSI when Toolbelt.Blazor.HotKeys2 is included in Maui Blazor Hybrid project #27

Open
NJullienSweet opened this issue Sep 5, 2024 · 6 comments
Assignees

Comments

@NJullienSweet
Copy link

Description:

I'm encountering an issue when trying to build an MSI for a Maui Blazor Hybrid project using WixSharp after including the Toolbelt.Blazor.HotKeys2 NuGet package.

Steps to Reproduce:

  1. Clone the following project for a minimal reproducible example
    https://github.com/NJullienSweet/MauiBlazorHotKeys2PublishBug
  2. Open the developer terminal, open the MauiBlazorHotKeys2PublishBug project folder and publish the app using the following command
    dotnet publish -c=Release -f net8.0-windows10.0.19041.0 -p:WindowsPackageType=None
  3. Run the WixSharpSetup project to build the MSI (shouldn't get any error, should work)
  4. Checkout the previous commit ("Add WixSharp project" 3e27b24bb227b61bfd3d6814f6b790446c96b5ee)
  5. Clean the MauiBlazorHotKeys2PublishBug/MauiBlazorHotKeys2PublishBug/bin folder as a precaution
  6. Repeat steps 2 and 3 and you should get the error described in the following section

Expected Behavior:

The WixSharp project should successfully build the MSI and include all necessary dependencies, including Toolbelt.Blazor.HotKeys2.

Actual Behavior:

The WixSharp build fails with the following error:

wix.exe : error WIX0001: WixToolset.Core.Native.WixNativeException: wixnative.exe failed with error code: -2147467259 - The specified path was not found. Output:
  Error 0x80070003: failed to add file: ..\..\..\..\MauiBlazorHotKeys2PublishBug\bin\Release\net8.0-windows10.0.19041.0\win10-x64\publish\wwwroot\_content\Toolbelt.Blazor.GetProperty.Script\Toolbelt.Blazor.GetProperty.Script.lib.module.js
 ---> System.ComponentModel.Win32Exception (3): The specified path was not found.
   --- End of inner exception stack trace ---
   at WixToolset.Core.Native.WixNativeExe.Run() in D:\a\wix\wix\src\wix\WixToolset.Core.Native\WixNativeExe.cs:line 81
   at WixToolset.Core.Native.Cabinet.Compress(IEnumerable`1 files, CompressionLevel compressionLevel, Int32 maxSize, Int32 maxThresh) in D:\a\wix\wix\src\wix\WixToolset.Core.Native\Cabinet.cs:line 60
   at WixToolset.Core.WindowsInstaller.Bind.CabinetBuilder.CreateCabinet(CabinetWorkItem cabinetWorkItem) in D:\a\wix\wix\src\wix\WixToolset.Core.WindowsInstaller\Bind\CabinetBuilder.cs:line 192
   at WixToolset.Core.WindowsInstaller.Bind.CabinetBuilder.ProcessWorkItems() in D:\a\wix\wix\src\wix\WixToolset.Core.WindowsInstaller\Bind\CabinetBuilder.cs:line 123

Additional Information:

  • The issue only occurs when Toolbelt.Blazor.HotKeys2 is included in the project.
  • Removing Toolbelt.Blazor.HotKeys2 allows the MSI to build successfully.
  • Wix version: 4.0.3

Possible Cause:

It seems WixSharp might be having trouble locating the Toolbelt.Blazor.HotKeys2 dependency during the MSI build process. I saw someone else had here having a problem with this GetProperty script. Maybe it is related?

@jsakamoto
Copy link
Owner

@NJullienSweet Thank you for letting me know that. I've started to investigate this case now.

@jsakamoto jsakamoto self-assigned this Sep 7, 2024
@jsakamoto
Copy link
Owner

Hi @NJullienSweet,
I ran into another error. When I executed the WixSharpSetup.exe after I had installed the Wix version 4.0.3, it said, " Cannot find WiX extension 'WixToolset.UI.wixext'".

image

I executed the wix.exe extension add -g WixToolset.UI.wixext command and retried again, but nothing could be improved. I'm sticking right now.

@jsakamoto
Copy link
Owner

Hi @NJullienSweet,

When I tried again after updating Wix to version 5.0.1, no errors occurred. Please also see the recording below.

Step 1 ~ 3

HotKeys2-Issue27-Part-1.mp4

Step 4 ~ 6

HotKeys2-Issue27-Part-2.mp4

Could you try again after updating the Wix version? (I installed the Wix by executing the following command: dotnet tool install --global wix --version 5.0.1)

@NJullienSweet
Copy link
Author

NJullienSweet commented Sep 11, 2024

Thanks for your answer. After upgrading to Wix 5.0.1, I still get the same error on my end. Did you by any chance perform any other command, given that you had this other problem earlier?

@jsakamoto
Copy link
Owner

@NJullienSweet

Did you by any chance perform any other command

No I didn't, except dotnet tool install --global wix --version 4.0.3, wix.exe extension add -g WixToolset.UI.wixext, and dotnet tool install --global wix --version 5.0.1, as I mentioned before.

I'll retry these reproduction steps again on my clean-installed Windows virtual machine. But I have other priority tasks these days, so please wait a few days or a week.
Thank you for your patience.

@jsakamoto
Copy link
Owner

Hi @NJullienSweet,
After my investigation, the error you run into may be caused by a too-long path. Could you try one of the options below?

  • Put the solution in a shallow folder, like C:\work.
  • Change the publish target folder to a short path.

P.S. I guess it is the limitation of Wix, not a "Blazor HotKey2" library's matter.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants