VIVEK SINGH
VIVEK SINGH

Reputation: 1

ICE 18 and ICE50 errors while packaging my windows forms desktop application with Wix V3

I have this wix code for my application -

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

Now i'm getting ICE18 and ICE50 errors

Severity Code Description Project File Line Suppression State Error ICE50: Component 'ShortcutAndIconFiles' has an advertised shortcut, but a null KeyPath. Vivek's Alarm Clock C:\Users\vivek.singh\source\repos\Vivek's Alarm Clock\Product.wxs 20

Severity Code Description Project File Line Suppression State Error ICE18: KeyPath for Component: 'ShortcutAndIconFiles' is Directory: 'INSTALLFOLDER'. The Directory/Component pair must be listed in the CreateFolders table. Vivek's Alarm Clock C:\Users\vivek.singh\source\repos\Vivek's Alarm Clock\Product.wxs 20

Severity Code Description Project File Line Suppression State Error ICE50: Component 'ShortcutAndIconFiles' has an advertised shortcut, but a null KeyPath. Vivek's Alarm Clock C:\Users\vivek.singh\source\repos\Vivek's Alarm Clock\Product.wxs 20

How do I resolve them? I have tried everything. I am using wix tooset v3 extension with visual studio 2022 community edition. I encountered this problem while packaging my Alarm Clock application which i'm creating for myself using C# windows forms desktop application

I tried changing file paths, they were absolute so i made it relative. I played around with the tree structure in numerous ways like placing the tag inside tag and so on and so forth. I followed the structure as expected by wix guideline but nothing seems to work

Upvotes: 0

Views: 54

Answers (1)

Rob Mensching
Rob Mensching

Reputation: 36006

Advertised shortcuts must be placed in the same Component with the File the Shortcut targets. So, move your two Shortcut elements into the ApplicationFiles Component and those errors should disappear.

Upvotes: 0

Related Questions