When feature is advertised, it is not actually installed on the local system. However, appropriate shortcut to launch the feature is present. The first time a user attempts to use an advertised feature, feature is installed on user's computer.

Install the application, make sure that folder "Advertised Shortcut" is not present in the Program Files folder. Click on Start/All Programs/Advertised Shortcut/Advertised Shortcut Sample. You will notice that application is being installed and after installation is completed, console window will pop up with the message "Hello World!". Press Enter to close the window.

Open "Program Files/Advertised Shortcut" folder. Delete the ConsoleApp.exe file. Start the application again clicking on the shortcut in the Start/All Programs/Advertised Shortcut/Advertised Shortcut Sample. You will notice that application is being installed again and console window will pop up after installation is done. That was the Self-Repair feature of advertised shortcuts.

Fixing ICE error

If you will run validation on the Advertised.msi you will get error ICE64 with the error message "The directory ProgramMenuDir is in the user profile but not listed in the RemoveFile table". ICE64 is telling you that in the roaming scenario folder for a shortcut won't be removed from the user profile. To fix this error we need to add RemoveFolder element to a component which installs the shortcut:

Again Alex you did a great job and a favor to Wix installation developers like myself.

I was looking for a good reference on shortcuts but what I found is mostly incomplete or uses a fake Registry search component (for reasons I did't quite understand.)

The bit on removing the shortcut from roaming profile is very much appreciated.

Rick R

10 Jun 2008 7:54 PM

Good article, but I have a question/comment about localization.

When localizing the name of the shortcut, you change the name of a file (the .lnk file) in a component. According to MSI rules, you must therefore change the name of all other files/registry entries in the same component, including the .exe file.

If this rule isn't followed, you can get orphaned shortcuts if you install your product with Language A, overwrite it with Language B, and then uninstall.

Since advertised shortcuts must be in the same component as the file they advertise, I haven't ever been able to use advertised shortcuts.

Am I missing something, or are advertised shortcuts not practical in Windows XP if my product requires the language overwriting desribed above?

Sachin

8 Jul 2008 12:04 AM

Very informative and good article. In my product I had to create shortcut icons from external icon file and I discovered that the icon id name should end with .exe to work on Vista

<Icon Id="myIcon.exe" SourceFile="..\myIcon.ico" />

If I change this to Id="myIcon.ico", the shortcut icons are not displayed on Vista, but they work on Server 2003 /XP

Icon files that are associated strictly with file extensions or CLSIDs can have any extension, such as .ico. However, Icon files that are associated with shortcuts must be in the EXE binary format and must be named such that their extension matches the extension of the target. The shortcut will not work if this rule is not followed. For example, if a shortcut is to point to a resource having the key file Red.bar, then the icon file must also have the extension .bar.

..."

So, if you are installing an executable, your icon file must have .exe extension.

You can't pass property's value to the Name/LongName attribute of the Shortcut element. The reason for this is that the type of the Name field in the Shortcut table (http://msdn.microsoft.com/en-us/library/aa371847(VS.85).aspx) is Filename. The only datatype which accepts values of other properties/environment variables is Formatted.

In addition, I specify the wildcard * so that the product will be removed~!!!

With reference to RemoveFiles Action, you will also need to schedule the following due to Sequence Restrictions:-

The InstallValidate action must be called before calling RemoveFiles. If an InstallFiles action is used, it must appear after RemoveFiles.

Thanks Michael...for you are the only one to reply...haha....

Good luck guys who have similar problems =)

-Tony

Arun

31 Oct 2008 11:09 PM

I am installing a product in per machine mode. my requirement is to provide shortcuts to my applications in Program Menu folder, along with a Uninstall product shortcut for all users.

1 .I having trouble placing the Uninstall shortcut, [which is a target to msisexec with product code argument]. Since its non-advertised target, it wouldn't let me have it a file, but needs a HKCU registry entry as keypath :ICE43.

2. It is my understanding that only Advertised shortcuts are removed during an uninstall.

Even though i remove my shortcuts folder, only the Uninstall link stays back in the folder. This happens only when more than one version of the product is installed.

The article was very informative, thought you could shed some light on my issues.

I am trying to do conditional programmenu and desktop shortcuts. I put checkboxes on verifyready dialog. And trying to make my msi create them if they are choosed. I searched for it but couldn't get a useful document. What should I do? Do you have an example for this?

Thanks

sam

18 May 2009 5:57 PM

how i can make feature to run-from-source.. meaning.. i am having cd drive where i have msi when i install all the feature except one feaure should run-from-source ,after successful installation the application should run only when the source msi cd is inserted into machine because the feature is run-from-source....and without feature applicaion can run...how can i do this

You need to set Feature/@InstallDefault to "source". In addition you may want to set Feature/@Display to "hidden", so user won't be able to change installation state to "local". Also, you may want to set Component/@Location to "source".

Alex

SamDesilva

20 Aug 2009 11:49 AM

i would like like to know

what guid stand in

msiexec.exe -Embedding <GUID> - this is the custom action server (indicated by the -Embedding switch)

since it is not the product guid and not component guid and it is changing every time when i install could you please help me in this regard

vinodk

30 Dec 2009 12:21 PM

Hello everyone,

Does any one know how to create a Shortcut on QuickLaunch and whats the sample wix script for that. Thanks in advance.

vinodk

18 Jan 2010 7:20 AM

Hello everyone,

Does any one know how to create a Shortcut on QuickLaunch and what's the sample Wix script for that.