LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Installation considerations on recent Windows

Solved!
Go to solution

Hello All,

the programs I develop on CVI usually run on Linux production machine thanks to the Linux compiler sold by NI. It avoids plenty of security headaches. But now I have to make a pure Windows version and I'm a bit rusty with some 'recent' aspects of Widows security.

 

In particular I've noticed that programs installed in C:\Program Files cannot save data there. So you cannot change ini files, or save log files, or save data, etc...

What's the best approach around this for CVI programs ?

  • run the progs as administrator ? (does that limit some of the things the program can do ? Do you need to be admin to access the files created ?)
  • change the permission on the install directory so that the program can write to it ? Does that stay after installing a new version ?
  • change the default work directory at runtime so that everything is written to the user home directory instead ? Is it as easy as calling SetDir() ? Do I need the Windows SDK to know the user directory (on Linux you can simply use ~) ?
  • use explicit paths
  • install the program in a user directory instead of the Program Files directory. Is that possible in the CVI installer builder ?

I'd actually prefer the last solution because: (1) I don't have anything to change in the code and (2) it keeps together code, config files, logs and generated data and allows you to juggle between different versions in different directories.

 

Thanks

0 Kudos
Message 1 of 2
(2,282 Views)
Solution
Accepted by topic author gdargaud

In recent OSes Microsoft encourages the use of personal or common data folders. You can use some SDK functions to retrieve the path to such folders: see the following thread that extensively discusses the argument:

A better way to get AppData location?



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 2 of 2
(2,268 Views)