Wix MSI - 卸载产品时任务栏快捷方式会变得孤立

发布于 2025-01-10 09:38:06 字数 855 浏览 0 评论 0原文

我的 wix 安装程序在安装过程中在桌面和开始菜单中创建快捷方式。

从安装的开始菜单快捷方式中,一些用户使用“固定到任务栏”功能手动将快捷方式固定到任务栏,这不受我的 wix msi 的控制。

在 Windows 10 中,任务栏快捷方式在 %AppData%\Microsoft\Internet Explorer\Quick Launch\User Pinned\TaskBar\Product.lnk 处创建。

卸载产品时,开始菜单和桌面上的快捷方式将被删除 (这是预期的),但是手动固定的任务栏快捷方式会变得孤立,即使在卸载产品后也会保留。

卸载产品后如何删除任务栏快捷方式?

这是我尝试过的方法,但不起作用:

  <CustomAction Id="DeleteTaskBarShortcut" Execute="deferred"
     ExeCommand="del &quot;[AppDataFolder]\Roaming\Microsoft\Internet Explorer\Quick Launch\User Pinned\TaskBar\Product.lnk&quot;"
     Directory="AppDataFolder"
     Impersonate="no"
     Return="ignore" />

 <InstallExecuteSequence>     
      <Custom Action="DeleteTaskBarShortcut" Before="RemoveFiles">Installed</Custom>
 </InstallExecuteSequence>  

提前致谢

My wix installer creates the shortcuts at Desktop and StartMenu during installation.

From the installed Startmenu shortcuts, Some of the users use the feature "Pin to taskbar" to pin the shortcuts to taskbar manually which is not in control of my wix msi.

The taskbar shortcut gets created at %AppData%\Microsoft\Internet Explorer\Quick Launch\User Pinned\TaskBar\Product.lnk in Windows 10.

The shortcuts at StartMenu and Desktop gets removed when product is uninstalled (which is expected), However the taskbar shortcut pinned manually goes orphaned and stays even after product is uninstalled.

How can i remove the taskbar shortcut when product is uninstalled ?

This is what I tried but it is not working:

  <CustomAction Id="DeleteTaskBarShortcut" Execute="deferred"
     ExeCommand="del "[AppDataFolder]\Roaming\Microsoft\Internet Explorer\Quick Launch\User Pinned\TaskBar\Product.lnk""
     Directory="AppDataFolder"
     Impersonate="no"
     Return="ignore" />

 <InstallExecuteSequence>     
      <Custom Action="DeleteTaskBarShortcut" Before="RemoveFiles">Installed</Custom>
 </InstallExecuteSequence>  

Thanks in advance

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

倒数 2025-01-17 09:38:06

要回答你应该的问题,答案是否定的。原因是:

  1. 微软使管理此类数据变得极其困难,因为他们认为这是用户数据,并且不希望软件供应商滥用用户设置。

  2. 您的用户创建了该对象,而不是您的安装程序。因此,您没有义务清理它。

  3. 无论如何,管理每台计算机安装程序的每用户资源一直是非常困难的。它创建了多对一的清理,并启动了访问权限问题。

如果您能够以某种方式运行一个 EXE,并且该 EXE 在作为 SYSTEM 运行时可以按预期工作,那么我可以帮助您将其集成到 MSI 中。但不要指望它总是可以工作,尤其是在较新版本的 Windows 上,因为 MSFT 继续关闭攻击面。

To answer the question of Should you the answer would be no. The reasons are:

  1. Microsoft has made it incredibly difficult to manage things like this because they consider it user data and they don't want software vendors abusing user settings.

  2. Your user created the object not your installer. So therefore you are under no obligation to clean it up.

  3. Managing per-user resources for a per-machine installer has always been incredibly difficult anyways. It creates a many to one cleanup with access right issues to boot.

If you are somehow able to run an EXE that when ran as SYSTEM works as expected then I can assist you in integrating that into an MSI. But don't expect it to always work especially on newer versions of Windows as MSFT continues to close off the attack surfaces.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文