Installation 如何在每用户安装程序中使用WiX安装程序将应用程序与现有文件类型关联?

Installation 如何在每用户安装程序中使用WiX安装程序将应用程序与现有文件类型关联?,installation,wix,windows-installer,Installation,Wix,Windows Installer,与和有关 如果按用户安装,如何将应用程序与现有文件类型关联 不允许使用HKLM密钥我相信这与每台机器的情况没有什么不同。对于(每个用户安装)我将其放在安装应用程序可执行文件的组件中: <!-- associate .md file extension with downmarker --> <ProgId Id="DownMarker" Icon="downmarker.exe" Description="Markdown Document"> <

与和有关

如果按用户安装,如何将应用程序与现有文件类型关联


不允许使用HKLM密钥

我相信这与每台机器的情况没有什么不同。对于(每个用户安装)我将其放在安装应用程序可执行文件的组件中:

<!-- associate .md file extension with downmarker -->
<ProgId Id="DownMarker" Icon="downmarker.exe" 
    Description="Markdown Document">
    <Extension Id="md" >
       <Verb Id="open" Argument="&quot;%1&quot;"
          TargetFile="downmarker.exe" />
    </Extension>
</ProgId>


或者你可以看一下。

我们开始。。这应该适用于每个用户的应用程序,并提供您正在寻找的大多数好东西,除了start>run(仅适用于每台机器)之外

<Icon Id="filetype.ico" SourceFile="filetype.ico" />
<Component Id="MyApp.exe" Directory="APPLICATIONFOLDER" Guid="*">
    <File Id="MyApp.exe" Name="MyApp.exe" KeyPath="yes"/>

    <Shortcut Id="startmenuShortcut" Directory="ProgramMenuFolder" Name="MyApp" Icon="$(var.product).ico" IconIndex="0" WorkingDirectory="APPLICATIONFOLDER" Advertise="yes" />

    <!-- Capabilities keys for Vista/7 "Set Program Access and Defaults" -->
    <RegistryValue Root="HKCU" Key="SOFTWARE\MyApp\Capabilities" Name="ApplicationDescription" Value="!(loc.ApplicationDescription)" Type="string" />
    <RegistryValue Root="HKCU" Key="SOFTWARE\MyApp\Capabilities" Name="ApplicationIcon" Value="[APPLICATIONFOLDER]MyApp.exe,0" Type="string" />
    <RegistryValue Root="HKCU" Key="SOFTWARE\MyApp\Capabilities" Name="ApplicationName" Value="!(loc.ApplicationName)" Type="string" />
    <RegistryValue Root="HKCU" Key="SOFTWARE\MyApp\Capabilities\DefaultIcon" Value="[APPLICATIONFOLDER]MyApp.exe,1" Type="string" />
    <RegistryValue Root="HKCU" Key="SOFTWARE\MyApp\Capabilities\FileAssociations" Name=".xyz" Value="MyApp.Document" Type="string" />
    <RegistryValue Root="HKCU" Key="SOFTWARE\MyApp\Capabilities\MIMEAssociations" Name="application/xyz" Value="MyApp.Document" Type="string" />
    <RegistryValue Root="HKCU" Key="SOFTWARE\MyApp\Capabilities\shell\Open\command" Value="&quot;[APPLICATIONFOLDER]MyApp.exe&quot; &quot;%1&quot;" Type="string" />
    <RegistryValue Root="HKCU" Key="SOFTWARE\RegisteredApplications" Name="MyApp" Value="SOFTWARE\MyApp\Capabilities" Type="string" />

    <!-- Extend to the "open with" list + Win7 jump menu pinning  -->
    <RegistryValue Root="HKCR" Key="Applications\MyApp.exe\SupportedTypes" Name=".xyz" Value="" Type="string" />
    <RegistryValue Root="HKCR" Key="Applications\MyApp.exe\shell\open" Name="FriendlyAppName" Value="!(loc.ApplicationName)" Type="string" />

    <!-- MyApp.Document ProgID -->
    <RegistryValue Root="HKCR" Key="MyApp.Document" Name="FriendlyTypeName" Value="!(loc.DescXYZ)" Type="string" />
    <ProgId Id="MyApp.Document" Description="!(loc.DescXYZ)" Icon="filetype.ico" Advertise="yes">
        <Extension Id="xyz">
            <Verb Id="open" Command="!(loc.ExplorerMenuOpenXYZ)" Argument="&quot;%1&quot;" />
            <MIME Advertise="yes" ContentType="application/xyz" Default="yes" />
        </Extension>
    </ProgId>

    <!-- Optional: add an 'Edit with XYZ' to 'right click' even when not associated -->
    <RegistryValue Root="HKCR" Key="SystemFileAssociations\.xyz\shell\edit.MyApp.exe" Value="!(loc.ExplorerMenuEditXYZ)" Type="string" />
    <RegistryValue Root="HKCR" Key="SystemFileAssociations\.xyz\shell\edit.MyApp.exe\command" Value="&quot;[APPLICATIONFOLDER]MyApp.exe&quot; &quot;%1&quot;" Type="string" />
</Component>


好的,你说得对。但是,其他线程中描述的所有好东西(如Vista/7功能、打开方式、支持开始运行)又如何呢?@Roberto:如果这些功能通过将注册表项放入
HKLM
中正常工作,并且我们假设它们也根据用户功能得到支持,从逻辑上讲,我的第一次尝试是将这些注册表项放在
HKCU
下。您甚至可以使用
HKMU
,wix会根据需要自动解析为
HKCU
HKLM
。@roberto:那么我想这些功能“每个用户”都不受支持。好吧,我不明白为什么(可能是我做错了什么事),但现在它正在工作