I'm in Windows 7 working on combining two apps with the same task bar icon, as described in this question:
Pinning advertised shortcuts on the taskbar in windows 7
I see there, and it lots of online documentation that I need to set the AppUserModelID as a property of the shortcut. My installer program uses the basic Visual Studio 2008 setup project, and I don't see any way to set shortcut properties on installation. Is there any head-start anyone can give me on how to do this?
Sheng commented that "You can also switch to other MSI authoring tools that supports setting the appid for shortcuts, such as WIX or NSIS."
To achieve this using a Shortcut element in Wix you must add a child ShortcutProperty element to your Shortcut element and use the Shell property name "System.AppUserModel.ID
" as the key.
<Shortcut Id="StartMenuShortcut"
Name="Shortcut Name"
Description="Shortcut Description"
Target="[INSTALLLOCATION]Application.exe"
WorkingDirectory="INSTALLLOCATION">
<ShortcutProperty Key="System.AppUserModel.ID" Value="AppUserModelID" />
</Shortcut>
I don't know anything about VS2k8 setup projects so I don't know if you can run custom actions etc but I do know that to set the AppId on a shortcut you load/create your shortcut and query its IShellLink for IPropertyStore, then InitPropVariantFromString a variant with your id and call SetValue(PKEY_AppUserModel_ID,propvariant) + Commit on the propertystore
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With