01-02-2024 08:55 AM
Hey all,
I have two txt files needed for my application to run. I include these files in my installer via the data folder. All this is fine and the application runs as expected. I would like for my user to be able to update these txt files as needed. So in my application there is a shortcut menu that lets the user open these txt files (Faster than using file explorer to find them). The problem is they open in Read-Only mode, so they cannot be edited. I belive the issues is the permissions on the files once they are installed. I can use my source code to open non-installed txt files, but if I try to open the installed txt files I only open in Read-Only. Is there any thing I can do to make my installed txt files open in read-write mode?
This is the code that I am using to open the files:
These are the installed files that I would like the user to open:
Solved! Go to Solution.
01-02-2024 09:11 AM - edited 01-02-2024 09:13 AM
What are you using to install the program? NI Package? LabVIEW's Installer?
You are installing the files to the [Program Files] location on a Windows computer. This location is locked to Read Only by default, and usually only admins can have access to this location. Some options you can do:
1. Move the text files to a location designed for read/write access like [ProgramData] (useful to share configuration across users) or Users\AppData (useful if you want different configuration per user)
This is the best option. This is how most software works, and how Microsoft recommends applications and data are placed.
2. As part of your installation, if it's run as admin, you could run a batch file that modifies permissions in any location so anyone/user/etc... has read/write access. You would use a batch file like this for the location you have now:
01-02-2024 10:06 AM
Thanks for the quick response! I am using LabVIEW installer. I like the idea of moving the files to ProgramData this seems like the best long term solution. Thanks for the Batch file idea as well, I will play around with it too.