LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

LabVIEW program use administrator rights

H,


Why are you using CreateProcessWithLogonW? Why not CreateProcessWithLogonA. You can put the LabVIEW strings directly in them. You can skip the ascii to unicode conversion.


Don't know if it will work, but it usually does.


Regards,


Wiebe.
"Dynamik" <x@no.email> wrote in message news:1144082432286-346719@exchange.ni.com...
Attaching [tested] Launcher2_1.vi -&nbsp;with much egg-on-face. Smiley Tongue
2_1. actually uses the Command-line parameter.
Excuse: This VI went through many revs before&nbsp;Launcher2.vi went&nbsp;into production app.&nbsp; A nice, general-purpose version that accommodates empty-string arguments&nbsp;seems to complicate matters, as&nbsp;arguments passed to CLF change.
Non-empty strings require array-inputs, and empty strings require U32 inputs set to zero&nbsp;(null pointer.)(?)
&nbsp;
Apologies, Conseils!
&nbsp;
Message Edited by Dynamik on 04-02-2006 05:12 PMMessage Edited by Dynamik on 04-02-2006 05:13 PM



Launcher2_1.vi:
http://forums.ni.com/attachments/ni/170/177256/1/Launcher2_1.vi
Message 11 of 20
(2,609 Views)


@Dynamik wrote:

Hi Jim, Conseils,

      Please consider using the attached Launcher2.vi  It closes thread and process handles associated with call, allowing Launcher2.vi to be calleded multiple times without incurring a memory leak.

Cheers.



I see you have gotten a very proficient Windows API/Call Library Node programmer. 😉

The only comment I have is that your way of ASCII->Unicode translation is rather brute force. It will only work for US american code pages without real problems. Already some European code pages and the according special chracters used in the strings will create invalid Unicode characters.

As Wiebe has pointed out using the ANSI function may simplify the code a bit. Otherwise you really should consider using the MultiByteStringToWideChar API to do the translation properly.

Rolf Kalbermatter

Message Edited by rolfk on 04-05-2006 10:25 AM

Rolf Kalbermatter
My Blog
Message 12 of 20
(2,612 Views)
Thanks for pointing out the code page handling concerns; as I am certain to come accross this in the inteded application. All those funny little dots and accents sat on the top of letters...... always cause me problems, when I am coding for something as well. I have some time in hand yet before implementation, but I know it's coming hence I am so pleased that someone offered a solution and just as pleased that it's being peer reviewed. For any code to withstand the scrutiny of a peer review like this is pretty daunting but I am really pleased that the code is there. I would probably have had very many frustrating hours bashing my head against a brick wall on this one.
 
Handling a code page is, I hope Smiley Wink, well within my scope.... messing about within API's is also within my scope; I place it at the same pain level as having my wisdom teeth removed without anasthetic, possibly necessary, eventually beneficial but better to regularly visit a good Dentist first. Much less trouble in the long run.....(read Dentits as Dynamik and yourselves here for contributing). Thanks.Smiley Happy
 
 
0 Kudos
Message 13 of 20
(2,599 Views)

Hi Guys,

      Thank you for the "proficient" plug, Rolf! Smiley Happy   ... though I'm not sure that "knowing enough to be dangerous" qualifies me as "proficient". Smiley Very Happy

re: "brute force" - have to admit that All Unicode is Greek to me.  Smiley Tongue

re: CreateProcessWithLogonA - what API DLL would I find that in? Smiley Wink

Cheers. 


@rolfk wrote:



@Dynamik wrote:

Hi Jim, Conseils,

      Please consider using the attached Launcher2.vi  It closes thread and process handles associated with call, allowing Launcher2.vi to be calleded multiple times without incurring a memory leak.

Cheers.



I see you have gotten a very proficient Windows API/Call Library Node programmer. 😉

The only comment I have is that your way of ASCII->Unicode translation is rather brute force. It will only work for US american code pages without real problems. Already some European code pages and the according special chracters used in the strings will create invalid Unicode characters.

As Wiebe has pointed out using the ANSI function may simplify the code a bit. Otherwise you really should consider using the MultiByteStringToWideChar API to do the translation properly.

Rolf Kalbermatter

Message Edited by rolfk on 04-05-2006 10:25 AM


 

Message Edited by Dynamik on 04-13-2006 07:53 PM

When they give imbeciles handicap-parking, I won't have so far to walk!
0 Kudos
Message 14 of 20
(2,559 Views)


@Dynamik wrote:
re: "brute force" - have to admit that All Unicode is Greek to me.  Smiley Tongue

re: CreateProcessWithLogonA - what API DLL would I find that in? Smiley Wink



Hmm, you don't have to understand Unicode to use it Smiley Wink. Just get familiar with WideCharToMultiByte and MultiByteToWideChar and you are completely fine

CreateProcessWithLogonA: Mmmh, when writing this I was wondering if this might be one of those APIs introduced with W2K or later and therefore without ANSII counterpart, but I was to lazy to check and usually Microsoft does not name those functions with a W ending. But it seems this one is such a beast. Smiley Surprised Sorry about that.

Rolf Kalbermatter

PS: There is a post here on the boards with a VI library attachment that does the Unicode <-> ANSII translation using above mentioned functions (thus Windows only).

Message Edited by rolfk on 04-14-2006 11:28 AM

Rolf Kalbermatter
My Blog
0 Kudos
Message 15 of 20
(2,544 Views)
Hello,
 
Do you guys know how to programmatically get the User Privileges from the OS at Runtime.
 
Thanks and Best Regards,
Gary
0 Kudos
Message 16 of 20
(2,485 Views)
HI,
 
See this KB for more information on checking user privileges.
 
Ankita
Message 17 of 20
(2,453 Views)

Please allow me to ask this seemingly dumb question :).

 

Why does one need Admin rights to run LabVIEW Runtime anyways? prior to 2020, we didnt need this. 

we have multiple users who are using LabVIEW RTE for years, and our company policy has always been NOT to allow elevated rights to regular users.

With the change in LabVIEW 2020, we're having to jump through hoops to get it working on a regular account. Not ideal at all.

 

Wish this would be reversed again to regular accounts being able to run LabVIEW RTE again..

0 Kudos
Message 18 of 20
(681 Views)

The LabVIEW runtime does not need administrative rights as far as I can tell here. It must be something your programs try to do that requires this.

 

What doesn't work for you without administrative rights?

Rolf Kalbermatter
My Blog
0 Kudos
Message 19 of 20
(674 Views)

Hi Rolf, 

after installing Labview Runtime 2020, when i start the application under a regular user account, it prompts me to provide Admin credentials. we've tried using iCACLS to setup specific access to the program folder and subfolders, but to no avail.

are we doing something wrong in the installation process you think?

0 Kudos
Message 20 of 20
(667 Views)