首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >WiX卸载快捷键需要一个钥匙在香港大学?

WiX卸载快捷键需要一个钥匙在香港大学?
EN

Stack Overflow用户
提问于 2014-06-19 19:26:36
回答 1查看 287关注 0票数 0

因此,我正在开发下面的wix安装程序。我试图添加一个卸载快捷方式到开始菜单,但它没有按照这个教程工作。所以,我尝试添加一些参数,现在我被这个错误困住了。不过,我对这意味着什么感到困惑。

编辑:

我试着修改代码以:

代码语言:javascript
复制
<RegistryValue Root="HKCU" Key="Software\Microsoft\Viewer" Name="installed" Type="integer" Value="1" KeyPath="yes" />
<Shortcut Id="startmenuUninstall" Directory="ProgramMenuDir" Name="Viewer" Target="[SystemFolder]msiexec.exe" Arguments="/x [ProductCode]" />
<RemoveFolder Id="ApplicationProgramsFolder" On="uninstall"/>

但是现在它抱怨我定义了多个KeyPath。

WiX代码:

代码语言:javascript
复制
<?xml version='1.0' encoding='windows-1252'?>
<Wix xmlns='http://schemas.microsoft.com/wix/2006/wi'>
  <Product Name='Viewer 1.0' Id='9CC32BA4-F127-475D-9F65-549F5184ADAC' UpgradeCode='32F23DEA-B996-415D-9A12-CB9039D6A987'
    Language='1033' Codepage='1252' Version='1.0.0' Manufacturer='Direct'>
    <Package Id='*' Keywords='Installer' Description="Viewer Installer"
      Comments='Installer is a registered trademark.' Manufacturer='Direct'
      InstallerVersion='100' Languages='1033' Compressed='yes' SummaryCodepage='1252' />

    <Media Id='1' Cabinet='Sample.cab' EmbedCab='yes' DiskPrompt="CD-ROM #1" />
    <Property Id='DiskPrompt' Value="1.0 Installation [1]" />
    <Property Id="WIXUI_INSTALLDIR" Value="INSTALLDIR" />

    <Directory Id='TARGETDIR' Name='SourceDir'>
      <Directory Id='ProgramFilesFolder' Name='PFiles'>
        <Directory Id='Direct' Name='DMD'>
          <Directory Id='INSTALLDIR' Name='Viewer'>

            <Component Id='MainExecutable' Guid='f3cdca42-0954-48c0-85aa-82e4bde65f14'>
                <Shortcut Id="startmenuViewer" Directory="ProgramMenuDir" Name="Viewer" WorkingDirectory='INSTALLDIR' Icon="Viewer.exe" IconIndex="0" Advertise="yes" />
                <Shortcut Id="desktopViewer" Directory="DesktopFolder" Name="Viewer" WorkingDirectory='INSTALLDIR' Icon="Viewer.exe" IconIndex="0" Advertise="yes" />
        <Shortcut Id="UninstallProduct" Directory="ProgramMenuDir" Name="Uninstall Viewer" Target="[SystemFolder]msiexec.exe" Icon="Viewer.exe" Arguments="/x [ProductCode]" Description="Uninstalls Viewer"/>

              <File Id='EXE' Name='Viewer.exe' DiskId='1' Source='Viewer.exe' KeyPath='yes'>
              </File>
                <ProgId Id="DMDCCDAV" Description="Viewer">
                    <Extension Id="xml" >
                        <Verb Id="open" Argument="&quot;%1&quot;" TargetFile="EXE" />
                    </Extension>
                </ProgId>
            </Component>

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

      <Directory Id="ProgramMenuFolder" Name="Programs">
        <Directory Id="ProgramMenuDir" Name="Viewer">
          <Component Id="ProgramMenuDir" Guid="*">
            <RemoveFolder Id='ProgramMenuDir' On='uninstall' />
            <RegistryValue Root='HKCU' Key='Software\[Manufacturer]\[ProductName]' Type='string' Value='' KeyPath='yes' />
          </Component>
        </Directory>
      </Directory>

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

    <Feature Id='Complete' Title='Viewer Installation' Display='expand' Level='1' ConfigurableDirectory='INSTALLDIR'>
    <Feature Id='MainProgram' Title='Viewer Program' Description='The main executable.' Level='1'>
      <ComponentRef Id='MainExecutable' />
      <ComponentRef Id='ProgramMenuDir' />
    </Feature>
    </Feature>

    <UIRef Id="WixUI_InstallDir" />
    <UIRef Id="WixUI_ErrorProgressText" />

    <Icon Id="Viewer.exe" SourceFile="Viewer.exe" />

  </Product>
</Wix>

编译期间错误:

代码语言:javascript
复制
C:\Users\kylec\Desktop\SampleFirst\SampleFirst.wxs(18) : error LGHT0204 : ICE43:
 Component MainExecutable has non-advertised shortcuts. It should use a registry
 key under HKCU as its KeyPath, not a file.
C:\Users\kylec\Desktop\SampleFirst\SampleFirst.wxs(18) : error LGHT0204 : ICE57:
 Component 'MainExecutable' has both per-user and per-machine data with a per-ma
chine KeyPath.
EN

回答 1

Stack Overflow用户

发布于 2014-06-20 14:11:36

好吧,我终于想出来了,希望这也能帮到别人。我的问题是,我的卸载是在同一个组件中。当我取出卸载快捷键并将其放入自己的组件中时,一切都很好。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/24314771

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档