Wixsharp: Wix v4?

Created on 18 Feb 2020  路  18Comments  路  Source: oleg-shilo/wixsharp

It鈥檚 possible to use wix# with wix v4?
What do you think about Wix v4?
Branch wix 4.0 preview seems abandoned...
I would like to do some tests with wix v4, where can I start?
Regards

enhancement

Most helpful comment

https://github.com/wixtoolset/wix4 has been split up to micro-repos, development is not happening there. Which is why there have been no builds, everything is a nuget package now. v4 is still in active development and unstable, but if you really want to play with the latest then look at the nuget feeds here.

All 18 comments

After some research, i found this:

As at 9 Dec 2018 these are still the bugs that are not fixed in WiX4. Efectivelly preventing WixSharp supporting this new platform.

Waiting for a new version of Wix v4...
Regards

Sorry, I believed I have responded on your first post the same day. But apparently I did not press "Comment" button and now I I have lost the original response text. :(
So answering again.

Yes you are right WiX4 is not ready. The official recommended version is v3.1*. I would prefer that WiX team was open enough and named the latest version "WiX 4.0-Beta". It would save me so much effort...

I have already migrated WixSharp to WiX4 twice. And every time it was quite a struggle. The problem is that in quite a few places WiX API was changed and required the corresponding changes in WixSharp codebase. It always lead to functionality being broken. And then investigation had to be conducted. Is it because om my change? Is it because of WiX4 deficiencies?And ALWAYS it was because of WiX.

So I gave up and decided to wait til WiX guys themselves recognize theis latest release as stable and ready. And this time is yet to come.

Thanks for the reply.

I played a little bit with the wix-4.0-Preview branch (https://github.com/K-Society/wixsharp/tree/wix-4.0-Preview) and the WiX v4 (v4.0.0.5918)(https://wixtoolset.org/releases/v4-0-0-5205/).

After a few small tweaks, I published the results on Nuget (for testing purposes only):

https://www.nuget.org/packages/Std.Install/1.0.2-alfa (like WixSharp)
https://www.nuget.org/packages/Std.Install.bin/1.0.2-alfa (like WixSharp.bin)

Last step is a working example at:
https://github.com/K-Society/Std.Install.RabbitMQ/blob/master/Setup.cs

Regards

Great. Do you think any of your wix-4.0-Preview worth merging to oleg-shilo/wixsharp/wix-4.0-Preview?

I'd be honored to collaborate.
I will try to merge K-Society/wixsharp/wix-4.0-Preview with oleg-shilo/wixsharp/wix-4.0-Preview as it is (I have never tried to merge two branches before).
Here are some information on the development environment I use:

  • Microsoft Visual Studio Community 2019 Version 16.4.5
  • .NET Framework 4.8

But I can adapt everything to your needs or preferences.
I think only you can decide if it is appropriate to proceed with merging.
Regards

https://github.com/wixtoolset/wix4 has been split up to micro-repos, development is not happening there. Which is why there have been no builds, everything is a nuget package now. v4 is still in active development and unstable, but if you really want to play with the latest then look at the nuget feeds here.

Thanks for this tip.
Basically I have to uninstall Wix Toolset v4.0 and download the nuget packages.
I want to try doing this.

I spent some time to experiment the latest libraries with WixSharp.
And I found out:

  1. The candle.exe (compiler) it no longer exists
  2. The light.exe (linker) it no longer exists
    Both are probably built into wix.exe or WixCop.exe as part of the Tools project, or are there other ways?
  3. The names of extensions libraries have changed:
    WixBalExtension.dll => WixToolset.Bal.wixext.dll (easy to fix)
  4. .wxs files have changed structure.

Perhaps @rseanhall can give us some pointers on how to take the first steps.
For example it would be interesting how to generate new .wxs and how to compile.
Regards.

I'm hesitant to provide further guidance since things are still unstable. The basic idea for now would be to install the dotnet-wix package as a .NET Core global tool which gets you wix.exe. You can look at the tests in Core. You can watch the WiX meetings and/or read the highlights to find some explanations of v4. Maybe start here.

Looks to me like breaking changes :(

  • Compilers. Are probably OK as long as wix.exe can be found in the deterministic way.
  • "_.wxs files have changed structure._" - this scares me

Why :(? Breaking changes are required to implement things like allowing EmbeddedUI.

.wxs files have changed structure.

I read this as the schema has changed from v3 to v4 which is technically true. I can't think of any elements that were removed or were moved under different elements, so the structure hasn't really changed. Most of the changes were attribute changes and were done well before the repo was split up.

:)
Well, ".wxs files have changed structure." sounded very dramatic. But, after your clarification:

can't think of any elements that were removed or were moved under different elements, so the structure hasn't really changed.

I feel much better. Txs.

And chances are that wix.exe will be handled very easy.

But the fact that https://github.com/wixtoolset/issues/issues/4921 is going to be addressed makes me completely happy.

It was actually me who I raised that original issue 4918 :)

=======

As a side note, Sean I am happy to see you participating in Wix#

Sorry for the unhappy sentence, for the next time I will add some explanations.
I don't want to be dramatic ;)
Now, after all, I think I have a lot of material to work on.
Give me time to get a better look at the tests in Core, and I will come back with new questions.
Regards.

LOL, sorry. I did not imply that you were over-dramatic :o)
Not at all. Just could not find a better adjective at the time. That's it.

All good.

I am still excited to see that wixtoolset/issues#4921 is in the release plan!

I looked at the examples in Core, and I found out how to use wix.exe.
In particular I found out which switches are available and which parameters, for example:
wix.exe build -ext "path to *.wixext.dll" "path to *.wxs" -bindpath "path to data directory" -intermediateFolder "path to wixTemp directory" -out "path to exe or msi"

I modified the wixsharp project (wix 4.0 preview) to try to get a working command for wix.exe:

_WixExtension.cs_
Well-known Wix Extension: Bal
public static WixExtension Bal = new WixExtension(IsWix4 ? @"%WixLocation%\WixToolset.Bal.wixext.dll" : @"%WixLocation%\WixBalExtension.dll", "bal", IsWix4 ? "http://wixtoolset.org/schemas/v4/wxs/bal" : "http://schemas.microsoft.com/wix/BalExtension");

_Compiler.cs_
Build method
The build method looks for the wix.exe executable in wix-bin directory.

GenerateCandleCommand method
The GenerateCandleCommand method already handles extensions (-ext) and output (-out) switches correctly.
I added the keyword "build", and I tried to add -bindpath and -intermediateFolder switches.

GenerateLightCommand method
The GenerateCandleCommand method is not used, in general I have removed the references to the linker.

_Compiler.Bootstrapper.cs_
In this class I did more or less the same changes as for the compiler class.

Results

Currently this version of wixsharp can generate a working command for wix.exe, but there is still some problem with the result.
For example the exe of a bundle type project doesn't start when I click on it (I have to investigate further).

Another example, the Shortcuts sample works well.

I have not changed anything concerning the generation of the wxs file, this confirms @rseanhall's post.

I think the way is the right one, but I will still have to do many tests.

-bindpath existed in v3, so if you weren't using it already you don't have to start now.

Burn (the WiX bootstrapper) creates logs in the %TEMP% directory. There should be errors in there saying what went wrong.

Thanks for the advice.

After a series of test I can now compile a project of bundle type with success, getting a working setup.

I'm currently struggling with CustomAction, for this I need the MakeSfxCA and SfxCA project but they are not available in the Dtf repository
or better Visual Studio cannot load the MakeSfxCA project because it cannot find the following file: WixBuild.targets.
Even the SfxCA project I can't load.

Am I doing something wrong?

WixBuild.targets is from the old build system. Looks like neither of them have been properly integrated into the micro repos. I don't know if Wix# uses wix.ca.targets but that's probably not working either.

To be honest, I can't give you a timeline on when that's going to happen. The other guys on the core team don't really care about managed CustomActions and there's still a lot of feature work that I want to get done in v4 that are technically breaking changes. It will get done eventually.

If you'd like to help us out, that would be great. Join the wix-devs mailing list and start a discussion on how to start publishing those tools.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

UweKeim picture UweKeim  路  5Comments

JasShao picture JasShao  路  4Comments

ltemimi picture ltemimi  路  5Comments

marcobeninca71 picture marcobeninca71  路  4Comments

UweKeim picture UweKeim  路  5Comments