Page 1 of 1
Set Access Control
Posted: Thu Jun 04, 2009 9:55 am
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
Posted: Thu Jun 18, 2009 2:12 pm
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
Posted: Thu Jun 18, 2009 5:12 pm
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.
CACLS
Posted: Fri Jun 19, 2009 7:44 am
by Tiago
Hi Michael,
Can I use Windows' CACLS.EXE to do that?
Thanks for the info!
Posted: Fri Jun 19, 2009 8:19 am
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.
Posted: Fri Jun 19, 2009 8:46 am
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.

Posted: Fri Jun 19, 2009 2:10 pm
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
Posted: Mon Jun 29, 2009 11:18 am
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.
