LabVIEW Idea Exchange

cancel
Showing results for 
Search instead for 
Did you mean: 
spsimona

LV exe run as admin mode

Status: New

What if you need to run exe as admin mode?

 

Currently Build Specifications is not enought for doing it.

Here you are what you need to do:

 

1. Built the executable

2. Install mt.exe (https://www.microsoft.com/en-us/download/confirmation.aspx?id=8279)
3. Opened cmd as adminstrator and ran mt.exe -inputresource:"Application directory\application.exe" -out:application.manifest
4. Opened application.manifest and changed input="asInvoker" to "requireAdministrator".
5. Saved application.manifest
6. ran mt.exe -manifest:application.manifest -outputresource:"Application directory\application.exe";#1

 

Is it an effective method?

 

It would be better the following:

1. Create Manifest

2. Easy modification in My Application Properties

Capture1.JPG

 

 

Hope it helps to do a more effective LabVIEW!

 

Álvaro

Álvaro Simón
Spain TSE | CLD, CTA & CPI
8 Comments
GuenterMueller
Active Participant
Nice idea. And for the typical use case that you have outlined here: Add the option "Add manifest to run as Administrator". Just in case the user/application has no further interest in maintaining a manifest.
ericthemantis
Active Participant

Yeah! Adding a option to "Run only as administrator" would be really helpful! Doing the mt.exe manifest edits is a little time consuming.

Eric H.
Senior Applications Engineer - Product Analytics
Emerson T&M (NI)
AristosQueue (NI)
NI Employee (retired)

Isn't that pretty much the same steps you'd have to do to sign as an administrator for any other compiler?

As far as I can tell, using the MT tool is required even if you use VisualStudio, Microsoft's own dev environment. Maybe I've missed a feature in a recent version of VS, but it seems that is generally the way to do it.

 

I don't think LV should be getting into OS specific areas like this. I'm doubly suspicious of us doing so when the OS vendor doesn't.  This seems to me like a hazard, especially if the process differs across different versions of Windows.

 

I'd need to be convinced.

Nausikaa
Member

I think it's a must have supposed to be included nativelly in Labview.

Juan Manuel Rovira

RavensFan
Knight of NI

Juan,  If you think this is a must, then don't just leave a comment, be sure to click on the Kudos button above to register your vote!

AristosQueue (NI)
NI Employee (retired)

Juan: Please explain why you believe this to be a "must have". I explained above my reasoning against it.

ToeCutter
Active Participant

Surely the whole point of LV is to do things in an easier and less time-consuming manner than e.g. Visual Studio?

 

On that basis I give a Kudos. That said, I think Aristos raises some points of merit which would need to be considered.

Cepera
Member

Here's another way to run an EXE in admin mode: if you have LV TouchPanel module installed, you can get a manifest from the following folder: "C:\Program Files (x86)\National Instruments\LabVIEW 2015\examples\TouchPanel\Windows Embedded Enabling Features\resource" (adjust for your version). The manifest name is vista.adminUser.manifest. Add it to your  project. The rest is the same - check "Embed manifest file". Verified on Windows 7.