0
votes

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!

3
Maybe you could show the code you use to create the shortcut?Anders
There is no code. I am using the msi builder that comes with Visual Studio 2008 to create the shortcut.Alain Hogue

3 Answers

2
votes

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

0
votes

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.

0
votes

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.