由 VS 2008 创建的 msi 创建时,桌面快捷方式图标上缺少 UAC 屏蔽覆盖

发布于 2024-08-28 02:05:08 字数 406 浏览 10 评论 0原文

我创建了一个安装程序来使用 Visual Studio 2008 部署 VBNet 程序。在这个安装程序中,我创建了一个指向要安装在用户桌面上的“主输出”的快捷方式。

现在,一切正常。该程序安装在“C:\Program Files”下,并在桌面上创建快捷方式。另外,当我使用此快捷方式时,UAC 会提示我自动以管理员身份运行此程序。到目前为止,一切都很好……

但是!即使程序是使用声明其必须以管理员身份运行的清单进行编译的,我的桌面图标也没有 UAC 屏蔽覆盖层。另外,如果我在安装后在桌面上手动创建同一可执行文件的新快捷方式,则该新快捷方式将具有屏蔽覆盖!

我尝试重新启动并删除 iconCache.db 文件,但没有成功。

所以我的问题是:在最初安装时,如何让我的桌面快捷方式与 UAC 屏蔽覆盖一起出现。

谢谢!

I created a setup program to deploy my VBNet program using Visual Studio 2008. Inside this setup program I created a shortcut to the "primary output" to be installed on the user desktop.

Now, everything is working correctly. The program is installed under "C:\Program Files" and the shortcut is created on the desktop. Also, when I use this shortcut I am prompted by UAC to autorize running this program as administrator. So far, so good...

But! My desktop icon does not have the UAC shield overlay even if the program is compiled with the manifest stating that it must run as administrator. Also, if I manually create a new shortcut on the desktop to the same executable after the installation, this new shortcut WILL have the shield overlay!

I have tried to reboot and delete the iconCache.db file but it did not work.

So my question is: How can I have my desktop shortcut appear WITH the UAC shield overlay when installed initially.

Thanks!

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

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

发布评论

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

评论(3

第几種人 2024-09-04 02:05:09

您可以通过使用 Orca 或由 Visual Studio 使用后期构建自动更改 msi 文件中的一个表格行来使您的快捷方式非广告事件。

转到项目的属性,然后输入以下 PostBuildEvent

cscript //nologo "$(ProjectDir)WiRunSql.vbs" "$(BuiltOuputPath)" "INSERT INTO Property(Property, Value) VALUES ('DISABLEADVTSHORTCUTS', '1')"

WiRunSql.vbs 文件可从 微软

问候
鲁莫

You can make your shortcuts non-advertised by changing one table row in the msi file either using Orca or automatically by visual studio using a post build event.

Go to the Project's Properties, and enter the following PostBuildEvent:

cscript //nologo "$(ProjectDir)WiRunSql.vbs" "$(BuiltOuputPath)" "INSERT INTO Property(Property, Value) VALUES ('DISABLEADVTSHORTCUTS', '1')"

The WiRunSql.vbs file is available from microsoft

Regards
Lumo

梦里人 2024-09-04 02:05:09

没有更多细节,我唯一的猜测是您在目标存在之前创建了快捷方式,以便 Windows 无法看到清单。

Without any more details, my only guess is that you create the shortcut before the target exists so that windows is unable to see the manifest.

╰◇生如夏花灿烂 2024-09-04 02:05:09

我建议安装程序创建的图标不要指向 .exe 文件,而是指向注册表项。打开快捷方式属性,如果快捷方式选项卡上的目标字段被禁用并且包含应用程序的名称,那么就是这种情况。

您可以将图标设为非广告,然后创建的快捷方式将指向 .exe 文件。但在这种情况下,如果 .exe 丢失,安装将无法自动修复。

I would suggest that the icon created by the installer does not point to the .exe file but rather to a registry key. Open shortcut properties, if Target field on Shortcut tab is disabled and contains the name of the application, then it is the case.

You can make your icon non-advertised, then the created shortcut would point to .exe file. However in this case, the installation can't be automatically repaired if .exe becomes missing.

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