PDA

View Full Version : Administrator Only setting on a shortcut


ceciltss
10-23-2008, 04:24 PM
Hi there,

I just upgraded to Setup Factory 8 and I am hoping someone here can save me some work.

As a value added reseller I spend a fair amount writing installs for a particular piece of software. It has been around a while and has a minor problem in VISTA. There is a solution to this problem and I would like to incorporate in the install script.

In order for this software to be fully functional, the shortcut used to call it must be set to "Administrator Only". I use the Shell.CreateShortcut action since both application and arguement (document) need to be specified. At this point, I would like to modify the create shortcut(s) to be Administrator Only.

Any help will be appreciated. Thanks in advance.

jassing
10-23-2008, 06:08 PM
Why not create a manifest?

ceciltss
11-12-2008, 04:36 PM
Thanks for your suggestion. I figured out a great deal about how manifests work trying to implement one. Unfortunately, as near as I can tell, if an executable has internal manifest, it will ignore any external one. And yes the application I am installing does have an internal manifest.

I am distributing this application under license. I cannot change the executable file. So I can't just fix or remove the internal manifest.

I return to my original question. How do I, using Setup Factory code, set a shortcut to Run As Administrator under VISTA?

At this point any and all help is significantly appreciated.

Cecil

jassing
11-12-2008, 05:07 PM
I'm not sure you can...
What about using RunAs?

pww
11-13-2008, 03:46 AM
Not sure about shortcuts (what if the user doesn't use that shortcut to start the app?), but you can set the exe itself to run as admin.
To do so, after the installation create under

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers\

a new string (REG_SZ) value with Name = path to your exe
and value Data = RUNASADMIN
This way app will always be started 'as admin'.

Don't know if it will work if instead of path to your exe you put a path to a shortcut (.lnk file). Maybe in this case the registry entry should be created under HKCU not HKLM

Indeed best would be to find why actually the app needs to be run as admin.
If the reason is it's installed under \Program Files and writes to it's own install folder, you can give 'Full control' permissions for the 'Everyone' user on that folder (there is an example here), then the app will work without the need to run it as admin