LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to programmatically set Run as Admin or SQL Surface Area Config admin priviliges?

My application (LabVIEW 2011 & Win 7) requires admin privileges to access SQL (installed by DSC toolkit). To make it work, a user can either

(a) change privilege level property for app.exe to run as administrator, or

(b) go to SQL Surface Area Config and Add New Administrator.

I don't want users to have to do this extra step. How can I programmatically set the access privilege for the app.exe when installed on an unknown user's computer?

 

More info:

My project has several Build Specs: for application .exe, source code distribution, and for app installer (with post-install app-setup.exe).

 

Half-baked ideas:

1. Embed manifest file (option in app.exe Build Spec). What should be in this file for LabVIEW 2011 & Win 7? I found this, for LV 8.2 http://digital.ni.com/public.nsf/allkb/E06C1800F5AFCCBF86257236006C9F2A; other environments are discussed here: http://msdn.microsoft.com/en-us/library/bb756929.aspx ?

2. Set Run as admin property on app.exe in source dist, but this doesn't persist through installation on another computer. How can I set this programmatically on installed app.exe?

3. Set registry key (RUNASADMIN?) in installer build spec, but this wouldn't apply to the app.exe, just to the setup.exe. Set registry key programmatically (using registry.llb VIs) for app.exe from post-build setup.exe, but what how exactly? Is it OS version dependent? See here: http://www.verboon.info/index.php/2011/03/running-an-application-as-administrator-or-in-compatibilit...

4. Use "sac" SQL utility somehow to set admin privileges for SQL (programmatic Surface Area Config).

 

Help?

0 Kudos
Message 1 of 3
(2,911 Views)

How did you solve it?

Is there a easy way?

Thanks a lot.

0 Kudos
Message 2 of 3
(2,685 Views)

Hi RIPosa,

 

The easiest way of solving this issue is to run the VI as an administrator, as mentioned in the KnowledgeBase article included below. It is also possible to access the manifest file, as MegKB mentioned above.

 

Running Program as Administrator: http://digital.ni.com/public.nsf/allkb/A97296A2D76C6EE486257290007F3D96?OpenDocument

 

Regards,

 

Jason Davis

Applications Engineer

National Instruments

www.ni.com/support

0 Kudos
Message 3 of 3
(2,665 Views)