Set Access Control

Got a problem you cannot solve? Try here.
Post Reply
SimonTemlett
Posts: 3
Joined: Wed May 06, 2009 5:01 am

Set Access Control

Post by SimonTemlett »

I have created a variable called $APPDATAFOLDER$ which gets the system application data folder location.

Code: Select all

Create Folder $APPDATAFOLDER$\\Simon
Grant Complete Access to File System Object "$APPDATAFOLDER$\\Simon"
The folder gets created successfully but when I look at its properties after the installation the folder still only has read permissions for users. How do I get the installer to change the permissions on this folder (and all it's descendants)?

Simon

Edit to add: Using InstallAware Version 9 and testing against Windows 7
Tiago
Posts: 129
Joined: Thu Jun 18, 2009 9:08 am

Post by Tiago »

I'm having the same problem here.

There is a hint that pops in the "Set Access Control" screen telling us that if a command grants permissions to a setup-created folder (e.g. %TARGETDIR%), then this command must be executed after the "Apply Install" command in order to work properly.
Well, as you can see in the attached project, I have already positioned the permission command in the end of my script, but it's still not working.

Am I doing something wrong?
Thanks in advance!

File Attached:

PC-Factory.zip
MichaelNesmith
Posts: 3452
Joined: Thu Dec 22, 2005 7:17 pm
Contact:

Post by MichaelNesmith »

If you are creating further subfolders and installing files into that folder, the way to go is to create the folder using Call DLL Function on CreateDirectoryA and then immediately after calling Set Access Control on that folder.

This way the folder is immediately created and when Windows Installer starts copying your files into it, file permissions etc. are properly inherited from the parent folder.
Michael Nesmith
Install[b]Aware[/b]
[i]Home of The Next Generation MSI Installer[/i]
Get your free copy today - http://www.installaware.com/
Tiago
Posts: 129
Joined: Thu Jun 18, 2009 9:08 am

CACLS

Post by Tiago »

Hi Michael,

Can I use Windows' CACLS.EXE to do that?

Thanks for the info!
DanStutzman
Posts: 85
Joined: Wed Jun 10, 2009 10:36 am
Location: Philadelphia, PA
Contact:

Post by DanStutzman »

Tiugo,

You can definatelly use 3rd party ACL'ing software (I use SubInACL myself). When you add the run command, you just have to make sure it runs after install. In fact I would manually enter the RUN Command into the MSICode directly after all of your files are installed and any runtime actions are executed.

Why may I ask, are you using a 3rd party when IA handles it very cleanly? You can also bypass this by setting elevated priveleges and setting Advertisement points to create/modify whatever section requires elevated privileges without compromising the folder permissions structure.
Tiago
Posts: 129
Joined: Thu Jun 18, 2009 9:08 am

Post by Tiago »

Hi Dan,

I used CACLS because, as you can see in the project I attached above, the IA didn't work for me. Something related to my project's action sequence I guess, but as far as I couldn't fully figure it out in proper time, I decided to use CACLS which is a tool I already know.

Of course, a pure IA code would be much better and I would be very glad to hear any suggestions from you.

Thanks in advance. :)
DanStutzman
Posts: 85
Joined: Wed Jun 10, 2009 10:36 am
Location: Philadelphia, PA
Contact:

Post by DanStutzman »

Tiago,

I will check it out this weekend. I am still new to IA myself but once I got through my head this isn't IS, its really just a piece of piss to work with.

Dan
Tiago
Posts: 129
Joined: Thu Jun 18, 2009 9:08 am

Post by Tiago »

Hi,

I have started a new project and now the permissions seems to be working fine. Don't know for sure what have I done wrong in my old project, but it was probably some issue related to Windows Installer commands and the Apply Install clause.

Thanks all for the attention, anyway.
:)
Post Reply