Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

MSI Installer file/folder permissions

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.

like image 963
Kenneth Avatar asked Oct 26 '09 09:10

Kenneth


People also ask

How do I change my MSI installation directory?

When ThinApp installs the MSI package for individual users, the default MSI installation directory is %AppData%\<inventory_name> (VMware ThinApp). You can override the default installation directory by using an INSTALLDIR property in the msiexec command.


1 Answers

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 and the ProgramData/Common Application Data folder.

MSI's lock permission table allows a setup program to change a folder's permission after creating in ProgramData/Common Application Data. 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 or modify the MSI database as a post build step. You can also find a MSI authoring software that can deal with MSI's lock permission table.

like image 200
Sheng Jiang 蒋晟 Avatar answered Oct 03 '22 21:10

Sheng Jiang 蒋晟