LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

CVI Applications under Windows 7.

Hi

 

I have created a number of programs with CVI 2009 but after i install it on windows 7 it pops up the UAC (User Access Control) when i want to run the program.

 

Is there a way for this not to happen without the user having to change setting in windows 7 ?

Is it possible to sign the program that i create so the UAC does not popup?

Help share your knowlegde
0 Kudos
Message 1 of 13
(4,146 Views)

Hi Shako,

 

what does your program do? Anything "forbidden" for the normal, non-adm-user within Windows7? Perhaps you use a ini- or config-file in program folder? (Move such data to user-data-folder)? Do you see same behaviour when run the application as Administrator? (right-click on exe, run as ...)

 

Peter

0 Kudos
Message 2 of 13
(4,138 Views)

Hi Peter

 

The program communicates with a device via a serial port and logs the data into a .csv file.

I think you would need to be an admin but even under the admin account the UAC pops the message.

Help share your knowlegde
0 Kudos
Message 3 of 13
(4,137 Views)

Hi Shako,

 

I guess the UAC is 'cause of the serial port? You've already moved the csv-file to a user folder?

 

Peter

0 Kudos
Message 4 of 13
(4,137 Views)

I think so to but there has to be a way in cvi to give the program the rights.

I installed wire shark which communicates throught the ethenet port and it does not popup the message every time i want to run the program.

Help share your knowlegde
0 Kudos
Message 5 of 13
(4,134 Views)

In my limited experience (2 installs on Win7 till now) I had no problems neither in using the serial port nor in creating files in the application directory.

Both applications were created ion CVI2009 SP1.



Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
0 Kudos
Message 6 of 13
(4,127 Views)

My understanding is that if you're logged in as "administrator", then all programs that you launch will automatically run with adminsitrator privileges (aka "elevated"), and you will not see any prompt or UAC-related failures. If you're logged in as any other user, however, even if it's a user with administrator-level access to your computer, then your programs will not run in elevated mode unless you right-click on the shortcut and select "Run as administrator" or unless the program has an application manifest embedded that instructs it to run as administrator. But doing either of those results in you seeing the UAC prompt as soon as you launch the program. Some programs needs to do this, since they need to perform some action that UAC would typically not allow a non-elevated program to perform (installers are a typical example, since they must copy files to restricted locations and they need to modify the registry).

 

If I were you, I would first try to establish exactly what action in your program causes the prompt to appear. I'm a bit surprised that the prompt pops up during execution. Normally, a UAC-restricted action, when invoked from a non-elevated program, simply fails rather than display the prompt. Have you been able to identify the specific line of code that results in the prompt?

 

If it turns out that you can't rewrite your code to be more UAC-friendly, then the next best thing is to require that the program always run in elevated mode. You typically do this by adding a manifest that defines requestedExecutionLevel with level='requireAdministrator'. (in CVI, you can attach a manifest by checking Build>>Target Settings>>Embed manifest file). This should still result in a prompt, but at launch time instead. Also, an important restriction is in order to debug an elevated program, the CVI ADE must itself be run elevated.

 

Finally, while you as an administrator-level uses can disable UAC at the OS level, globally, there is really nothing you can do as a programmer to enable any individual non-elevated program to circumvent UAC enforcement. This would be a major security gap if it were allowed.

 

Luis

0 Kudos
Message 7 of 13
(4,117 Views)

Thanks fo the information.

 

im looking into manifest file but not sure what to do.

I took a template one from microsoft but i get an error"the application has failed to start because its side-by-side configiration is in correct"

 

The prompt is only when i launch the program but there has to be a way like wireshark were the privilages are setat the intallation stage.

Help share your knowlegde
0 Kudos
Message 8 of 13
(4,096 Views)

You might want to check the filename of you executable. If it contains terms like "setup" or "installer" and most likely a few others, some windows versions required admin rights.

 

Greg

0 Kudos
Message 9 of 13
(4,090 Views)

Does any one have for me an example of a manifest for windows 7 that works?

Help share your knowlegde
0 Kudos
Message 10 of 13
(4,078 Views)