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

Support for MSIX Installer in Wix# #1708

Open
Torchok19081986 opened this issue Dec 20, 2024 · 12 comments
Open

Support for MSIX Installer in Wix# #1708

Torchok19081986 opened this issue Dec 20, 2024 · 12 comments

Comments

@Torchok19081986
Copy link

Torchok19081986 commented Dec 20, 2024

Hallo, i found https://www.firegiant.com/docs/fg-wix/msix/integrating-the-firegiant-msix-extension/
Link for FireGiant in WixToolset. How can i create msix in WixSharp just like in description ? This seems that implemented into v4 Schema of WixToolset.

Merry X-Mas and Happy new Year for all.

@oleg-shilo
Copy link
Owner

It seems like you have already invested some time in MSIX. Can I ask you to share working WiX project that generates msix. I would like to use it as a benchmark for creating the integration layer with WixSharp.

Merry Christmas to you too.

@ltemimi
Copy link

ltemimi commented Dec 29, 2024

I have invested tons of time getting wixharp to work with msix only to restart again to the old msi why ? msix does not work in windows server even 2020. I also spent a lot of time trying to get msix to work on windows servers (legacy ones)

Hope it will help

@oleg-shilo
Copy link
Owner

Unfortunately, this is my experience too.
I have already done three comprehensive waves of investigations into the possible integration of MSIX with WixSharp. And every time it was the same story. A promising start but a dead end with achieving the final goal either because of the lack of documentatiopns/samples or tooling deficiencies.
Every time the cost of such investigation is very high and I end up with the backlog buildup. This is the reason why I do not want to invest in it anymore unless there is a solid working foundation for such an investigation to be conducted.

I hope it explains.

@Torchok19081986
Copy link
Author

Evening. I can only share my expierence sofar. I witnessed msix for install MS-Teams with msix installer on Windows OS 2022 and 2025. This works. I seen it live with sysadmins. MSIX cant be execute on windows Server OS 2022 and better. There is Registy Hack for activation. Until i create all my msix pacakge with ms store tool - MSIX Package tool. MSI and MSIX has sofar same structure: ProductId, Companyname ect. Difference is only that MSIX has to be certificated with pfx or .cert file. Maybe for UAC or somethin inside windows installer self. Cert or pfx File used to for signing new created msix file.

@oleg-shilo
Copy link
Owner

Thank you @Torchok19081986, but what you are describing is the fact that you saw MSIX working. Great. But I have no doubts about that. This us the User Experience.

My concern is Dev Experience. I haven's seen any code sample that I can repeat and get a working MSIX.
Thus it reminds me of catching the black cat in the dark room. I have made three attempts already and it's very expensive to continue this "research" until there is a good use case that can be used as a benchmark. I simply thought that you have such a use case.

@Torchok19081986
Copy link
Author

Torchok19081986 commented Jan 3, 2025

morning, i done some research to create msix package just from link in pure wix toolset v4 and HeatWave. Unforutenally i cant create new account on firegiant. Email to verifycation code is blank or empty, shows only picture of firegiant. You need Account to get licensing file for creation of msix file. 😵‍💫😵‍💫😵‍💫😵‍💫
error on build and link
https://www.firegiant.com/docs/fg-wix/getting-started/firegiant-licensing/

i can also post wxs file

<Wix xmlns="http://wixtoolset.org/schemas/v4/wxs" xmlns:msix="http://www.firegiant.com/schemas/v4/wxs/heatwave/buildtools/msix" >
	
  <Package Name="WixToolsetMSIXCreation" Language="1033" Version="1.0.0.0" Manufacturer="MSIX Creator" UpgradeCode="3249c7ea-50ed-4670-97b4-b28411dee832" InstallerVersion="200">
    <msix:Msix Id="Example" Publisher="CN=Example" />
		

		<MajorUpgrade DowngradeErrorMessage="A newer version of [ProductName] is already installed." />
		

		<Feature Id="ProductFeature" Title="WixToolsetMSIXCreation" Level="1">
			<ComponentGroupRef Id="ProductComponents" />
		</Feature>
	</Package>

	<Fragment>
			<StandardDirectory Id="ProgramFilesFolder">
				<Directory Id="INSTALLFOLDER" Name="WixToolsetMSIXCreation" />
			</StandardDirectory>
		</Fragment>

	<Fragment>
		<ComponentGroup Id="ProductComponents" Directory="INSTALLFOLDER">
			<!-- TODO: Remove the comments around this Component element and the ComponentRef below in order to add resources to this installer. -->
			<!-- <Component Id="ProductComponent"> -->
				<!-- TODO: Insert files, registry keys, and other resources here. -->
			<!-- </Component> -->
		</ComponentGroup>
	</Fragment>
</Wix>

@oleg-shilo
Copy link
Owner

Well, achieving the generation of presumably valid wxs file and the build command is simple:

static class WixSharpExtensions
{
    public static void BuildMsix(this Project project)
    {
        project.Include(new WixExtension(
            "FireGiant.HeatWave.BuildTools.Msix.wixext", "msix",
            "http://www.firegiant.com/schemas/v4/wxs/heatwave/buildtools/msix"));

        project.WixBuildCommandGenerated += (cmd) => " -outputType msix " + cmd;
        project.BuildMsi();
    }
}

And if you want to experiment further you can even implement your own MSIX classes (e.g. MsixApplication):

public class Program
{
    static void Main()
    {
        var project = new Project("MyProduct",
                              new Dir(@"%ProgramFiles%\My Company\My Product",
                                  new File("Program.cs",
                                      new MsixApplication
                                      {
                                          Id = "MyProductApp",
                                          OverrideDisplayName = "My Desktop Product"
                                      })));

        project.GUID = new Guid("72a3b240-c984-4ef8-91e2-2b0319cd0aec");

        project.BuildMsix();
    }
}

public class MsixApplication : WixEntity, IGenericEntity
{
    [Xml]
    public new string Id { get => base.Id; set => base.Id = value; }

    [Xml]
    public string OverrideDisplayName;

    public void Process(ProcessingContext context)
    {
        var extension = new WixExtension(
            "FireGiant.HeatWave.BuildTools.Msix.wixext", "msix",
            "http://www.firegiant.com/schemas/v4/wxs/heatwave/buildtools/msix");

        context.Project.Include(extension);
        context.XParent.Add(this.ToXElement(extension, "Application"));
    }
}

static class WixSharpExtensions
{
    public static void BuildMsix(this Project project)
    {
        project.WixBuildCommandGenerated += (cmd) => " -outputType msix " + cmd;
        project.BuildMsi();
    }
}

However, in the absence of a valid HeatWave licence, it's impossible to build the msix and verify the correctness of the approach.

So there's nothing I can do about this. FireGiant does not offer any licencing model for Open Source developers and the proper dev licence starts from 5,000 USD per year so acquiring it is out of the question.

I do not blame them. This is how they want to build their business. It's just this model is not compatible with the Open Source story that WixSharp belongs to.

@oleg-shilo
Copy link
Owner

I have reflected this discussion on wiki: https://github.com/oleg-shilo/wixsharp/wiki/Support-for-MSIX

@Torchok19081986
Copy link
Author

Torchok19081986 commented Jan 7, 2025

morning, i did not try this approach until now. Thanks for sharing some code to create own methods and msix creation. Heatwave is opensource and package libs also. For MSIX Generation in link description no pricing for license descripted / required.
I read it multiplpe timies, but no mention of license which you should get from firegiant self. Such important Note should exists. OR Documentation for programmer are NOT necessary. 😵‍💫😐🤔😧🤨🤨

@oleg-shilo
Copy link
Owner

This is what I found for support: https://www.firegiant.com/services/
image

I have also created an account with them and it had no license:
image

All this smells like a typical story of the overpriced product that only large organizations can afford.

@Torchok19081986
Copy link
Author

i dont know if it possible, just some thoughts. Why we rely on wix toolset in v4 to create msix ? Let see it from another seepoint. There is commandline https://learn.microsoft.com/en-us/windows/msix/packaging-tool/package-conversion-command-line

MsixPackagingTool.exe create-package --template c:\users\documents\ConversionTemplate.xml -v

this let us create msix from xml file as descripton for new msix output. Where , i think, xml has all data just like all datatables in msi.

Wix# In V4 do already own compilation, AOT, cant be jsut start process to create msix as optional parameter as well ? Xml can be created and saved from packaing tool self. All together let us create msix and not rely on wix toolset.

@Torchok19081986
Copy link
Author

template file, taking from ms looks following, looks really like old msi.

MSIX Temaplate.txt

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

No branches or pull requests

3 participants