Wix Installer 快捷方式开始菜单未出现

Wix Installer shortcut startmenu not appearing

我正在尝试为 windows 7 创建一个安装程序,想在 'All Program' 菜单和桌面中创建应用程序的快捷方式。我写了,但没有出现快捷方式。这段代码有什么问题吗?

<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
  <?define POS_TargetDir=$(var.POS.TargetDir)?>
  <Product Id="*" Name="PosSetupProject" Language="1033" Version="1.0.0.0" Manufacturer="Cumulus" UpgradeCode="*">
    <Package InstallerVersion="200" Compressed="yes" InstallScope="perMachine" />

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

    <Feature Id="ProductFeature" Title="PosSetupProject" Level="1">
      <ComponentGroupRef Id="ProductComponents" />
      <ComponentGroupRef Id="CReport_files" />
      <ComponentGroupRef Id="Resources_files" />
      <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="*">
            <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="PosSetupProject">
          <Directory Id="CReport" Name="CReport" />
          <Directory Id="Resources" Name="Resources" />
        </Directory>
      </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="ProductComponent"> -->
      <!-- TODO: Insert files, registry keys, and other resources here. -->
      <!-- </Component> -->

      <Component Id="POS.exe" Guid="*">
        <File Id="POS.exe" Name="POS.exe" Source="$(var.POS_TargetDir)POS.exe" />
      </Component>
      <Component Id="POS.exe.config" Guid="*">
        <File Id="POS.exe.config" Name="POS.exe.config" Source="$(var.POS_TargetDir)POS.exe.config" />
      </Component>
      <Component Id="poscon.pos" Guid="*">
        <File Id="poscon.pos" Name="poscon.pos" Source="$(var.POS_TargetDir)poscon.pos" />
      </Component>

    </ComponentGroup>
  </Fragment>

  <Fragment>
    <ComponentGroup Id="CReport_files" Directory="CReport">

    </ComponentGroup>
  </Fragment>
  <Fragment>
    <ComponentGroup Id="Resources_files" Directory="Resources">

    </ComponentGroup>
  </Fragment>
</Wix>

如果我没有遗漏任何东西,好吧,Shortcut-element 完全遗漏了。我猜您想为 POS.exe 创建一个快捷方式。在这种情况下,将 POS.exe-组件更改为以下内容:

  <Component Id="POS.exe" Guid="*">
    <File Id="POS.exe" Name="POS.exe" Source="$(var.POS_TargetDir)POS.exe" />
    <Shortcut Id="MyShortcut" Name="My shortcut" Target="[POS.exe]" />
  </Component>

这应该使用 POS.exe 组件作为目标并将快捷方式安装到所有用户的程序菜单中(如果 属性 ALLUSERS 设置为 1)。
还要检查 how-to on the WiX-site 关于创建快捷方式。