LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Windows 7 compatibility

Solved!
Go to solution

When a Labview built executable tries to create/ edit its .ini file, located in the same directory as the .exe, and when this all happens in "C:\Program Files", Windows doesn't provide this previlege for a standard user and labview doesn't create this 'application.ini' in any other location other than the exe's directory. What is the solution to this problem? is there a way to store 'Application.ini' in any folder other folder Program Files?

0 Kudos
Message 1 of 11
(3,020 Views)

The simplest solution would be to distribute application.ini along with application.exe.  Whatever puts applicaiton.exe into C:\Program Files\Whatever can simply install application.ini in the same location.

 

Generally, there is no reason why a LabVIEW program needs to write to the INI file at run time.

0 Kudos
Message 2 of 11
(3,009 Views)

Mark,

 

I wish that was true, but that is not necessary the case. There are many times when you need to update the ini file in order to supply additional information on subsequent run. I have needs that need to set the initial paramtrs after the installation.

0 Kudos
Message 3 of 11
(3,001 Views)

@Joseph Loo wrote:

Mark,

 

I wish that was true, but that is not necessary the case. There are many times when you need to update the ini file in order to supply additional information on subsequent run. I have needs that need to set the initial paramtrs after the installation.


If you just need to update it once following installation, the newer versions of app builder allow you to run the EXE immediately following installation under (I presume) the credentials of the installing user which should have write access to the INI file.

 

I'm curious (not doubting or judging, just curious) what you need to change in the INI file at run-time.

0 Kudos
Message 4 of 11
(2,993 Views)

Typically you would put config files in the User App Data or Public App Data.  Create a directory in either of those for your Program, then write to them.  Public would work for all users.  Other users won't have access to other user's User App Data, so you can have different configs for each user if you use that location.

Message 5 of 11
(2,989 Views)

In this case, you will need two INI's - one that LabVIEW creates for your app, and then the one you use for yourself.

 

If you want to, not that I am suggesting it, you can click the Unlock checkbox in the Source File Settings in the Installer Properties.  It will allow general access to the file.  You may have to do that for the Public App Data directory as well.

Message 6 of 11
(2,987 Views)

All my apps use the Public App Data directory as a place to store things like .ini's, templates, etc that are a accessed/modified by the program.  The programs install and run with no problems on either WinXP or Win7 32. 

 

The  LV Installer Builder will let you build an installer that automatically selects the right location for user config files based on what OS you are installing on.  You can use the 'Get System Directory.vi' in your program so that your code adapts to the OS it is running on as well.

0 Kudos
Message 7 of 11
(2,973 Views)

Thank you all, but I still don't get the solution to my problem. I ll try to restate my problem for better understanding.

 

Any Labview executable creates a 'yourapp.ini' while it is built or when the exe is run. This ini has information to properties of the executable, like fonts. I want it to be editable. Now how should this AUTOMATICALLY created ini file, be created in any location with right permissions?

 

Please refer to: http://digital.ni.com/public.nsf/websearch/65F76F247012DF68862562C70073BE06?OpenDocument

0 Kudos
Message 8 of 11
(2,928 Views)
Solution
Accepted by topic author pary

Did you try the unlock option I mentioned?

0 Kudos
Message 9 of 11
(2,924 Views)

Thanks a lot. That worked. One small problem still persists. if someone deletes the file, my application is not able to create it again during runtime (unless it is run as admin). think there is no other go.

0 Kudos
Message 10 of 11
(2,871 Views)