.net - 为什么设置后在 dot net 快捷方式中禁用了目标?

标签 .net winforms shortcut

转到任何 dotnet 应用程序快捷方式 由 dotnet 设置制作 然后点击属性,在出现的画面中,为什么找不到目标按钮?!

这只是发生在 dotnet Setup 生成的快捷方式上,为什么?以及如何启用它?

最佳答案

This is a feature of Windows Installer and is called "Advertised Shortcut". This shortcut contains information about the product it is pointing to.

You can turn this on/off in your setup, by setting the DISABLEADVTSHORTCUTS property.


广告捷径

In the MSI world there are two types of shortcut - advertised and non-advertised.

A non-advertised shortcut is a standard windows shortcut. If you right-click it you will see the target field points to the executable that will be launched. If, for whatever reason, this executable is missing the application will simply fail.

An advertised shortcut is a technology specific to Windows Installer. If you right-click an advertised shortcut the target field will be greyed out. An advertised shortcut supports advertisement and repair.

Repair means that if the executable to which the shortcut is pointing is not there then windows installer will repair the application and replace the missing file. In fact, it will also check other important files, flagged as key paths, and if any of those are missing it will replace them as well.

Advertisement is a process in which the application appears to be installed the shortcuts are there but the application is not actually installed. The installation, the copying of files and registry entries, only takes place when the user first launches the application. An advertised install only puts down what we call the application interfaces. An application interface is any way to start the application. This could be a shortcut, file extension or COM interface.


编辑
要添加属性,您可以使用 Orca MSI Editor ,或者看看如何Set DISABLEADVTSHORTCUTS property in VS.NET setup project文章。
编辑 2
一些更有趣的信息在 here .您可以使用参数 - setup.exe DISABLEADVTSHORTCUTS=1 直接运行 setup.exe或 msiexec.exe <path to msi-file> DISABLEADVTSHORTCUTS=1 .
而且,如果您使用的是 Orca MSI Editor ,您可以通过打开您的 msi 文件并转到 Property 来设置该属性。页面(左侧),并通过右键单击“Add Row”菜单选项添加新属性。保存 msi,你就完成了。

关于.net - 为什么设置后在 dot net 快捷方式中禁用了目标?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1270779/

相关文章:

Eclipse CTRL+A, CTRL+E 转到开头 转到行尾

android - 在 xamarin 中使用新的 .NET 执行环境

.net - Entity Framework : Navigation Properties Issue

c# - ListView 列标题液体大小?

c# - 如何将字典键转换为字符串数组(在 dictionary.value 中指定的数组索引处插入)

android - Eclipse 在调试 ctrl+shift+i 时丢失了检查快捷方式

.net - VB6 App + .Net 组件作为编译应用程序工作,但不在 VB6 IDE 中工作

.net - 如何在 Firefox 上测试我的 .NET 站点?它在 IE 中加载但是当我在 Firefox 中打开它时它不加载 CSS

c# - 如何通过单击按钮更改所有标签前景色

命令行中的 bash/zsh 输出行