Folder permission question

7 messages Options
Embed this post
Permalink
Balu Swaminathan

Folder permission question

Reply Threaded More More options
Print post
Permalink

Hello All:

 

Is it possible to author a wix file which can grant permission to a folder (not created by the installer, as in my case, c:\windows\temp - custom asp.net app pool a/c scenario) to a given account ?

 

I tried using <CreateFolder> with <Permission> but it nuked the existing folder and created a new one. - Not good.

I saw a few people asking this question, but could not find an answer.

 

I guess a managed custom action will solve the problem, but just trying not to create one.

 

Thanks for your input on this.

 

Regards:

 

balu.
     
_________________________________________________________________
Windows 7: It helps you do more. Explore Windows 7.
http://www.microsoft.com/Windows/windows-7/default.aspx?ocid=PID24727::T:WLMTAGL:ON:WL:en-US:WWL_WIN_evergreen3: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
[hidden email]
https://lists.sourceforge.net/lists/listinfo/wix-users
Rob Mensching-7

Re: Folder permission question

Reply Threaded More More options
Print post
Permalink
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 <[hidden email]>wrote:

>
> Hello All:
>
>
>
> Is it possible to author a wix file which can grant permission to a folder
> (not created by the installer, as in my case, c:\windows\temp - custom
> asp.net app pool a/c scenario) to a given account ?
>
>
>
> I tried using <CreateFolder> with <Permission> but it nuked the existing
> folder and created a new one. - Not good.
>
> I saw a few people asking this question, but could not find an answer.
>
>
>
> I guess a managed custom action will solve the problem, but just trying not
> to create one.
>
>
>
> Thanks for your input on this.
>
>
>
> Regards:
>
>
>
> balu.
>
> _________________________________________________________________
> Windows 7: It helps you do more. Explore Windows 7.
>
> http://www.microsoft.com/Windows/windows-7/default.aspx?ocid=PID24727::T:WLMTAGL:ON:WL:en-US:WWL_WIN_evergreen3: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
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/wix-users
>
>


--
virtually, Rob Mensching - http://RobMensching.com LLC
------------------------------------------------------------------------------
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
[hidden email]
https://lists.sourceforge.net/lists/listinfo/wix-users
Benjamin Podszun-2

Re: Folder permission question

Reply Threaded More More options
Print post
Permalink
In other words,  PermissionEx should work, imho.

On Oct 25, 2009 7:17 AM, "Rob Mensching" <[hidden email]> 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 <[hidden email]
>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

------------------------------------------------------------------------------
Come build with us! T...
------------------------------------------------------------------------------
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
[hidden email]
https://lists.sourceforge.net/lists/listinfo/wix-users
Balu Swaminathan

Re: Folder permission question

Reply Threaded More More options
Print post
Permalink

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: [hidden email]
> To: [hidden email]
> Subject: Re: [WiX-users] Folder permission question
>
> In other words, PermissionEx should work, imho.
>
> On Oct 25, 2009 7:17 AM, "Rob Mensching" <[hidden email]> 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 <[hidden email]
> >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
>
> ------------------------------------------------------------------------------
> Come build with us! T...
> ------------------------------------------------------------------------------
> 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
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/wix-users
     
_________________________________________________________________
New Windows 7: Find the right PC for you. Learn more.
http://www.microsoft.com/windows/pc-scout/default.aspx?CBID=wl&ocid=PID24727::T:WLMTAGL:ON:WL:en-US:WWL_WIN_pcscout: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
[hidden email]
https://lists.sourceforge.net/lists/listinfo/wix-users
Balu Swaminathan

Re: Folder permission question - Solved

Reply Threaded More More options
Print post
Permalink

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: [hidden email]
> To: [hidden email]
> 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: [hidden email]
> > To: [hidden email]
> > Subject: Re: [WiX-users] Folder permission question
> >
> > In other words, PermissionEx should work, imho.
> >
> > On Oct 25, 2009 7:17 AM, "Rob Mensching" <[hidden email]> 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 <[hidden email]
> > >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
[hidden email]
https://lists.sourceforge.net/lists/listinfo/wix-users
Blair-2

Re: Folder permission question - Solved

Reply Threaded More More options
Print post
Permalink
Directory paths in Windows Installer always end in "\". If they don't,
please change them until they do.

BTW, in MSBuild they usually also always end in "\" as well.

-----Original Message-----
From: Balu Swaminathan [mailto:[hidden email]]
Sent: Tuesday, October 27, 2009 11:20 AM
To: wix user list
Subject: Re: [WiX-users] Folder permission question - Solved


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: [hidden email]
> To: [hidden email]
> 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: [hidden email]
> > To: [hidden email]
> > Subject: Re: [WiX-users] Folder permission question
> >
> > In other words, PermissionEx should work, imho.
> >
> > On Oct 25, 2009 7:17 AM, "Rob Mensching" <[hidden email]> 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 <[hidden email]
> > >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:WLM
TAGL: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
[hidden email]
https://lists.sourceforge.net/lists/listinfo/wix-users


------------------------------------------------------------------------------
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
[hidden email]
https://lists.sourceforge.net/lists/listinfo/wix-users
Rob Mensching-7

Re: Folder permission question - Solved

Reply Threaded More More options
Print post
Permalink
In reply to this post by Balu Swaminathan
Did PermissionEx not work?

On Tue, Oct 27, 2009 at 11:20 AM, Balu Swaminathan <[hidden email]>wrote:

>
> 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: [hidden email]
> > To: [hidden email]
> > 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: [hidden email]
> > > To: [hidden email]
> > > Subject: Re: [WiX-users] Folder permission question
> > >
> > > In other words, PermissionEx should work, imho.
> > >
> > > On Oct 25, 2009 7:17 AM, "Rob Mensching" <[hidden email]> 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 <[hidden email]
> > > >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
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/wix-users
>
>


--
virtually, Rob Mensching - http://RobMensching.com LLC
------------------------------------------------------------------------------
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
[hidden email]
https://lists.sourceforge.net/lists/listinfo/wix-users