09-27-2011 08:48 AM
I'm using LV2010. I have an application which, when deployed, the installer creates an application folder inside the ProgramData folder. Inside this application folder, the installer installs a few files that keep application settings. This all works when the user is an Administrator. My problem is, as soon as a lowly "User" starts running the software, the settings can't be saved because these files do not have User write permissions. How do I, in the installer, at the time that these files are first created, set the permissions such that anyone can write to these files?
Thanks.
09-27-2011 08:58 AM
Why do it during Install?
Run Set Permissions while you create the file - or run a vi that sets permissions after the install. Either way it is only a single call to 1 advanced file primitive
09-27-2011 09:02 AM
hi rickford66,
As i understand you want to set permissions to access a created file thats been created by labview? If this is the problem there is a 'Set Permissions' Function, informations which can be found here. Which allows you to specify user permissions to a file.
Please let me know if that is indeed the issue you are having. If you have any more questions please post back.
Regards,
09-27-2011 09:05 AM
If the user is the first to run the program, will the Set Permissions vi prompt the user for the administrator password, then do the job, or will it error until an administrator runs it first? The reason I wanted the installer to do it is that I wanted the users to be able to use the app, and not have to know anything about W7 file security.
09-27-2011 09:06 AM
Yes, the files are created in LabVIEW.
09-27-2011 09:25 AM
Hi rickford66,
I have found an old forum post that details and includes a vi that runs a windows command line VI which can set user permissions. I have read into the Set Permissions function and it seems as though this command line vi might be a better solution, as windows doesnt recognise the 'new owner' and 'new group' inputs of the Set Permissions function. The downside with this is that each time your application is run, you might see a brief pop up of the command line.
Regards,
09-27-2011 09:28 AM
Is there a way to read what the permissions are, and only try to set them if they need to be set?
09-27-2011 09:29 AM
haha, probably Get Permissions.
09-27-2011 09:34 AM
09-27-2011 09:57 AM
I didn't think that was the right place for it. Seems ProgramData is the right place based on everything I've read. There must be a way to do this. How about a key in the registry. I noticed that the LV installer allows registry keys.