[wix-users] Experience of build with WiX 4 Toolset

Sean Hall r.sean.hall at gmail.com
Fri Nov 4 14:34:21 PDT 2022


> For example when I retrieve the value of a string variable. null is
returning in v3, but I get an exception in v4 that is not documented in the
interface description. I see, it is a work in progress, so it is all right.

The work for bundles in v4 is completed. Please file a bug with all
the necessary details.

> It will require a lot of work on projects in order to move build from the
command line to msbuild on CI/CD.

You are compiling C# DLLs with csc.exe instead of MSBuild? The world has
moved to .nupkgs and so has WiX v4.

> You said that it makes it possible to use the trimming. I think it does
not work "out of the box". Could you share any recommendations?

.NET doesn't officially support trimming WPF/MAUI/WinForms apps. WiX has
done its part by removing the reflection. Getting trimming officially
supported for UI apps will take a lot of work for the .NET team so people
will need to raise their concerns in order for them to know it's a
worthy investment.

There is a test in our code that trims a very simple headless
self-contained BA and that works - look in src\ext\Bal\test. I'm not sure I
see the point of a single-file BA when the bundle itself is a single file.

>I think the wix compiler definitely will say something like that
> You need at least a one prereq package when adding a custom MBA.

The .NET Core host supports a self-contained BA so that no prereq packages
are required.
<bal:WixDotNetCoreBootstrapperApplicationHost SelfContainedDeployment="yes"
/>

1. v4 added MajorUpgrade/@IgnoreLanguage and the default is no. That's a
breaking change from v3.

2. The BA doesn't own the process. It should not shutdown until the engine
calls OnShutdown. If it wants to cancel an operation, it has to wait for
the engine to send it an event that can be canceled. Calling Engine.Quit in
the middle of an operation won't cause it to immediately quit. It will
finish the current operation first. I'm guessing that you're seeing it hang
or crash because it tried to send an event to the BA but the BA had closed
already.

> What are the software and system requirements to use BA and other WiX
packages on a user machine?

For v4 bundles (and any other native code), the requirement is Vista/Server
2008 or newer. The BA's requirements depend on which technology you built
your BA with.

On Wed, Nov 2, 2022 at 7:49 AM Timofey Evsyutkin <
goldghost.oomphi.suppository at gmail.com> wrote:

> In addition to what I asked.
> Most likely, I started with the wrong thing when
> I asked about the publish. I think it would be better firstly to ask:
> What are the software and system requirements
> to use BA and other WiX packages on a user machine?
>
> For example,
> .NET Desktop Runtime must be installed if using a custom NET Core MBA.
> .NET Runtime should be sufficient if only quiet mode is used.
> ASP.NET Core Runtime must be installed if using the IIS extension.
>
> This is true?
> Are there any installation prerequisites to use a compiled bundle?
> Are there any new runtime dependencies?
>
> ср, 2 нояб. 2022 г. в 14:16, Timofey Evsyutkin <
> goldghost.oomphi.suppository at gmail.com>:
>
>> I wrote before I watched the last meetings and dojo videos.
>> So now I don't worry too much about it.
>>
>> >> I don't think it's throwing more exceptions than v3.
>> >> Do you have any examples?
>> For example when I retrieve the value of a string variable.
>> null is returning in v3, but I get an exception in v4 that
>> is not documented in the interface description.
>> I see, it is a work in progress, so it is all right.
>>
>> >> It is generated code instead of using reflection so that
>> >> it can be possible to use trimming.
>> >> What's the problem with using that package?
>> I understand that it is a good solution. I will try to describe a problem.
>> It will require a lot of work on projects in order to move build
>> from the command line to msbuild on CI/CD, and
>> it's not even planned to be done. In nowtime,
>> I can download nuget packages, then I unpack them and
>> I use the binaries as they are, and
>> the similar way as they were in version 3.
>> Except the WixToolset.Dnc.HostGenerator package, which
>> has to be connected in a different way.
>> I could store the package locally and restore it from there, but
>> I'd rather wait for the release of preview.1 now to do it naturally.
>>
>> You said that it makes it possible to use the trimming.
>> I think it does not work "out of the box".
>> Could you share any recommendations?
>> I want to try to get a published single-file self-contained
>> custom MBA that depends on the platform (native code)
>> from my C# code and run it. But I do not know if I can get it?
>> I think the wix compiler definitely will say something like that
>> You need at least a one prereq package when adding a custom MBA.
>>
>> Recently, I have finished migrating our projects
>> to WiX Toolset v4 and .NET 6 and I got some prototypes, which
>> as are expected they would cover the common cases.
>> There are still a number of questions left and
>> I am working on them.
>> The following things does not work completely and
>> I do not understand how to do it correctly:
>>
>> 1. A Updating MSI by another MSI with the same version, but
>> with a different product language, while
>> AllowSameVersionUpgrades attribute is active.
>>
>> The updating has not applied,
>> only unregistering of the bundle occurs, which
>> is corrected by restoring to the previous version.
>>
>> 2. Is it possible to cancel or interrupt the process in any place
>> where it is required?
>> For example,
>> by pressing the "Cancel" button or closing the MBA window.
>>
>> I close the UI of the MBA and call the Engine.Quit method, but
>> Engine does not respond and all processes hang.
>> Sometimes when it has closed, the return code is -1073741819.
>> But there were no details in the logs.
>>
>> I did not try to do it softly by sending cancel in the event args and
>> waiting for a response. Cause I think it does not matter in this case.
>> Perhaps I am doing something wrong.
>>
>> ср, 19 окт. 2022 г. в 21:24, Sean Hall via wix-users <
>> wix-users at lists.wixtoolset.org>:
>>
>>> I don't think it's throwing more exceptions than v3. Do you have any
>>> examples?
>>>
>>> Managed code BA's have a DLL provided by WiX that starts up the .NET
>>> runtime (dnchost.dll for .NET Core BA's). After starting the runtime, it
>>> calls into an entry point in the managed code. That entry point is the
>>> code
>>> that is generated by WixToolset.Dnc.HostGenerator. It is generated code
>>> instead of using reflection so that it can be possible to use trimming.
>>> What's the problem with using that package?
>>>
>>> On Wed, Oct 19, 2022 at 1:48 AM Timofey Evsyutkin via wix-users <
>>> wix-users at lists.wixtoolset.org> wrote:
>>>
>>> > The implementation WixToolset.Mba.Core.Engine throws more exceptions
>>> > than expected from the interface WixToolset.Mba.Core.IEngine.
>>> > I think there are not enough comments.
>>> >
>>> > A question.
>>> > Is there any way to build a workable DotNETCore MBA
>>> > without adding a PackageReference of the WixToolset.Dnc.HostGenerator
>>> > explicitly?
>>> >
>>>
>>> ____________________________________________________________________
>>> WiX Toolset Users Mailing List provided by FireGiant
>>> http://www.firegiant.com/
>>>
>>


More information about the wix-users mailing list