11-05-2009 10:18 AM
Hi,
I have written a simple Labview program that allows the user to read and write to a text file. I have changed the permissions of the text file so that people who are logged in with access level of Windows User can read and write to the file. I have created a Labview Installer that includes this file, but once it is installed on my target computer the file permissions have been changed so that you must have Administrator privileges to write to the file. If I log in to Windows XP as a User then I cannot write to the file. Thanks for any info.
Steve
11-06-2009 03:20 AM
Steve,
I could not open up the file that you have sent (i use 8.5.1), but you can try setting the file permission while creating the installer under---> "source file settings", by forcing a file to go as "readonly "or "not readonly"
Regards
Guru
CLA
11-06-2009 08:23 AM
Guru,
Thanks for the reply. I had set the file permissions to be non-read-only and that didn't fix the problem. The strange thing is that when I log on to the target computer as a Windows User I can save other text files - I just can't save the ones that are part of my build. Windows gives me an error letting me know that the files are read-only. Then when I check the file properties it shows up as read-only. If I try to change the permissions when logged on as a Windows User I'm not allowed to. When I log back on as a Windows Administrator everything is fine.
I'm still quite puzzled by this one.
Steve
11-06-2009 09:48 AM - edited 11-06-2009 09:49 AM
Steve where is the file located in respect to the application folder?
Does the installer install into the program files folder? Restricted (Normal) User are not allowed to have write access there.
The save places where users can store files are in four places. You will get the correct pathnames from the registry.
1. Current user data: HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders\Personal
2. Current user application data: HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders\AppData
3. All user data: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders\Common Documents
4. All user aplication data: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders\Common AppData
It's a good practise to add <manufacturer>\<application> to this paths.
All other places are unsave and you must add additonal steps to have full access to files in these folders.
11-10-2009 01:17 AM
Steve,
it looks like you or the LabVIEW application that you have built, do not have sufficient permission to create or edit a file in the folder....Check the admin rights so that the files could be created (new files) or edited...
11-10-2009 12:46 PM
Guru,
Do you know how to check what permissions Labview has? I have administrator access on the computer that I do my development work on.
The interesting thing is that if I go to my C drive and create a new folder (called Test, for example), and then right-click on this folder to see its properties the Read-only box is checked off but gray. I can un-check it off and Apply the changes but the next time I bring up its properties again the Read-only box is again checked off but gray. I can read and write to this folder, but as soon as I log on with Windows User access I can't write to files in the folder.
I'm wondering if its related to Windows XP but can't find anything online that can fix it.
Any more insight would be helpful. Thanks!
Steve
11-10-2009 02:43 PM - edited 11-10-2009 02:45 PM
The gray read-only box behaviour is normal in some circumstances. I never got a rule about that.
Which permission you have is not only controled by the oldstyle read-only attribute but also by the access control lists (ACL). The ACL is a more complex thing and knows OS groups and users. Creating an object (subfolder oder file or shortcut) within a folder will automatically inherit the ACL from the parent. On an standard installation a restricted user is not allowed to create something on the C: drive root folder. If you have administrative rights and create a subfolder there restricted users will not have write access there.
Where can you get a sight to the ACL? Make a right click on the folder you mentioned. In the dialog open the Security tab.
You don't have it? InWindows Exporer go to Extras >> Folder options... >> View and uncheck the box labeled something like "Use simple file security (recommended)" (the fourth check box in my screenshot).
11-11-2009 04:09 AM
Hello Steve,
I am not that great in network seetings....but my experience (earlier project) said i can not change/edit a file without LabVIEW having proper permission to the windows.
So to avoid it , I created a seperate folder where all the files that LabVIEW application access (creat /modify) with full permission given (read as well write) to "ALL". (Not to mention my network administrator did this for me).
I agree that this is not a good method to provide a read/write permission to "all" but i didnt had any other choice....
Guru
CLA
11-11-2009 09:26 AM
Waldemar and Guru,
Thanks for your replies. Attached is a jpg of the security for my Test folder. I have given everyone full read/write access but Users still can't write to the folder because the read-only is grayed-out.
Steve
11-11-2009 11:19 PM
hmmmmm catchy...
Steve,
Are you the admin for this PC?
Guru