2013-01-29 19 views
6

WiX v3.7を使用してWindowsアプリケーションのインストーラプロジェクトを作成しようとしています(VS2012にはセットアップとデプロイメントプロジェクトが含まれていません)。 WixツールセットはVSにエンゲージされ、私は新しいWiXシングルインストーラセットアッププロジェクトを作成しています。インストーラは常に正常にコンパイルされています(アイコンの拡張子の警告を除く)、完璧に実行され、デスクトップショートカットが必要な場所に配置されますが、Windows 7 Professional x64 Service Pack 1に適切なスタートメニューのショートカットを配置できません。 Webと私が見るものはほとんど何でも試しましたが、これまでのところ成功していません。 product.wxsファイルは次のとおりです。 "my_guid"文字列は、プロジェクトの適切なGUIDSに置き換えられます。明らかに私は一点を欠いているが、どこを見ることができない。レジストリキーも作成されないため、最後のフラグメントは理由によって実行されない可能性があります。どのようにこれを解決することができますか?Wixインストーラのスタートメニューのショートカットが表示されない

<?xml version="1.0" encoding="UTF-8"?> 
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi"> 
    <Product Id="my_guid" Name="WixSingleSetupExample" Language="1055" Version="1.0.0.0" Manufacturer="Can Yucel" UpgradeCode="my_guid"> 
     <Package InstallerVersion="200" Compressed="yes" InstallScope="perMachine" /> 

     <MajorUpgrade DowngradeErrorMessage="A newer version of [ProductName] is already installed." /> 
     <MediaTemplate /> 

     <Feature Id="ProductFeature" Title="WixSingleSetupExample" Level="1"> 
      <ComponentGroupRef Id="ProductComponents" /> 
      <ComponentRef Id="ApplicationShortcut" /> 
     </Feature> 
    </Product> 

    <Fragment> 
     <Directory Id="TARGETDIR" Name="SourceDir"> 
      <Directory Id="DesktopFolder" Name="Desktop" /> 
      <Directory Id="ProgramMenuFolder"> 
       <Directory Id="ApplicationProgramsFolder" Name="WixSingleSetup"/> 
      </Directory> 
      <Directory Id="ProgramFilesFolder"> 
       <Directory Id="INSTALLFOLDER" Name="WixSingleSetupExample" /> 
      </Directory> 
     </Directory> 
    </Fragment> 

    <Fragment> 
     <ComponentGroup Id="ProductComponents" Directory="INSTALLFOLDER"> 
      <!-- TODO: Remove the comments around this Component element and the ComponentRef below in order to add resources to this installer. --> 
      <Component Id="ProductTextFile"> 
       <File Source="blankText.txt" KeyPath="yes"> 
        <Shortcut Id="desktopShortcut" Advertise="yes" Directory="DesktopFolder" Name="WixSingleSetup Help" WorkingDirectory="INSTALLFOLDER" Icon="icon1.txt" IconIndex="0"> 
         <Icon Id="icon1.txt" SourceFile="blankText.txt"/> 
        </Shortcut> 
       </File>  
      </Component> 
     </ComponentGroup> 
    </Fragment> 

    <Fragment> 
    <DirectoryRef Id="ApplicationProgramsFolder"> 
     <Component Id="ApplicationShortcut" Guid="my_guid"> 
     <Shortcut Id="ApplicationStartMenuShortcut" 
        Name="WixSingleSetup Help" 
        Description="Setup Example" 
        Target="blankText.txt" 
        WorkingDirectory="INSTALLFOLDER" 
        Icon="icon2.txt" 
        IconIndex="0"> 
      <Icon Id="icon2.txt" SourceFile="blankText.txt"/> 
     </Shortcut> 
     <RemoveFolder Id="ApplicationProgramsFolder" On="uninstall"/> 
     <RegistryValue Root="HKCU" Key="Software/Microsoft/WixSingleSetup" Name="installed" Type="integer" Value="1" KeyPath="yes" /> 
     </Component> 
    </DirectoryRef> 
    </Fragment> 
</Wix> 
+5

ログインし 'ます。msiexec/I WixSingleSetupExample.msi/lvoicewarmupx log.txt'と見ますインストールされています。 – BryanJ

+0

質問したとおりにしましたが、出力ログファイルの長さは1545行です。ログファイルのスタートアップパスは正しいですが、エラーの表示は表示されませんでした。見た目はどこに?または、もし望むなら、ここにファイルリンクを送ることができます。 – mcy

+0

以下の回答から問題を解決しました。しかし、あなたのコメントで、私はログに記録する方法を学んだので、ありがとう。 – mcy

答えて

16

私は、将来の参照や質問に対する正確な答えのために意図したとおりに動作するコードを追加してい:

<?xml version="1.0" encoding="UTF-8"?> 
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi"> 
    <Product Id="guid_here" Name="WixSingleSetupExample" Language="1055" 
      Version="1.0.0.0" Manufacturer="Can Yucel" UpgradeCode="guid_here"> 
    <Package InstallerVersion="200" Compressed="yes" InstallScope="perMachine" /> 

    <MajorUpgrade DowngradeErrorMessage="A newer version of [ProductName] is already installed." /> 
    <MediaTemplate /> 

    <Feature Id="ProductFeature" Title="WixSingleSetupExample" Level="1"> 
     <ComponentGroupRef Id="ProductComponents" /> 
     <ComponentRef Id="ProgramMenuDir"/> 
    </Feature> 
    </Product> 

    <Fragment> 
    <Directory Id="TARGETDIR" Name="SourceDir"> 

     <Directory Id="DesktopFolder" Name="Desktop" /> 

     <Directory Id="ProgramMenuFolder" Name="Programs"> 
     <Directory Id="ApplicationProgramsFolder" Name="WixSingleSetup"> 
      <Component Id="ProgramMenuDir" Guid="guid_here"> 
      <RemoveFolder Id="ProgramMenuDir" On="uninstall"/> 
      <RegistryValue Root="HKCU" Key="Software\[Manufacturer]\WixSetup" 
          Type="integer" Value="1" Name="installed" KeyPath="yes" /> 
      </Component> 
     </Directory> 
     </Directory> 


     <Directory Id="ProgramFilesFolder"> 
     <Directory Id="INSTALLFOLDER" Name="WixSingleSetupExample" /> 
     </Directory> 
    </Directory> 
    </Fragment> 

    <Fragment> 
    <ComponentGroup Id="ProductComponents" Directory="INSTALLFOLDER"> 
     <!-- TODO: Remove the comments around this Component element and the 
      ComponentRef below in order to add resources to this installer. --> 
     <Component Id="ProductTextFile"> 
     <File Source="blankText.txt" KeyPath="yes"> 
      <Shortcut Id="desktopShortcut" Advertise="yes" Directory="DesktopFolder" 
        Name="WixSingleSetup Help" WorkingDirectory="INSTALLFOLDER" 
        Icon="icon1.txt" IconIndex="0"> 
      <Icon Id="icon1.txt" SourceFile="blankText.txt" /> 
      </Shortcut> 
      <Shortcut Id="startMenuShotcut" Directory="ApplicationProgramsFolder" 
        Name="WiXSingleSetup Help" WorkingDirectory="INSTALLFOLDER" 
        Icon="icon2.txt" IconIndex="0" Advertise="yes"> 
      <Icon Id="icon2.txt" SourceFile="blankText.txt"/> 
      </Shortcut> 
     </File>  
     </Component> 
    </ComponentGroup> 
    </Fragment> 
</Wix> 
+1

+1私はこれをやろうとしています。ありがとうございますそれは完全に動作します。 –

+0

@mcyそれであなたが解決した問題は何ですか? – nam

0

私は最近、ウィックスを使用し始めていると私は問題に捕まってしまっましたあなたは数週間記述します。

追加のコンポーネントを追加せずに(メニューフォルダを削除するため)、ターゲットマシンのレジストリにホットキーを作成せずに、スタートメニューのショートカットを追加する別の方法が見つかりました。

<RemoveFolder ... />定義を<Component Id="ProductTextFile" ...>要素に移動することでこれを行うことができます。修正作業スクリプト以後:ログファイルの_log.txt_はなぜコンポーネントISN」に任意の指標を与えた場合、次のコマンドでインストールすることにより、

<?xml version="1.0" encoding="UTF-8"?> 
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi"> 
    <Product Id="{GUID HERE}" Name="WixSingleSetupExample" Language="1055" 
      Version="1.0.0.0" Manufacturer="Can Yucel" UpgradeCode="{GUID HERE}"> 
    <Package InstallerVersion="200" Compressed="yes" InstallScope="perMachine" /> 

    <MajorUpgrade DowngradeErrorMessage="A newer version of [ProductName] is already installed." /> 
    <MediaTemplate /> 

    <Icon Id="ICON1.ICO" SourceFile="icon1.ico" /> 
    <Icon Id="ICON2.ICO" SourceFile="icon2.ico" /> 

    <Feature Id="ProductFeature" Title="WixSingleSetupExample" Level="1"> 
     <ComponentRef Id="ProductTextFile" /> 
    </Feature> 
    </Product> 

    <Fragment> 
    <Directory Id="TARGETDIR" Name="SourceDir"> 
     <Directory Id="DesktopFolder" Name="Desktop" /> 

     <Directory Id="ProgramMenuFolder" Name="Programs"> 
     <Directory Id="ApplicationProgramsFolder" Name="WixSingleSetup" /> 
     </Directory> 

     <Directory Id="ProgramFilesFolder"> 
     <Directory Id="INSTALLFOLDER" Name="WixSingleSetupExample" /> 
     </Directory> 
    </Directory> 
    </Fragment> 

    <Fragment> 
     <Component Id="ProductTextFile" Directory="INSTALLFOLDER" Guid="{GUID HERE}"> 
     <File Source="blankText.txt" KeyPath="yes"> 
      <Shortcut Id="desktopShortcut" Advertise="yes" Directory="DesktopFolder" 
        Name="WixSingleSetup Help" WorkingDirectory="INSTALLFOLDER" 
        Icon="ICON1.ICO" IconIndex="0" /> 

      <Shortcut Id="startMenuShotcut" Directory="ApplicationProgramsFolder" 
        Name="WiXSingleSetup Help" WorkingDirectory="INSTALLFOLDER" 
        Icon="ICON2.ICO" IconIndex="0" Advertise="yes" /> 
     </File> 

     <RemoveFolder Id="ProgramMenuDir" Directory="ApplicationProgramsFolder" On="uninstall"/> 
     </Component> 
    </Fragment> 
</Wix> 
関連する問題