Results 1 to 3 of 3

Thread: ProgramData Permissions

  1. #1
    Join Date
    Jan 2002
    Location
    Windsor, CT 06095 USA
    Posts
    735

    ProgramData Permissions

    I have an application I am writing an install for and they want to store some system level settings in a file located in a sub-folder of ProgramData. The problem is they need to elevate in order to write to this file due to folder permissions in ProgramData. I know how to change folder and file permission via the install but my question is is it OK to change the permissions on a sub-folder of ProgramData so that regular users can write to it?
    Eric Siemiatkaska
    SS&C Technologies, Inc.

  2. #2
    Join Date
    Mar 2011
    Posts
    3
    Hi esiemiat,

    I have the same question/problem, as our application has shared configuration files, which have to be editable by different users.

    Quote Originally Posted by esiemiat View Post
    [...] I know how to change folder and file permission via the install but my question is it OK to change the permissions on a sub-folder of ProgramData so that regular users can write to it?
    How to you change permission to C:\ProgramData\MyCompany\MyApp, that all users can modify shared files? Do you use 'subinacl' or other technique?



    Thanks in advance,
    Tom

    Btw, there was a discussion on http://blogs.msdn.com/b/cjacks/archi...dex=2#comments about the intended file location. Maybe you can pull some information out...
    Last edited by Tom Anderson; 03-21-2011 at 07:25 AM.

  3. #3
    Join Date
    Aug 2007
    Posts
    17
    I spent a couple days researching this. We feel this is the appropriate place for our shared configuration files which need to be updated by individual users but not seen by users.

    We set the permissions on the folders using the Folder Tree View in InstallShield. Select the predefined folder, [CommonAppDataFolder], and add your folders. Right click on each folder, bring up the properties dialog, and select set permissions.

    Now your stuck right? No, hit the Insert key to add a user. Very intuitive eh? god I hate InstallShield. Anyway ...

    For us, we clear the [%USERDOMAIN] macro and input Everyone in the User column. IOW no domain. Set permissions as appropriate.

    We do create some folders and files dynamically, we use CACLS to set permissions on these. I use the following function to do the job:

    Code:
    function SetPermissionsOnDir(szPath)	
    	STRING szCmd;
    	STRING szCmdArgs;  
    begin
    
    	StrRemoveLastSlash(szPath);
    	
        szCmd = WINSYSDIR ^ "cmd.exe";
       	szCmdArgs = "/c cacls \"" + szPath + "\" /T /E /G Everyone:F";
       	   	       
        LaunchAppAndWait(szCmd, szCmdArgs, LAAW_OPTION_HIDDEN | LAAW_OPTION_WAIT);
        	    
    end;
    Last edited by seamusmc; 03-25-2011 at 11:25 AM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •