LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

I still have no way how to deal with the LabView Data folder automatically created in the My Documents folder whenever I run the application

I tried numerous ways that some people suggested in this forum but did not succeed in having the LabView Data folder created somewhere else than in My Documents when running a built LabView application. Changing the target destination folder did not help at all. A member suggested to put some line like " defaultdestination = ..." or so into the build file, but I did not know where exactly to put such a line. That folder created is particularly anoying for people who don't normally use LabView but are only using the application. Please let me know when you LabView Experts out there have found a way to eliminate or relocate the creation of that folder at application startup.

Thanks a lot.

Tim, Van
0 Kudos
Message 1 of 7
(3,651 Views)
Tim,

use the path constant located in the Functions pallette under 'File I/O->File Constants->Default Data Directory'. It refers either to the default directory (which is (osdatadir)\Labview Data on my WinXP system) OR TO A NON DEFAULT PATH if you have defined one. To define a non-default path, got to the menu 'Tools->Options...' and change the entry under 'Paths->Default Data Directory'. This change will create an entry in the labview.ini file (located where the labview.exe is), e.g. the entry 'DefaultDataFileLocation=d:\temp' is created when I change the default data dir to 'D:\temp'.

Now for a compiled .exe with the name (say) myapp.exe you will find a file myapp.ini in the same location where myapp.exe is. It is usually an emtpy file directly after the application build process. Put the line 'DefaultDataFileLocation=(your path)' in this file.

Users of your compiled app can either
- edit this .ini file to change the default,
- or you can make the menu entry 'Tools->Options...' accessible in the built VI
- or you can provide a self written dialog in your app and modify the myapp.ini programmatically

(This last way is probably not a good one since the user might have to relaunch myapp.exe in order to affect a change of the 'Default Data Directory' path constant)


-Franz



Tc@labView wrote:
I tried numerous ways that some people suggested in this forum but did not succeed in having the LabView Data folder created somewhere else than in My Documents when running a built LabView application. Changing the target destination folder did not help at all. A member suggested to put some line like " defaultdestination = ..." or so into the build file, but I did not know where exactly to put such a line. That folder created is particularly anoying for people who don't normally use LabView but are only using the application. Please let me know when you LabView Experts out there have found a way to eliminate or relocate the creation of that folder at application startup.

Thanks a lot.

Tim, Van

0 Kudos
Message 2 of 7
(3,636 Views)
Franz,

whenever I build an .exe file through the application builder I get a file with an icon that looks like a notepad file but has a gear on it. It has the same name as my application and usually does not contain any more than the name of the application after it is created. Is this the ini file you were mentioning earlier? I tried to add the defaultdata... = ... into it but did not notice any change. Did I miss something? The Default seems to be set to C:\program files\national instruments\labview 7.

Tim
0 Kudos
Message 3 of 7
(3,603 Views)

Tc@labView wrote:
Franz,

whenever I build an .exe file through the application builder I get a file with an icon that looks like a notepad file but has a gear on it. It has the same name as my application and usually does not contain any more than the name of the application after it is created. Is this the ini file you were mentioning earlier? I tried to add the defaultdata... = ... into it but did not notice any change. Did I miss something? The Default seems to be set to C:\program files\national instruments\labview 7.

Tim





Sorry, I was not exact in my first post: (I don't use the Application Builder very often): the file myapp.ini (when your application's name is myapp.exe) is not created in the build process, but only after the first run of myapp.exe. I also forgot to mention a section name which is needed. So when the application is myapp.exe, the ini file is myapp.ini and it should contain
[myapp]
DefaultDataFileLocation=c:\temp



-Franz
0 Kudos
Message 4 of 7
(3,599 Views)
Sorry for asking again, but I tried it out, my [myapp].ini file now contains exactly the lines

[myapp]
DefaultDataFileLocation=c:\temp

(where myapp is the name of my application)

but I still get the LabView Data Folder created in My Documents. Am I missing a step?

Tim
0 Kudos
Message 5 of 7
(3,599 Views)
Sorry, then I don't have a clue...
I attach a simple app which works fine on my PC. The zip file contains 'unbenannt.vi' (which just reads and displays the default data directory) and a compiled version of it named application.exe and the ini file application.ini.

Try to run them. In the application.exe, call the menu 'Tools--Options...', select 'pathes' and modify the entry under 'DefaultDataDirectory'. That modification should be visible in application.ini (after closing application.exe). The next start of application.exe will reflect the changes.

Maybe you send me your VI (in some stripped down form) so I can have a look what happens.


-Franz
Message 6 of 7
(3,593 Views)
Ok, I got it now. It is working. The vi you attached was very usefull. Thanks a lot.

Tim
0 Kudos
Message 7 of 7
(3,578 Views)