2009-03-12 10 views

答えて

6

これが私のやり方です。 </Product>

<Icon Id="Icon.exe" SourceFile="..\Installer\Graph.ico" /> 

と、次のように参照としてこれを追加しました:私は宣言

<ProgId Id='myApp.exe' Description='Some description' Advertise='yes' Icon='Icon.exe'> 
      <Extension Id='xyz' ContentType='application/text'> 
      <Verb Id='open' Sequence='10' Command='Open' Argument='"%1"' /> 
      </Extension> 
</ProgId> 
7

FROM:http://www.tramontana.co.hu/wix/lesson1.php#1.7

アプリケーションは、独自のファイル・データ・タイプを処理する場合、あなたはそれのためにファイルの関連付けを登録する必要があります。 ProgIdをコンポーネントの中に置きます。 FileIdは、この拡張機能のファイルを扱うためのファイルを記述するFile要素のId​​属性を参照する必要があります。このファイルタイプにアイコンを割り当てるには

<ProgId Id='AcmeFoobar.xyzfile' Description='Acme Foobar data file'> 
    <Extension Id='xyz' ContentType='application/xyz'> 
    <Verb Id='open' Sequence='10' Command='Open' Target='[!FileId]' Argument='"%1"' /> 
    </Extension> 
</ProgId> 

、あなたのコンポーネント内に自分自身を適切なレジストリエントリを指定する必要があります:それは代わりに、長い1のファイルの短いパスを返します:感嘆符に注意してください

<Registry Id='FooIcon1' Root='HKCR' Key='.xyz' Action='write' 
    Type='string' Value='AcmeFoobar.xyzfile' /> 
<Registry Id='FooIcon2' Root='HKCR' Key='AcmeFoobar.xyzfile' Action='write' 
    Type='string' Value='Acme Foobar data file' /> 
<Registry Id='FooIcon3' Root='HKCR' Key='AcmeFoobar.xyzfile\DefaultIcon' Action='write' 
    Type='string' Value='[INSTALLDIR]Foobar.exe,1' /> 
+1

そして、何Foobar.exeバリュー内側= '[INSTALLDIR] Foobar.exe、1' />を参照していますか?それはどこにありますか? – Filip

+0

リンクが死んでいます – DonDon

0

私はにアイコンを埋め込む最もシンプルでエレガントな方法のためhereに位置し、私のスタックオーバーフローのポストを、次のお勧めします管理された.NETアプリケーションでC++プロジェクトを必要としないリソース

次に、ここでのWiXを介してこれを設定するための適切な方法がある:

<Component Id="stackoverflowFileRegistration" Guid="MY_GUID"> 

    <RegistryKey Root="HKCR" Key=".stackoverflow" ForceCreateOnInstall="yes" ForceDeleteOnUninstall="yes"> 
     <RegistryValue Value="stackoverflow.Document" Type="string" KeyPath="yes" /> 
     <RegistryValue Name="Content Type" Value="application/stackoverflow" Type="string" /> 
     <RegistryKey Key="ShellNew" ForceCreateOnInstall="yes" ForceDeleteOnUninstall="yes"> 
     <RegistryValue Name="NullFile" Value="" Type="string" /> 
     <RegistryValue Name="Data" Value="Default new document Content.. NOTE: you must use a MutiStringValue nodes for multi-line content...." Type="string"/> 
     </RegistryKey> 
    </RegistryKey> 

    <RegistryKey Root="HKCR" Key="stackoverflow.Document" ForceCreateOnInstall="yes" ForceDeleteOnUninstall="yes"> 
     <RegistryValue Value="stackoverflow Document" Type="string" /> 

     <RegistryKey Key="DefaultIcon" ForceCreateOnInstall="yes" ForceDeleteOnUninstall="yes"> 
     <RegistryValue Value="[INSTALLDIR]bin\stackoverflow.lib.dll, 1" Type="string" /> 
     </RegistryKey> 

     <RegistryKey Key="Shell" ForceCreateOnInstall="yes" ForceDeleteOnUninstall="yes"> 
     <RegistryKey Key="openstackoverflowwebsite" ForceCreateOnInstall="yes" ForceDeleteOnUninstall="yes"> 
      <RegistryValue Value="Open Stackoverflow" Type="string" /> 
      <RegistryKey Key="command" ForceCreateOnInstall="yes" ForceDeleteOnUninstall="yes"> 
      <RegistryValue Value="&quot;[INSTALLDIR]stackoverflow.exe&quot; /openwebsite &quot;%1&quot;" Type="string" /> 
      </RegistryKey> 
     </RegistryKey> 
     </RegistryKey> 

    </RegistryKey> 
    </Component> 

このサンプルでは、​​ステップ1からアセンブリ内に配置されている特定のファイル拡張子(.stackoverflow)のデフォルトアイコンを登録します右クリックコマンドに関連するWindowsエクスプローラを作成する方法と、Windowsエクスプローラの新規サブメニューにメニュー項目を追加する方法も示しています。

おかげ

-Blake Niemyjski

+0

このコードはWIX 3.6で動作します... –

関連する問題