Giter VIP home page Giter VIP logo

Comments (14)

artlaskow avatar artlaskow commented on August 27, 2024 1

Alright, so I tested manual steps you you posted and I would like to report success, but with some minor adjustments to Bundle building. The msi I generate is later used to build a bundle. First off, bundle cmd file doesn't have arch parameter. No big deal, I added it to cmd file, but then I noticed a minor bug: -o parameter in Build_MyProject.cmd is set to Build_MyProject.cmd.exe, which seems to be an error, because I specify OutFileName as MyProject. Other than that everything works fine from what I tested so far.

Thanks a ton for your help, for looking into this so quickly and coming up with a temporary solution!

from wixsharp.

oleg-shilo avatar oleg-shilo commented on August 27, 2024 1

@artlaskow, great, thank you. I wish wix.exe was printing it on -help. I will try to implement it all on the weekend

@talbotsk, you cannot use WixOptions += " -arch x86 " as it is adding an extra arg but you need the replacement.
The replacement mechanism for build cmd at this very moment is only available via building batch file or with the pre-release package attached (5 posts above).

Anyway, I am planning to do the release on weekend and I am going to add processing of the platform property as it was in WixSharp for wix3.

read Platform property of the project set by business logic,

yes it does it already I only need to add arm as we just discioverd that it still works but in a different way

from wixsharp.

smaudet avatar smaudet commented on August 27, 2024 1

@oleg-shilo no it was the right thread:

Also ManagedUI\SilentBA.cs and wixsharp\Source\src\WixSharp.Samples\Wix# Samples\Managed Setup\Self-executable_Msi\app.config

@talbotsk mentioned this two weeks ago.

I posted here because I was searching for SilentBA when I was trying to build it.

from wixsharp.

oleg-shilo avatar oleg-shilo commented on August 27, 2024

This is a difficult one.

WiX4 does not longer accept setting the target architecture of the msi package. Instead it requires setting the bitness attribute of the component and passing the 'magic' -arch switch to the wix.exe during the compilation. Why "magic"?
Because wix.exe build -? is silent about the possible values

image

Thus I can only guess that it might be arm64. And indeed wix.exe tries to compile the msi. I just wanted you to be aware how much guessing I have to do as the documentation is not very helpful for this topic.

Anyway, we can solve this problem with a little manual intervention in the build process

  • Set 64 bitness and the installer version required by the wix.exe:
    project.Platform = Platform.x64;
    project.InstallerVersion = 500;
    
  • Second step is manual.
    Instead of building msi build the batch file for building msi:
    project.BuildMsiCmd("msi.build.cmd");
    
    After building the project the batch file will be created and if you execute it the msi will be built. Though before executing the batch file you will need to replace the -arch x64 with -arch arm64. That's why we need to do a manual build with the batch file.

This should build the msi.

Let me know if it builds correctly and I will integrate this process into the next release.

But just to assist you with our test I have built you pre-release packages (attached) that you can use if you do not want to fiddle with the batch file.
With v2.1.9 you can manipulate the build command on-fly with the new WixBuildCommandGenerated event:

project.Platform = Platform.x64;
project.InstallerVersion = 500;
project.WixBuildCommandGenerated +=
    cmd => cmd.Replace("-arch x64", "-arch arm64");

WixSharp.zip

from wixsharp.

oleg-shilo avatar oleg-shilo commented on August 27, 2024

Excellent. Then it is the way to go. I will now implement arm support by automating all these manual steps.

added it to cmd file,

You can add it as

bootstrapper.WixOptions += " -arch  arm64";

Can you please confirm that the code above generates the correct bundle cmd.

And I will check the Build_MyProject.cmd.exe problem

from wixsharp.

artlaskow avatar artlaskow commented on August 27, 2024

Can you please confirm that the code above generates the correct bundle cmd.

Yes, it does. Extra spaces before and after -arch are redundant, but other than that cmd generates as it should.

I will now implement arm support by automating all these manual steps.

Thank you again!

from wixsharp.

talbotsk avatar talbotsk commented on August 27, 2024

Hi, I am facing the same problem, but with x86 architecture. Here you can find the allowed values for -arch switch:
https://wixtoolset.org/docs/tools/wixexe/#build

Your first proposed solution works only for x64, not for other architectures, because other architectures add Platform attribute to Package element. I think the x86 architecture should be the default option according to wix specification.

The second solution worked for me too.

I tryied to install your WixSharp_wix4 2.1.9-pre, but it failed:

Restoring packages for C:\s\sln\proj\InstallerSetup\InstallerSetup.csproj...
  CACHE https://api.nuget.org/v3/vulnerabilities/index.json
  CACHE https://api.nuget.org/v3-vulnerabilities/2024.06.19.23.26.49/vulnerability.base.json
  CACHE https://api.nuget.org/v3-vulnerabilities/2024.06.19.23.26.49/2024.06.20.11.26.49/vulnerability.update.json
NU1102: Unable to find package WixSharp_wix4.bin with version (>= 2.1.9)
  - Found 1 version(s) in WixSharpLocal [ Nearest version: 2.1.9-pre ]

Anyway I think that setting project.Platform = Platform.x64; to other platform than x64 will add unwanted attribute Platform to Package element.

I tryied to add WixOptions += " -arch x86 ". It didn't work for me. It was overwritten by previously inserted "-arch x64" left in the command line from BuildMsi(), e.g.:
"C:\Users\user\.dotnet\tools\wix.exe" build -sw1026 -sw1076 -sw1079 -sw1149 -arch x86 -ext "C:\Users\user\.wix\extensions\WixToolset.Util.wixext\4.0.5\wixext4\WixToolset.Util.wixext.dll" -ext "C:\Users\user\.wix\extensions\WixToolset.UI.wixext\4.0.5\wixext4\WixToolset.UI.wixext.dll" "C:\s\sln\proj\InstallerSetup\msi.wxs" -arch x64 -o "C:\s\sln\proj\InstallerSetup\msi.msi"
I am using class ManagedProject.

Can you resolve this issue also for x86 architecture or even better for any type of architectures? Thank you very much!

Edit: Could you internally read Platform property of the project set by business logic, set -arch for wix.exe accordingly and reset it to null for further processing, let the Platform attribute of Project element is not set?

from wixsharp.

talbotsk avatar talbotsk commented on August 27, 2024

@oleg-shilo does wixsharp\Source\src\WixSharp.Samples\Wix# Samples\External_UI\ConsoleSetup\Properties\Resources.resx missing in your repository wix-v4-master? I can't build:
static string SetupDependencies() { byte[] msiData = ConsoleSetup.Properties.Resource.MyProduct_msi;
There is an error:
Severity Code Description Project File Line Suppression State Details Error (active) CS0234 The type or namespace name 'Resource' does not exist in the namespace 'ConsoleSetup.Properties' (are you missing an assembly reference?) ConsoleSetup C:\s\wixSharp\wixsharp\Source\src\WixSharp.Samples\Wix# Samples\External_UI\ConsoleSetup\ConsoleSetup.cs 56
Also ManagedUI\SilentBA.cs and wixsharp\Source\src\WixSharp.Samples\Wix# Samples\Managed Setup\Self-executable_Msi\app.config is missing in repository.

from wixsharp.

oleg-shilo avatar oleg-shilo commented on August 27, 2024

Sorry. Done

from wixsharp.

oleg-shilo avatar oleg-shilo commented on August 27, 2024

Done.
The fix is released in v2.2.0

from wixsharp.

smaudet avatar smaudet commented on August 27, 2024

SilentBA is still not present here on v2.2.0 (or latest wix4 release).

I have cobbled together a replacement @oleg-shilo I noticed you seem to have two of them? One in wixsharp.UI and one in wixsharp core that the netcore build references. I think maybe you have a symlink on disk or something and your git is not committing the file.

from wixsharp.

oleg-shilo avatar oleg-shilo commented on August 27, 2024

Thank you @smaudet. Indeed is is a mistake from my side.
When I did the split Core vs Fx I had to split an move SilenBA and just forgot to add it to the repo.
Thank you it's fixed now.


Did you mean to post in a different thread?

from wixsharp.

smaudet avatar smaudet commented on August 27, 2024

Did you mean to post in a different thread?

What? Did you maybe mean this? #1582

Not sure what else you could mean...

from wixsharp.

oleg-shilo avatar oleg-shilo commented on August 27, 2024

This thread is about "Error when specifying Package Platform as ARM64". But your post was not related to that so I am checking if you wanted to post it in a different thread and we need to transfer it there.

from wixsharp.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.