jsakamoto / Toolbelt.Blazor.HotKeys2

This is a class library that provides configuration-centric keyboard shortcuts for your Blazor apps.
https://jsakamoto.github.io/Toolbelt.Blazor.HotKeys2/
Mozilla Public License 2.0
102 stars 7 forks source link

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

Open NJullienSweet opened 2 months ago

NJullienSweet commented 2 months ago

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:

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 commented 2 months ago

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

jsakamoto commented 2 months ago

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 commented 2 months ago

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

https://github.com/user-attachments/assets/e985f1bc-3317-4569-b9bc-ed06940d201c

Step 4 ~ 6

https://github.com/user-attachments/assets/aa95612e-8fee-40c3-88e4-d2b7c402d025

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 commented 2 months ago

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 commented 2 months ago

@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 commented 2 months ago

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?

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