LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to give User write rights in ProgramData folder in W7

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.

 

0 Kudos
Message 1 of 15
(4,457 Views)

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


"Should be" isn't "Is" -Jay
0 Kudos
Message 2 of 15
(4,452 Views)

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,

Ben B.

Applications Engineer
National Instruments UK & Ireland

"I've looked into the reset button, the science is impossible!"
0 Kudos
Message 3 of 15
(4,449 Views)

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.

0 Kudos
Message 4 of 15
(4,446 Views)

Yes, the files are created in LabVIEW.

0 Kudos
Message 5 of 15
(4,445 Views)

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,

Ben B.

Applications Engineer
National Instruments UK & Ireland

"I've looked into the reset button, the science is impossible!"
0 Kudos
Message 6 of 15
(4,428 Views)

Is there a way to read what the permissions are, and only try to set them if they need to be set?

0 Kudos
Message 7 of 15
(4,425 Views)

haha, probably Get Permissions.

0 Kudos
Message 8 of 15
(4,424 Views)

Have you considered using the Public Documents folder (C:\Users\Public\Documents) instead? I believe this is writable to normal users (I can't check right now, I'm on XP)

Thoric (CLA, CLED, CTD and LabVIEW Champion)


0 Kudos
Message 9 of 15
(4,421 Views)

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.

0 Kudos
Message 10 of 15
(4,411 Views)