2012-04-18 12 views
4

How to associate application with existing file types using WiX installer?およびHow to register file types/extensions with a WiX installer?に関連する。ユーザーごとのインストーラでWiXインストーラを使用して既存のファイルタイプとアプリケーションを関連付けるにはどうすればよいですか?

インストールがユーザー単位の場合、アプリケーションを既存のファイルタイプにどのように関連付けることができますか?

ませんHKLMキーは、私は、これはマシンごとのケースから本当に異なるものではないと信じて

答えて

4

を可能にしました。 (ユーザごとのインストールされている)downmarkerのために私は、アプリケーションの実行可能ファイルをインストールするコンポーネントでこれを置く:

<!-- 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> 

それとも、full wxs fileで見ることができます。

+0

OKです。しかし、他のスレッドに記述されているすてきなもの(Vista/7 Capabilities、Open with、start runのサポートなど)はどうでしょうか? – Roberto

+0

@Roberto:これらの機能が通常は 'HKLM'にレジストリエントリを置くことによって動作し、それらがユーザごとの機能としてサポートされていると仮定した場合、論理的には最初にレジストリエントリを' HKCU'に置きます。 'HKMU'を使うこともできます.wixは自動的に' HKCU'や 'HKLM'に自動的に解決されます。 –

+0

はい論理的には良いと思うが動作しない – Roberto

3

ここで私たちは..これはユーザーごとのアプリケーションで動作し、あなたが探している素敵なもののほとんどを提供するはずですが、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>