View Full Version : Setting Folder Permissions on Multiple OSes???

06-07-2004, 12:07 PM
I've searched around this site as well as the DevStudio 9 help without any success.

I have an installscript install that requires during install time a folder I create be set with permissions for W2k using the account ASPNET and W2k3 using the account NETWORK SERVICE.

As we know with the default settings if I create permissions on the folder for both ASPNET and NETWORK SERVICE the install will fail because NETWORK SERVICE does not exist on W2k and may fail on W2k3 when ASPNET is not created.

I therefore need to create a conditional based on the OS detected as to which account I need to set the folder permissions for. I do not see a function to do this via scripting and cannot do it from the File and Folders view due it the limitation of OS.

Any help would be appreciated. I would rather stay away from third party resource tools if I can help it.


06-08-2004, 04:18 PM
We are experiencing the same problem, aspnet or network services depending on OS - we also want to stay away from 3rd party resources.

Were you able to find a suitable solution?

Thanks for taking the time to read my post.

06-08-2004, 04:25 PM
Originally posted by Robisupside
We are experiencing the same problem, aspnet or network services depending on OS - we also want to stay away from 3rd party resources.

Were you able to find a suitable solution?

The only viable solution I have found as of yet is to use Microsoft's Resource Tool XCACLS.EXE (available here:
http://www.microsoft.com/windows2000/techinfo/reskit/tools/existing/xcacls-o.asp ) and will have to do until someone with a better solution comes along. I am frankly surprised that this hasn't been addressed in one way or another involving multiple OSes. Yet I seem to come up with all the unanswerable InstallShield questions as of late.

I am using XCACLS.exe by having it copied to the TempDir during install and then using InstallScript functions to let me know which OS (via SYSINFO) and then using LaunchAppAndWait to run the Read and Write Permissions. It works in both OSes although I am more than happy to hear about a better solution in the long run.

Good Luck!

06-08-2004, 04:31 PM
Thanks losingmymind!

We were looking at cacls.exe not xcacls, are you able to hide the dos boxes while using the utility? (that's the worst eh?, flashing dos prompts)...

One more thing if you don't mind - how is an 'upgrade' affected? The problem we currently have also is with permissions for public properties set through the lock permissions table, wherein if we retrieve user and pass info through a custom dialog and set public properties on the folders the permissions are set correctly initially - when we do an upgrade though the permissions are lost on the folders (seems like either IS or MS didn't consider the issue at all).

Anyway, best regards.


06-08-2004, 04:40 PM
I haven't heard complaints from the firework show (as I call it) of DOS boxes that fire out at the end of the install (due to all the non-supported functions I need to run for all the special customization regarding COM+ and GAC and now permissions. But it would be neat to spend time looking for a way to suppress these boxes.

With XCACLS you are allowed to edit the permission sets and not necessarily overwrite them. I am creating the folders with DevStudio9's File and Folder's View and _not_ via scripting. I haven't personally worked with an upgrade issue with different data since my data stays the same throughout for the permission table for this install, but I would imagine that if you do use XCACLS that you use the /E switch to make sure you are adding to the table and not overwriting it.

I hope that helps :)

06-08-2004, 04:46 PM
'Fireworks show' - LOL