views:

1014

answers:

2

Hi,

I'm trying to install a set of files within the programdata folder using basic MSI installer. As the content of the files are dynamic and generated during the installation process, I'm creating the files in C# code during installation.

The files are created in the appropriate folders, and everything is good, except the files permissions. As I understand, files are supposed to inherit their permissions from the parent folder (if enabled), but in this case, this does not happen. The files I create should be writable for regular users, and i do not wan't to set permissions explicitly for each file created. Could the problem be that the installer runs with different permissions, and therefore the files does not inherit the permissions from their parent folders?

Thanks in advance for any help.

A: 

the installer runs with administrator access, which would allow it to change anything in program files.

A normal user would have read only access to the program files folder. Visual Studio's setup projects does not support MSI's lock permission table, so if you need the folder you created to be writable to normal users in a setup project you need to grant the right in a custom action using SetNamedSecurityInfo. You can also find a MSI authoring software that can deal with MSI's lock permission table.

Sheng Jiang 蒋晟
It's about the ProgramData folder (Vista), a normal user should have read/write access there.
Henk Holterman
A: 

If you set the folder permissions manually with a Custom Action and generate and install the files with another Custom Action then the issue could be caused by the order of execution.

Ishmael