Run As Administrator

Got a problem you cannot solve? Try here.
cdh
Posts: 4
Joined: Thu Feb 08, 2007 6:08 am

Run As Administrator

Postby cdh » Thu Feb 08, 2007 6:14 am

When you right click on a shortcut in Vista, there's an option to Run As Administrator. Does anyone know how to set this characteristic to a shortcut when it is created with IA so that it runs as Administrator without the user having to right click on the icon and select that option?

H4nd0
Posts: 92
Joined: Thu Nov 09, 2006 8:16 am
Location: Sydney, AU
Contact:

Postby H4nd0 » Fri Feb 09, 2007 9:55 am

You can't change the shortcut. You need to inject an application manfest into your EXE that makes a request to the UAC to elevate your privileges.

Here's how you do it:

http://softlogger.com/5588/most-popular ... t-exe.aspx

More info on UAC elevation here:

http://technet.microsoft.com/en-us/wind ... 06021.aspx

Including the elevation manifest won't stop UAC prompting though. You need to turn UAC off in order to avoid prompting. You can do this simply like this in IA:

Run Program reg.exe ADD HKLM\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Policies\\System /v EnableLUA /t REG_DWORD /d 0 /f (WAIT)

You will then need to reboot.

MichaelNesmith
Posts: 3452
Joined: Thu Dec 22, 2005 7:17 pm
Contact:

Postby MichaelNesmith » Fri Feb 09, 2007 1:41 pm

Very interesting. Presumably the turning off of UAC will require a separate UAC prompt? Or will it not require that prompt when the InstallAware setup has been previously blessed by UAC?
Michael Nesmith
InstallAware
Home of The Next Generation MSI Installer
Get your free copy today - http://www.installaware.com/

H4nd0
Posts: 92
Joined: Thu Nov 09, 2006 8:16 am
Location: Sydney, AU
Contact:

Postby H4nd0 » Sat Feb 10, 2007 4:53 am

If you do it from within the installer you won't see a UAC prompt since your installer is already running in an elevated state (Vista does this for you automagically). All you will see is a security warning in the tool tray but the change won't come into effect until you reboot.

MichaelNesmith
Posts: 3452
Joined: Thu Dec 22, 2005 7:17 pm
Contact:

Postby MichaelNesmith » Sat Feb 10, 2007 2:17 pm

Ah, true. However if setup is running without admin privileges, then this approach would fail, as in that case UAC blessing will not occur.
Michael Nesmith

InstallAware

Home of The Next Generation MSI Installer

Get your free copy today - http://www.installaware.com/

H4nd0
Posts: 92
Joined: Thu Nov 09, 2006 8:16 am
Location: Sydney, AU
Contact:

Postby H4nd0 » Tue Feb 20, 2007 10:28 am

Most apps require admin privs before installation anyway since the will have limited access to the machine irrespective of whether UAC is active or not.

Our installer requires admin privs. However, on Fista as part of the certification process your app is supposed to _not_ require admin privs. Fat chance when you want to do anything fancy under the hood.

Anthony Wieser
Posts: 7
Joined: Sun Mar 11, 2007 4:44 am
Location: England
Contact:

Postby Anthony Wieser » Thu Mar 15, 2007 8:20 am

H4nd0 wrote:You can't change the shortcut. You need to inject an application manfest into your EXE that makes a request to the UAC to elevate your privileges.

Here's how you do it:

http://softlogger.com/5588/most-popular ... t-exe.aspx


I've just tried adding a manifest using the following steps in a batch file:

miabuild myproject.mpr
mt.exe -manifest myproject.exe.manifest -outputresource myproject.exe;#1
signcode -cn "My Company Cert Name"

etc, but after the mt.exe stage, the output of the miabuild is truncated to around 260 KB.

Is the InstallAware exe not a standard windows exe file that mt can operate on? I'm using InstallAware 6.4

Anthony Wieser
Wieser Software Ltd

dbsoft
Posts: 1
Joined: Sun Mar 25, 2007 5:23 am

Postby dbsoft » Mon Mar 26, 2007 1:14 pm

Getting the same issue with the miabuild being truncated to 217K

Did you get a reply from Tech Support directly?

Regards


Return to “Technical Support”

Who is online

Users browsing this forum: No registered users and 112 guests