0

In my Wix project, I need to set an external application as the default program for a new file type, so I add some file associations in registry keys(weird I know, but I'm developing a plugin and I don't find a native way to deal with external programs). MSDN says we should call SHChangeNotify if we change file associations. If not, the new association will not work until the system restarts. Here is my problem, how can I do this in Wix? I find a tool which implements this feature but what I need is hard code this in Wix Installer.

[solution] At first I add ProgId element the way @BdN3504 shows. Then I use Custom Action to send SHChangeNotify. Cheers~

4

1 回答 1

1

你看过这个答案吗?

您必须首先在 a 中找到目标应用程序,FileSearch然后在Extension元素中引用它。

<Property Id="TARGETEXE">
    <DirectorySearch Path="C:\Program Files (x86)\App"
        Depth="0"
        AssignToProperty="no"
        Id="NppSearch">
            <FileSearch Name="Target.exe"
                Id="targetExeFileSearch" />
    </DirectorySearch>
</Property>
<ProgId Id='Fileassoc.assoc' Description='File extension description'>
  <Extension Id='assoc' ContentType='application/assoc'>
    <Verb Id='open' Command='Open' TargetProperty='TARGETEXE' Argument='"%1"' />
  </Extension>
</ProgId>

请参阅文档

于 2013-09-19T10:29:06.657 回答