Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Creating file association with WiX Toolset

I created an application that can open image files. Now I'm creating an installer using the WiX Toolset. For the last couple of days, I am stuck with some misunderstanding: trying to register my app and associate it with desired extensions. Everything appears in the registry but none of my files open with my application, as if it was not installed.

This is the part where I describe the executable file and register all of the extensions for it:

<Component Id="CmpLightImageViewer.exe" Guid="{...}">
  <File Id="MainExe" Name="LightImageViewer.exe" />
</Component>

<Component Id="CmpLightImageViewerProgId" Guid="{391FBC30-B5A1-4AB7-8FA4-254C1CE2BF69}" KeyPath="yes">
  <ProgId Id="LightImageViewerSvg" Description="Light image viewer">
    <Extension Id="svg">
      <Verb Id="open" TargetFile="MainExe" Argument="&quot;%1&quot;" />
    </Extension>
  </ProgId>
  <ProgId Id="LightImageViewerGif" Description="Light image viewer">
    <Extension Id="gif">
      <Verb Id="open" TargetFile="MainExe" Argument="&quot;%1&quot;" />
    </Extension>
  </ProgId>
...
</Component>

That is what I see in my registry HKCR. The same in HKCU/Software/Classes, but not in HCLM/Software/Classes:

enter image description here

What am I missing? What else do I need to do to make it work? While I can set file associations manually for each type using Windows tools, that's not how I want it to work.

I'm building it with vs2015 in windows10 using wix3.10

like image 940
birdy90 Avatar asked Oct 31 '22 12:10

birdy90


1 Answers

This is the sort of security feature started in Vista - Windows protects "default" associations, allowing the user to select them. If you want your program to be the "default" for handling existing file types, thus overriding user settings (this is exactly what this feature was supposed to prevent, as far as I understand), then you may take a look at this question for an example:

How to associate application with existing file types using WiX installer?

like image 119
Nikolay Avatar answered Nov 15 '22 05:11

Nikolay