问题
During an installation or major upgrade, if a user has pinned the application to their task bar, then after the installation has completed, the task bar shortcut is removed from \AppData\Roaming\Microsoft\Internet Explorer\Quick Launch\User Pinned\TaskBar and a blank-file icon (see image link below) is left in its place. Clicking the icon will prompt the user to delete as it doesn't target anything.
http://i.stack.imgur.com/kz1zW.png
I would like to make it such that the taskbar shortcut is not removed at all when installing or running a major upgrade. We push out updates on a weekly basis and it can be frustrating if the taskbar shortcut breaks during every update.
Is this possible? I've read about modifying the value for RemoveExistingProducts (i.e. changing from InstallValidate to InstallFinalize), but I'm unsure if this will be viable.
Thanks.
回答1:
You can avoid custom actions by disabling the standard RemoveShortcuts as follows:
<InstallExecuteSequence>
<RemoveShortcuts>Installed AND NOT UPGRADINGPRODUCTCODE</RemoveShortcuts>
</InstallExecuteSequence>
This disables removing shortcuts except on uninstall.
回答2:
We encountered this issue and our investigation reveals that msiexec.exe explicitly removes pinned item when remove corresponding shortcut on uninstall or major upgrade.
As workaround we did the following:
Disabled standard
RemoveShortcuts
action using the following WiX code:<InstallExecuteSequence> <RemoveShortcuts>0</RemoveShortcuts> </InstallExecuteSequence>
Added explicit
<DeleteFile>
entry for every shortcut we install. For example:<DirectoryRef Id="ProgramMenuDir"> <Component Id="Component" Guid="B7469BFC-BF2A-4AF7-9DF5-3458BB485F18"> <Shortcut Id="Shortcut" Name="My Supper App" Directory="ProgramMenuDir" Target='MyApp.exe' /> <RemoveFile Id="RemoveShortcut" Name="My Supper App.lnk" On="uninstall" /> </Component> </DirectoryRef>
It seems to be working fine.
回答3:
I'm not sure what you can do to prevent it from happening, but this might help you at least replace it. This method uses a logon script, but you should be able to implement this with wix
Windows 7 taskbar pinned icons are stored in the following locations
File System: %APPDATA%\Microsoft\Internet Explorer\Quick Launch\User Pinned\TaskBar
Registry: [HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Taskband] To deploy it, you can perform the following steps:
- Configure Pinned items on a Windows 7 system as a reference computer.
Export Reigstry Key to pinned.reg file: [HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Taskband] And copy items in the "%APPDATA%\Microsoft\Internet Explorer\Quick Launch\User Pinned\TaskBar" to a shared folder.
Create a logon script to deploy the registry keys and copy the corresponding files. Please note that the “%APPDATA%\Microsoft\Internet Explorer\Quick Launch\User Pinned” folder is only created after a user has pinned an icon to the taskbar. In the logon script, you will need to create the “%APPDATA%\Microsoft\Internet Explorer\Quick Launch\User Pinned\TaskBar” folder if it does not exist.
Source: http://social.technet.microsoft.com/Forums/windowsserver/en-US/d172b4de-be7c-4149-8958-bebfe042ade1/forum-faq-how-to-deploy-windows-7-taskbar-pinned-icons-by-group-policy?forum=winserverGP
来源:https://stackoverflow.com/questions/21241828/wix-do-not-remove-pinned-taskbar-on-install