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

Should be possible to attach a ProgId directly to a component, without a COM registration #1733

Open
fredemmott opened this issue Jan 20, 2025 · 2 comments

Comments

@fredemmott
Copy link

For example, ProgIds are Microsoft's recommended (and more flexible) way to register file associations.

Example wxs: https://github.com/OpenKneeboard/OpenKneeboard/blob/2316b1290fef72750f0485a6ec0b618db04af4ca/installer/OpenKneeboardPluginFileType.wxs

@oleg-shilo
Copy link
Owner

oleg-shilo commented Jan 22, 2025

I have updated the ProgId implementation and from the next release you can place the ProgId entity outside of the COM registration:

// under the root dir
var project =
    new Project("MyProduct",
        new Dir(@"%ProgramFiles%\My Company\My Product",
            new ProgId
            {
                Id = "PROG.ID.8",
                Description = "Version independent ProgID "
            },

// or even under the project root
var project =
    new Project("MyProduct",
        new ProgId
        {
            Id = "PROG.ID.8",
            Description = "Version independent ProgID "
        },
        new Dir(@"%ProgramFiles%\My Company\My Product",

it will emit the ProgId element in the first parent component:

<Component Id="Component.MyApp.exe_3459324387" Guid="6f330b47-2577-43ad-9095-18614c7a0c75">
  <ProgId Id="PROG.ID.8" Description="Version independent ProgID " />
  <File Id="MyApp.exe_3459324387" Source="Files\Bin\MyApp.exe">

Please note that while it seems to work, it does not exactly align with WixSharp paradigm, which encourages setup definition with a component-less mindset. This is because components in MSI are kinda "the blast from the past" (24 years ago to be precise). As many other over-engineered concepts like minor-update, MSM etc.

Don't get me wrong you can use any MSI feature as you wish, it's simply there will be limits on how much component exposure WixSharp will offer. Though in your case of ProgId we are perfectly OK.

@oleg-shilo
Copy link
Owner

Done. Please update to v2.4.4

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

2 participants