Wix 安装程序开始菜单快捷方式未出现 [英] Wix Installer start menu shortcut not appearing

查看:18
本文介绍了Wix 安装程序开始菜单快捷方式未出现的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用 WiX v3.7(因为 VS2012 不再包含安装和部署项目)为 Windows 应用程序创建一个安装程序项目,以用于学习目的.Wix 工具集已集成到 VS,我正在创建一个新的 WiX 单一安装程序安装项目.安装程序始终编译成功(图标扩展中的警告除外),它运行完美并按原样放置桌面快捷方式,但未能在 Windows 7 Professional x64 Service Pack 1 上放置正确的开始菜单快捷方式.我在网上搜索并尝试了几乎所有我看到的东西,但到目前为止没有成功.product.wxs 文件如下,my_guid"字符串替换为项目中适当的 GUIDS.显然我错过了一个点,但看不到哪里.也未创建注册表项,因此可能出于某种原因未执行最后一个片段.怎么解决?

I am trying to create an installer project for a windows application using WiX v3.7 (as VS2012 does not include setup and deployment projects any more) for learning purposes. Wix toolset is entegrated to VS and I am creating a new WiX single installer setup project. The installer is always compiled succesfully (except for warnings in icon extension), it runs perfect and places desktop shortcuts as they should be, but fails to put proper start menu shortcuts on Windows 7 Professional x64 Service Pack 1. I searched the web and tried almost anything I see, but so far no success. The product.wxs file is as follows and "my_guid" strings are replaced by proper GUIDS in the project. Clearly I am missing a point but cannot see where. The registry key is not created as well, so the last fragment is possibly not executed for a reason. How could this be solved?

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

推荐答案

我正在添加按预期工作的代码,以供将来参考和问题的确切答案:

I am adding the code that works as intended for future reference and an exact answer to the question:

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

这篇关于Wix 安装程序开始菜单快捷方式未出现的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆