如何在自动更新期间将 .NET 应用程序固定到任务栏?
当 ClickOnce AutoUpdate 部署的应用程序在 Windows 7 上自动更新时,该应用程序将从任务栏取消固定。有没有办法阻止它变得不固定?
When an application deployed by ClickOnce AutoUpdate is automatically updated on Windows 7, the application becomes unpinnned from the taskbar. Is there a way to stop it from becoming unpinned?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
如果未安装 ClickOnce 应用程序,则很可能无法实现此目的。
安装后;我不知道。
ClickOnce 应用程序将下载到用户的临时目录中。当应用程序下载最新版本时,该版本将存储在新的子目录中,并且不会像“正常”应用程序更新那样被覆盖。
When the ClickOnce application is not installed it most likely impossible to achieve this.
When it's installed; i'm not sure.
A ClickOnce application is downloaded to the users' temporary directory. When the application downloads the latest version, this version is stored in a new sub directory and not overwritten as which is the case with 'normal' application updates.
我不知道如何防止它被取消固定,但有一种方法使用 vbs 脚本来固定 exe,这不应该通过代码来实现:
这本质上依赖于具有“Pin”的 exe 的右键单击菜单到任务栏”条目。不幸的是,除非有人有所有翻译的列表,否则它会使其成为特定的英语。
I don't know about keeping it from being unpinned but there is a way using a vbs script to pin an exe which isn't supposed to be doable by code:
This essentially relies on the right click menu of an exe having the "Pin to Taskbar" entry. It unfortunately makes it english specific unless someone has a list of all translations.
我根本没有看到这个问题。我假设您在第一次运行应用程序时手动将应用程序固定到任务栏。
您的目标是 .NET 3.5 (SP-1) 吗?您是让 ClickOnce 为您创建桌面快捷方式还是以编程方式执行此操作?桌面快捷方式消失了吗?
每次发布更新时,它都会从任务栏消失吗?或者只是每隔一段时间?
罗宾点网
I'm not seeing this problem at all. I'm assuming you manually pinned the application to the task bar the first time you ran it.
Are you targeting .NET 3.5 (SP-1)? Are you having ClickOnce create the desktop shortcut for you or are you doing it programmatically? Does the desktop shortcut disappear?
Does it disappear from the taskbar every time an update is released, or just every so often?
RobinDotNet
我不确定 Windows 7 如何处理它,但我使用类似于 此将 appref-ms 复制到开始菜单上的启动文件夹。我认为我的代码(在我的工作机器上,我周末休息)还会检查这是否是新安装,因此如果是更新,它不会更改快捷方式。
I'm not sure how Windows 7 handles it, but I use code similar to this to copy the appref-ms to the startup folder on the start menu. I think my code (on my work machine and I'm off for the weekend) also has a check for if this is a new install so it does not change the shortcut if it is an update.
在 Visual Studio 2010 的“发布”选项卡上。我单击“选项”、“选定清单”,然后单击“创建桌面快捷方式”。在发布更新并且用户安装更新后,此功能由开始菜单快捷方式保留。以前,开始菜单快捷方式会消失并且必须重新固定。
In Visual Studio 2010 on the publish tab. I clicked options, Selected Manifests and clicked Create desktop shortcut. This preserved by start menu shortcuts after an update was published and users installed the update. Previously the start menu shortcut would disappear and have to be re-pinned.