From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Handle File Path with Parantheses

Solved!
Go to solution

I have a Windows 10 64-bit machine and I am using LabVIEW 32-bit for development. I am trying to distribute an application and the stand-alone installs into C:\Program Files (x86)\<My Program>.

 

I have a .JSON file I try to read via my VIs and it errors out. I am suspecting that LabVIEW open\create\replace file does not like the parantheses. I can always install my application in a different directory, but I want to understand if somebody has faced this issue before and what the work-around was?


Kudos are the best way to say thanks 🙂
0 Kudos
Message 1 of 8
(2,559 Views)
Solution
Accepted by topic author winterishere8

@winterishere8 wrote:

. I am suspecting that LabVIEW open\create\replace file does not like the parantheses. 


Why would you suspect that?

 

Could be a permission issue (run the app using "right-click ... run as administrator" to test).

How do you generate the path on the diagram. Is it relative to the executable location?

Message 2 of 8
(2,541 Views)

The explanation for error 7 is something like "file not found". Can you double check that you actually have a file at the specified path? And like Altenbach said, if you are trying to write to the file, for example, and it is read only, then you will get an error, but I forget if it is error 7 or something else.

0 Kudos
Message 3 of 8
(2,533 Views)

Thank you for your reply. Running it as admin seemed to do the trick since it was inside C:\Program Files (x86\ ...

 

I generate the path programmatically depending on if am running development or run-time. I only saw this in run-time because it was calling the file from Program files directory. Thanks again.


Kudos are the best way to say thanks 🙂
0 Kudos
Message 4 of 8
(2,532 Views)

In that case, you should find a new location for your configuration file. The standard place in windows is the Program Data directory. The format I use is "C:\ProgramData\<company name>\<software name>".

Message 5 of 8
(2,525 Views)

Another option would be to unlock it when building the installer: (Not tested!)

 

(From the help: When you unlock a file or folder, you remove administrator access requirements from deployed files and folders, which allows anyone to edit files and folders after they have been installed.

 

unlockIt.png

Message 6 of 8
(2,517 Views)

@altenbach wrote:

Another option would be to unlock it when building the installer: (Not tested!)

 

(From the help: When you unlock a file or folder, you remove administrator access requirements from deployed files and folders, which allows anyone to edit files and folders after they have been installed.

 

 


Altenbach, I used to do it that way and it worked fine. But, then I started using NI Package Manager to distribute applications, instead of building installers, and the option no longer exists! That's when I had to find the "correct" location to put configuration data.

0 Kudos
Message 7 of 8
(2,502 Views)

I use package manager as well (since my installer doesn't work due to Erro 1097). I'll use your suggestion to put configuration files in ProgramData. Thanks again.


Kudos are the best way to say thanks 🙂
0 Kudos
Message 8 of 8
(2,495 Views)