使用 Wix V3 打包 Windows 窗体桌面应用程序时出现 ICE 18 和 ICE50 错误

问题描述 投票:0回答:1

我的应用程序有这个wix代码-

<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
    <Product Id="*" Name="Viveks_Alarm_Clock" Language="1033" Version="1.0.0.0" Manufacturer="Vivek Singh" UpgradeCode="68c68d32-7939-426c-97e5-c329f58c2076">
        <Package InstallerVersion="200" Compressed="yes" InstallScope="perMachine" />
        <MajorUpgrade DowngradeErrorMessage="A newer version of [ProductName] is already installed." />
        <MediaTemplate />
        <Feature Id="ProductFeature" Title="Viveks_Alarm_Clock" Level="1">
            <ComponentGroupRef Id="ProductComponents" />
        </Feature>
        <Icon Id="AlarmClockIconFile" SourceFile="..\Alarm Clock\alarmclock_alarm_3338.ico"/>
    </Product>

    <Fragment>
        <Directory Id="TARGETDIR" Name="SourceDir">
            <Directory Id="ProgramFilesFolder">
                <Directory Id="INSTALLFOLDER" Name="Viveks_Alarm_Clock">
                    <Component Id="ApplicationFiles" Guid="95158faf-49c8-4efc-83b0-4e2bcb0cf367">
                        <File Id="AlarmClockExe" Source="..\Alarm Clock\bin\Debug\Alarm Clock.exe" KeyPath="yes"/>
                    </Component>
                    <Component Id="ShortcutAndIconFiles" Guid="77640577-6144-4007-a287-a37f921dcdb5">
                        <Shortcut Id="startmenuViveks_Alarm_Clock" Directory="ProgramMenuFolder" Name="Vivek's Alarm Clock" WorkingDirectory="INSTALLFOLDER" Icon="AlarmClockIconFile" IconIndex="0" Advertise="yes" />
                        <Shortcut Id="desktopViveks_Alarm_Clock" Directory="DesktopFolder" Name="Vivek's Alarm Clock" WorkingDirectory="INSTALLFOLDER" Icon="AlarmClockIconFile" IconIndex="0" Advertise="yes" />
                    </Component>
                </Directory>
            </Directory>
            <Directory Id="ProgramMenuFolder" Name="Programs" />
            <Directory Id="DesktopFolder" Name="Desktop" />
        </Directory>
    </Fragment>

    <Fragment>
        <ComponentGroup Id="ProductComponents" Directory="INSTALLFOLDER">
            <ComponentRef Id="ApplicationFiles"/>
            <ComponentRef Id="ShortcutAndIconFiles"/>
        </ComponentGroup>
    </Fragment>
</Wix>

现在我收到 ICE18 和 ICE50 错误

严重性代码描述项目文件行抑制状态 错误 ICE50:组件“ShortcutAndIconFiles”具有广告的快捷方式,但 KeyPath 为空。 Vivek 的闹钟 C:\Users ivek.singh\source epos\Vivek 的闹钟\Product.wxs 20

严重性代码描述项目文件行抑制状态 错误 ICE18:组件的 KeyPath:“ShortcutAndIconFiles”是目录:“INSTALLFOLDER”。目录/组件对必须列在 CreateFolders 表中。 Vivek 的闹钟 C:\Users ivek.singh\source epos\Vivek 的闹钟\Product.wxs 20

严重性代码描述项目文件行抑制状态 错误 ICE50:组件“ShortcutAndIconFiles”具有广告的快捷方式,但 KeyPath 为空。 Vivek 的闹钟 C:\Users ivek.singh\source epos\Vivek 的闹钟\Product.wxs 20

我该如何解决这些问题?我已经尝试了一切。我正在将 wix Tooset v3 扩展与 Visual Studio 2022 社区版一起使用。我在打包我使用 C# Windows 窗体桌面应用程序为自己创建的闹钟应用程序时遇到了这个问题

我尝试更改文件路径,它们是绝对的,所以我将其设置为相对的。我以多种方式使用树结构,例如将标签放置在标签内等等。我遵循了 wix 指南预期的结构,但似乎没有任何效果

wix wix3.5 wix3 wix3.7 wix3.6
1个回答
0
投票

广告的快捷方式必须与快捷方式目标文件放置在同一组件中。因此,将两个快捷方式元素移动到

ApplicationFiles
组件中,这些错误就会消失。

© www.soinside.com 2019 - 2024. All rights reserved.