Abdulsalam Elsharif
Abdulsalam Elsharif

Reputation: 5101

Change Wix Desktop Icon

I used Wix Toolset to create setup for my WPF application, But I cant change the desktop icon

I insert:

<Icon Id="Icon.exe" SourceFile="icon.ico"/>
<Property Id="ARPPRODUCTICON" Value="icon.ico" />

And include the file icon.ico in my Wix proect :

enter image description here

I think the problem in the path of SourceFile!

Please, Can you check it and tell me what I miss.

Thanks in advance

Abdulsalam

Upvotes: 0

Views: 1105

Answers (1)

Arkady Sitnitsky
Arkady Sitnitsky

Reputation: 1886

You need to add a reference of a root dir.

Something like that:

 <Icon Id="Icon.exe" SourceFile="$(sys.CURRENTDIR)\icon.ico"/>

$(sys.CURRENTDIR) - is the location of the file you are editing this element. From from the screenshot it's probably is product.wxs

Relative to this location find the icon.ico location. For example: If the icon.ico is located in inner folder called "resources" than the sourcefile attribute should be-

<Icon Id="Icon.exe" SourceFile="$(sys.CURRENTDIR)\resources\icon.ico"/>

The path is how it's located on the disk and not in your VS source code tree.

The ARPPRODUCTICON property's Value should be the ID of an <Icon> element and not the path to the icon file.

<Property Id="ARPPRODUCTICON" Value="Icon.exe" />

To add an icon to the desktop add Icon attribute to shortcut element like this:

            <Shortcut Id="ApplicationDesktopShortcut"
                Name="ORDER MS"
                Description="ORDER Managment Systrm - Resturant POS"
                Target="[INSTALLFOLDER]WixTest.exe"
                WorkingDirectory="MYAPPDIRPROPERTY"
                Icon= "Icon.exe"/>

Upvotes: 3

Related Questions