LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

vista directories (LV 8.5)

  I still haven't used Vista much, but in recognition of the inevitability, I started trying to make my LabVIEW programs "Vista Compatible" some time ago.  The big issue I've been trying to avoid is where to put files such that Vista will allow read and write access.  In particular, most of my programs write config (.ini) files to hold startup settings.  If the programs are compiled to executables, and thus end up in C:\Program Files\myprogram, then under Vista, you can't read and write config files to the program's own directory.

   To avoid such problems, I found a VI some time ago, perhaps here on the forums, that is supposed to find the user directory in Windows.  It uses a call to Shell3.dll, SHGetFolderPathA.  Under XP, this returnsC:\Documents and Settings\All Users\Application Data, to which I append my own program directory.  Unfortunately, I just tried this in Vista and it returned C:\ProgramData.  From what I've read on the web, C:\ProgramData is the "magic" redirection folder that Vista uses when a non-compliant program tries to store things in a location that XP and older versions of Windows allowed access to.  As such, this seems to me to be a non-ideal place to put program data, since anyone who knows what this folder is used for will be suspect of its contents.

    Can anyone shed light on this issue, or suggest alternatives that will work under XP and Vista.  At this point, my best idea is to have the program install to C:\Program Files\myprogram and then create something like C:\myprogramdata to store data and config files.

 

Thanks,

   DaveT

-------------------------------------------------------------
David Thomson Original Code Consulting
www.originalcode.com
National Instruments Alliance Program Member
Certified LabVIEW Architect
Certified Embedded Systems Developer
-------------------------------------------------------------
There are 10 kinds of people: those who understand binary, and those who don't.
0 Kudos
Message 1 of 2
(2,471 Views)

I'm not too familiar with Vista either, but to my knowledge "ProgramData" is the right place to save data for All Users (of course in a subfolder as you do). If you want to store your data per user, you'll have to ask for the APPDATA folder. This should return the "Users\<UserName>\AppData" folder.

The "magic" redirection you're talking about is, as far as I know, the "Roaming" directory in Users\<UserName>\AppData\Roaming.

 

Hope this helps,

Daniel

 

0 Kudos
Message 2 of 2
(2,462 Views)