原始后期编辑-更多Wix问题-添加开始/所有程序快捷方式

原始后期编辑-更多Wix问题-添加开始/所有程序快捷方式,wix,Wix,我一直在尝试为我的Wix安装集添加一条捷径,但最令人沮丧的是,没有取得很多成功。我从web上的一个示例中抄袭了一些代码,试图解决这个问题,但是似乎不起作用。以下是我的product.wxs文件中的完整列表 <?xml version="1.0" encoding="UTF-8"?> <?define SourceDir = "..\..\Bin\Debug" ?> <Wix xmlns="http://schemas.microsoft.com/wix/200

我一直在尝试为我的Wix安装集添加一条捷径,但最令人沮丧的是,没有取得很多成功。我从web上的一个示例中抄袭了一些代码,试图解决这个问题,但是似乎不起作用。以下是我的product.wxs文件中的完整列表

 <?xml version="1.0" encoding="UTF-8"?>
 <?define SourceDir = "..\..\Bin\Debug" ?>
 <Wix xmlns="http://schemas.microsoft.com/wix/2006/wi"  xmlns:util="http://schemas.microsoft.com/wix/UtilExtension">
 <Product Id="*" Name="PSALERTS Query 2015" Language="1033" Version="1.0.0.0" Manufacturer="Iberdrola, S.A." UpgradeCode="a6fd9179-efe6-47d1-bd8f-aec182d36c8b">
    <Package InstallerVersion="200" Compressed="yes" InstallScope="perMachine" />

    <MajorUpgrade DowngradeErrorMessage="A newer version of [ProductName] is already installed." />
<MediaTemplate EmbedCab="yes" />
<Property Id="ARPSYSTEMCOMPONENT">0</Property>    
<Feature Id="ProductFeature" Title="PSALERTS Query 2015" Level="1">
  <ComponentRef Id="cmpDirQuery" />
  <ComponentRef Id="cmpDirQueryOutput" />
  <ComponentRef Id="cmpQueryExe" />
  <ComponentRef Id="cmpQueryPdb" />
  <ComponentRef Id="cmpBusinessLogicDll" />
  <ComponentRef Id="cmpBusinessLogicPdb" />
  <ComponentRef Id="cmpBusinessObjectDll" />
  <ComponentRef Id="cmpBusinessObjectPdb" />
  <ComponentRef Id="cmpCommonDll" />
  <ComponentRef Id="cmpCommonPdb" />
  <ComponentRef Id="cmpDataAccessDll" />
  <ComponentRef Id="cmpDataAccessPdb" />
  <ComponentRef Id="cmpDPAPIHelperDll" />
  <ComponentRef Id="cmpDPAPIHelperPdb" />
  <ComponentRef Id="cmpLoggerDll" />
  <ComponentRef Id="cmpLoggerPdb" />
  <ComponentRef Id="cmpPSALERTSIni" />
  <ComponentRef Id="cmpPSALERTSXltm" />
  <ComponentRef Id="cmpPSALERTS2015UserGuideChm" />    
</Feature>
</Product>

 <Fragment>
 <Directory Id="TARGETDIR" Name="SourceDir">
  <Directory Id="ProgramFilesFolder">
    <Directory Id="dirSPEnergyNetworks" Name="SP Energy Networks">
      <!-- <Component Id="cmpDirSPEnergyNetworks" Guid="{4CC20BF9-6F88-4754-8570-560B27EB2CED}" Transitive="yes" /> -->
      <Directory Id="dirPSALERTS" Name="PSALERTS">
        <!-- <Component Id="cmpDirPSALERTS" Guid="{4337B6A5-9080-4BE1-9C72-243B5F9E7E36}" Transitive="yes" /> -->
        <Directory Id="dirQuery" Name="Query">
          <Component Id="cmpDirQuery" Guid="{7DC2EADF-08B4-4FC8-9643-A83F327733AB}" KeyPath="yes">
            <CreateFolder Directory="dirQuery" />
            <RemoveFile Id="PurgeQuery" Name="*.*" On="uninstall" />
            <RemoveFolder Id="idDirQuery" On="uninstall" Directory="dirQuery" />
          </Component>
          <Directory Id="dirQueryOutput" Name="QueryOutput">
            <Component Id="cmpDirQueryOutput" Guid="{E7841870-CCBE-4186-B586-3DD95017F380}">
              <CreateFolder Directory="dirQueryOutput" />
              <RemoveFile Id="PurgeQueryOutput" Name="*.*" On="uninstall" />
              <RemoveFolder Id="idDirQueryOutputRemove" On="uninstall" Directory="dirQueryOutput" />
            </Component>
          </Directory>
          <Component Id="cmpQueryExe" Guid="*">
            <File Id="filQueryExe" 
                  KeyPath="yes"
                  Vital ="yes"
                  Source="$(var.SourceDir)\Query.exe"> 
            </File>
            <Shortcut Id="startMenuQuery"
              Directory="ProgramFilesFolder"
              Advertise="no"
              Name="Query"
              LongName="PSALERTS Query 2015"
              WorkingDirectory="INSTALLDIR"
            />
            <RemoveFile Id="RemoveDesktopShortcut" Name="PSALERTS Query 2015" On="uninstall"/>
            <RemoveRegistryKey Id="RemoveQueryRegKey" Root="HKLM" Key="SOFTWARE\SP Energy Networks\PSALERTS\Query" Action="removeOnUninstall" />
          </Component>
          <Component Id="cmpQueryPdb" Guid="*">
            <File Id="filQueryPdb" KeyPath="yes" Source="$(var.SourceDir)\Query.pdb" />
          </Component>
          <Component Id="cmpBusinessLogicDll" Guid="*">
            <File Id="filBusinessLogicDll" KeyPath="yes" Source="$(var.SourceDir)\BusinessLogic.dll"/>
          </Component>
          <Component Id="cmpBusinessLogicPdb" Guid="*">
            <File Id="filBusinessLogicPdb" KeyPath="yes" Source="$(var.SourceDir)\BusinessLogic.pdb" />
          </Component>
          <Component Id="cmpBusinessObjectDll" Guid="*">
            <File Id="filBusinessObjectDll" KeyPath="yes" Source="$(var.SourceDir)\BusinessObject.dll" />
          </Component>
          <Component Id="cmpBusinessObjectPdb" Guid="*">
            <File Id="filBusinessObjectPdb" KeyPath="yes" Source="$(var.SourceDir)\BusinessObject.pdb" />
          </Component>
          <Component Id="cmpCommonDll" Guid="*">
            <File Id="filCommonDll" KeyPath="yes" Source="$(var.SourceDir)\Common.dll" />
          </Component>
          <Component Id="cmpCommonPdb" Guid="*">
            <File Id="filCommonPdb" KeyPath="yes" Source="$(var.SourceDir)\Common.pdb" />
          </Component>
          <Component Id="cmpDataAccessDll" Guid="*">
            <File Id="filDataAccessDll" KeyPath="yes" Source="$(var.SourceDir)\DataAccess.dll" />
          </Component>
          <Component Id="cmpDataAccessPdb" Guid="*">
            <File Id="filDataAccessPdb" KeyPath="yes" Source="$(var.SourceDir)\DataAccess.pdb" />
          </Component>
          <Component Id="cmpDPAPIHelperDll" Guid="*">
            <File Id="filDPAPIHelperDll" KeyPath="yes" Source="$(var.SourceDir)\DPAPIHelper.dll" />
          </Component>
          <Component Id="cmpDPAPIHelperPdb" Guid="*">
            <File Id="filDPAPIHelperPdb" KeyPath="yes" Source="$(var.SourceDir)\DPAPIHelper.pdb" />
          </Component>
          <Component Id="cmpLoggerDll" Guid="*">
            <File Id="filLoggerDll" KeyPath="yes" Source="$(var.SourceDir)\Logger.dll" />
          </Component>
          <Component Id="cmpLoggerPdb" Guid="*">
            <File Id="filLoggerPdb" KeyPath="yes" Source="$(var.SourceDir)\Logger.pdb" />
          </Component>
          <Component Id="cmpPSALERTSIni" Guid="*">
            <File Id="filPSALERTSIni" KeyPath="yes" Source="$(var.SourceDir)\PSALERTS.ini" />
          </Component>
          <Component Id="cmpPSALERTSXltm" Guid="*">
            <File Id="filPSALERTSXltm" KeyPath="yes" Source="$(var.SourceDir)\PSALERTS.xltm" />
          </Component>
          <Component Id="cmpPSALERTS2015UserGuideChm" Guid="*">
            <File Id="filPSALERTS2015UserGuideChm" KeyPath="yes" Source="$(var.SourceDir)\UserGuide\PSALERTS2015UserGuide.Chm" />
          </Component>

        </Directory>
      </Directory>
    </Directory>
  </Directory>
</Directory>
</Fragment>

0

有人能帮忙吗

问候
Paul J.

这是桌面快捷方式和卸载快捷方式的示例

<DirectoryRef Id="DesktopFolder">
  <!--Shortcut -->
  <Component Id="cmp1" Guid="{D61A6AD5-8C48-4894-8816-DBCE98A2D42D}">
    <Shortcut Id="Shortcut.ID"
              Name="some name"
              Target="[INSTALLDIR]some.exe"
              WorkingDirectory="INSTALLDIR"
              Icon="some.exe"/>
    <RemoveFile Id="RemoveDesktopShortcut" Name="some name" On="uninstall"/>
    <RegistryValue Root="HKCU" Key="Software\!(loc.ManufacturerName)\Productname" Name="installed" Type="integer" Value="1" KeyPath="yes"/>
  </Component>

  <!--Uninstall Shortcut-->
  <Component Id="cmp.Uninstall.shortcut" Guid="{98FCEE68-0BE0-4C99-B961-75066797C140}">
    <Shortcut Id="UninstallProduct"
              Name="Uninstall"
              Description="Uninstalls My Application"
              Directory="INSTALLDIR"
              Target="[SystemFolder]msiexec.exe"
              Arguments="/x [ProductCode] /qb"/>
    <RemoveFile Id="RemoveUninstallShortcut" Name="Uninstall" Directory="INSTALLDIR" On="uninstall"/>
    <RegistryValue Root="HKMU" Key="Software\!(loc.ManufacturerName)\UninstallShortcut" Name="installed" Type="integer" Value="1" KeyPath="yes"/>
  </Component>
</DirectoryRef>
<Icon Id="some.exe" SourceFile="$(var.ResourcesDir)Some.ico"/>

<ComponentGroup Id ="ShortCuts">
  <ComponentRef Id="cmp1"/>
  <ComponentRef Id="cmp.Uninstall.shortcut"/>
</ComponentGroup>

这是桌面快捷方式和卸载快捷方式的示例

<DirectoryRef Id="DesktopFolder">
  <!--Shortcut -->
  <Component Id="cmp1" Guid="{D61A6AD5-8C48-4894-8816-DBCE98A2D42D}">
    <Shortcut Id="Shortcut.ID"
              Name="some name"
              Target="[INSTALLDIR]some.exe"
              WorkingDirectory="INSTALLDIR"
              Icon="some.exe"/>
    <RemoveFile Id="RemoveDesktopShortcut" Name="some name" On="uninstall"/>
    <RegistryValue Root="HKCU" Key="Software\!(loc.ManufacturerName)\Productname" Name="installed" Type="integer" Value="1" KeyPath="yes"/>
  </Component>

  <!--Uninstall Shortcut-->
  <Component Id="cmp.Uninstall.shortcut" Guid="{98FCEE68-0BE0-4C99-B961-75066797C140}">
    <Shortcut Id="UninstallProduct"
              Name="Uninstall"
              Description="Uninstalls My Application"
              Directory="INSTALLDIR"
              Target="[SystemFolder]msiexec.exe"
              Arguments="/x [ProductCode] /qb"/>
    <RemoveFile Id="RemoveUninstallShortcut" Name="Uninstall" Directory="INSTALLDIR" On="uninstall"/>
    <RegistryValue Root="HKMU" Key="Software\!(loc.ManufacturerName)\UninstallShortcut" Name="installed" Type="integer" Value="1" KeyPath="yes"/>
  </Component>
</DirectoryRef>
<Icon Id="some.exe" SourceFile="$(var.ResourcesDir)Some.ico"/>

<ComponentGroup Id ="ShortCuts">
  <ComponentRef Id="cmp1"/>
  <ComponentRef Id="cmp.Uninstall.shortcut"/>
</ComponentGroup>

ilI在主exe的组件中移动了一些东西。这应该可以创建它,您可能需要移动一些东西,以便将它精确地放在您想要的位置

      <Component Id="cmpQueryExe" Guid="*">
        <File Id="filQueryExe" 
              KeyPath="yes"
              Vital ="yes"
              Source="$(var.SourceDir)\Query.exe"> 
              <Shortcut Id="startMenuQuery"
                  Directory="ProgramMenuDir"
                  Advertise="no"
                  Name="Query"
                  LongName="PSALERTS Query 2015"
                  WorkingDirectory="INSTALLDIR" Icon="$(var.SourceDir)\Query.exe" />
        </File>

        <RemoveFolder Id="RemoveDesktopShortcut" Directory="ProgramMenuDir" Name="PSALERTS Query 2015" On="uninstall"/>
        <RemoveRegistryKey Id="RemoveQueryRegKey" Root="HKLM" Key="SOFTWARE\SP Energy Networks\PSALERTS\Query" Action="removeOnUninstall" />
      </Component>

再往下看:

              <Component Id="cmpPSALERTS2015UserGuideChm" Guid="*">
            <File Id="filPSALERTS2015UserGuideChm" KeyPath="yes" Source="$(var.SourceDir)\UserGuide\PSALERTS2015UserGuide.Chm" />
          </Component>

        </Directory>
      </Directory>
    </Directory>
  </Directory>
  <Directory Id="ProgramMenuFolder" Name="Programs">
    <Directory Id='SPEnergyNetworksDir' Name='SP Energy Networks'>
      <Directory Id="ProgramMenuDir" Name="PSALERTS Query 2015" />
    </Directory>
  </Directory>
  </Directory>
</Fragment>

总结:

  • 已将快捷方式标记移动到文件标记中
  • 将图标属性添加到快捷方式标记

ilI已经在主exe的组件中移动了一些东西。这应该可以创建它,您可能需要移动一些东西,以便将它精确地放在您想要的位置

      <Component Id="cmpQueryExe" Guid="*">
        <File Id="filQueryExe" 
              KeyPath="yes"
              Vital ="yes"
              Source="$(var.SourceDir)\Query.exe"> 
              <Shortcut Id="startMenuQuery"
                  Directory="ProgramMenuDir"
                  Advertise="no"
                  Name="Query"
                  LongName="PSALERTS Query 2015"
                  WorkingDirectory="INSTALLDIR" Icon="$(var.SourceDir)\Query.exe" />
        </File>

        <RemoveFolder Id="RemoveDesktopShortcut" Directory="ProgramMenuDir" Name="PSALERTS Query 2015" On="uninstall"/>
        <RemoveRegistryKey Id="RemoveQueryRegKey" Root="HKLM" Key="SOFTWARE\SP Energy Networks\PSALERTS\Query" Action="removeOnUninstall" />
      </Component>

再往下看:

              <Component Id="cmpPSALERTS2015UserGuideChm" Guid="*">
            <File Id="filPSALERTS2015UserGuideChm" KeyPath="yes" Source="$(var.SourceDir)\UserGuide\PSALERTS2015UserGuide.Chm" />
          </Component>

        </Directory>
      </Directory>
    </Directory>
  </Directory>
  <Directory Id="ProgramMenuFolder" Name="Programs">
    <Directory Id='SPEnergyNetworksDir' Name='SP Energy Networks'>
      <Directory Id="ProgramMenuDir" Name="PSALERTS Query 2015" />
    </Directory>
  </Directory>
  </Directory>
</Fragment>

总结:

  • 已将快捷方式标记移动到文件标记中
  • 将图标属性添加到快捷方式标记
  • 安德鲁

    谢谢你的努力,我今天下午设法让它工作起来了。我的问题是试图独立于我的具体案例来处理示例代码摘录,最后,我使用以下方法成功地解决了问题,恰巧在您最终回复之前:-)

    。。。
    
    安德鲁

    谢谢你的努力,我今天下午设法让它工作起来了。我的问题是试图独立于我的具体案例来处理示例代码摘录,最后,我使用以下方法成功地解决了问题,恰巧在您最终回复之前:-)

    。。。
    

    您是否收到任何错误消息,或者只是没有创建快捷方式?Andrew,没有错误,只是没有创建快捷方式。您是否尝试过移动图标标签?Andrew,是的,尝试过移动图标标签,但没有乐趣。我现在将编辑原始帖子以显示整个product.wsx文件,因为我认为在快捷方式要求方面,该文件的组成可能存在根本性问题。您是否收到任何错误消息,或者只是没有创建快捷方式?Andrew,没有错误,只是没有创建快捷方式。你试过移动图标标签吗?安德鲁,是的,我试过移动图标标签,但没有乐趣。我现在将编辑原始帖子以显示整个产品