For future reference, for folks like me.

 

Scenario: We want to have a custom app pool run under our service account (no 
network service). Of course, we use the xml serializer and it writes to 
windows\temp. 

We need to grant permission to our service account to windows\temp.

 

Problem: Existing permissions (administrators, system, network service, users, 
etc) on windows\temp was getting nuked we I tried to grant permission to my 
account. It worked fine for any other folder (which is odd). <Bad> I referenced 
the [WindowsFolder]\Temp </Bad>. The directory went to the installer as 
c:\windows\\temp. For some reason that nuked the existing permissions

 

Solution: Remove the \. Now it reads [WindowsFolder]Temp. That works like a 
charm.

 

Relevant portions of the code:

 

<!-- Do not put \ after [WindowsFolder]. It already has one.-->

<SetProperty Id='WINDOWSTEMP' Before='CostFinalize' Value='[WindowsFolder]Temp' 
Sequence='execute'/>

 

<Directory Id="WINDOWSTEMP">
        <Component Id="C_PermissionWindowsTemp"  NeverOverwrite="yes" 
Guid="AF54F94F-MyGuid-Here">
          <CreateFolder>
            <Permission GenericAll="yes" User="Administrators" />
            <Permission GenericRead="yes" GenericExecute="yes" 
User="Authenticated Users" />
            <Permission GenericAll="yes" User="SpecialAccountHere"/>
          </CreateFolder>
        </Component>
        </Directory>

 

I actually had the same problem when I tried to provide permissions with 
icacls.exe. Installer logged to the event log and i fixed it there and then 
tried this one. Worked. !!!


 
> From: bswa...@hotmail.com
> To: wix-users@lists.sourceforge.net
> Date: Tue, 27 Oct 2009 06:05:32 +0000
> Subject: Re: [WiX-users] Folder permission question
> 
> 
> Thanks Benjamin and Rob:
> 
> 
> 
> I did try that. I had an odd behavior. If I tried CreateFolder for 
> windows\temp, all existing permissions were lost (meaning administrators, etc 
> were removed from folder permissions). 
> 
> If I tried for some other folder, it worked as expected. Basically adds the 
> permissions. 
> 
> 
> I am more inclined to use icacls.exe and set the permission.
> 
> 
> 
> Thanks for the replies though.
> 
> 
> 
> Original questions was about permissioning c:\windows\temp.
> 
> 
> > Date: Sun, 25 Oct 2009 15:48:01 +0200
> > From: benjamin.pods...@gmail.com
> > To: wix-users@lists.sourceforge.net
> > Subject: Re: [WiX-users] Folder permission question
> > 
> > In other words, PermissionEx should work, imho.
> > 
> > On Oct 25, 2009 7:17 AM, "Rob Mensching" <r...@robmensching.com> wrote:
> > 
> > CreateFolder does not delete folders. I do believe that Permission element
> > will explictily set the ACLs on the directory though.
> > 
> > On Sat, Oct 24, 2009 at 5:00 PM, Balu Swaminathan <bswa...@hotmail.com
> > >wrote:
> > 
> > > > Hello All: > > > > Is it possible to author a wix file which can grant
> > permission to a folder >...
> > --
> > virtually, Rob Mensching - http://RobMensching.com LLC
> >                                       
_________________________________________________________________
Windows 7: It works the way you want. Learn more.
http://www.microsoft.com/Windows/windows-7/default.aspx?ocid=PID24727::T:WLMTAGL:ON:WL:en-US:WWL_WIN_evergreen2:102009
------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
WiX-users mailing list
WiX-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users

Reply via email to