We’re moving our forums to a new platform.

You can still browse and search existing topics, but you can no longer create new topics or post replies.

For questions, technical issues, or feature requests, please don’t hesitate to contact our support team at support@advancedinstaller.com.

Thank you for your understanding!

mheckmann
Posts: 74
Joined: Wed Apr 20, 2011 6:24 pm

setting permissions for files in synchronized folders

It's not clear to me how to set permissions for files in Synchronized Folders.

From what I understand, the installer will not copy the initial permissions that the files had before being packed into the package - or at least we tried setting permissions on the files for the group Users and this wouldn't translate to the installation.

Next step for me was to add a "LaunchFileOrURL" custom action and position it between AddResources and Finish Execution in the Install Execution Stage. The command for the custom action is:

Code: Select all

cmd /C icacls "[ProgramFilesFolder][Manufacturer]\[ProductShort]" /t /q /grant Users:(RX)
It seems that this command always fails, yet I'm not sure why. Also looking at the files after a installation (I disabled "Fail installation if custom action returns an error") i now see that actually the permissions are set for the Users Group yet now Administrators and the current User is missing from the list.

Are there detailed instructions explaining how to handle this?

thx
Markus
Daniel
Posts: 8283
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: setting permissions for files in synchronized folders

Hello Markus,

I'm not sure why this happens. Can you try to manually run the related command line and see if the behavior will be the expected one? Also, you can take a look on our "Filesystem permissions do not flow to sub folders" article which could be useful for you.

Also, you can add folder permissions from "Folder Properties -> Permissions" tab.

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
mheckmann
Posts: 74
Joined: Wed Apr 20, 2011 6:24 pm

Re: setting permissions for files in synchronized folders

running this with a log file I realized that

[ProgramFilesFolder]

is interpreted as C:\Program Files (x86) on a 64bit system - therefor it was failing when I tried installing into C:\Program Files.

Now when using APPDIR like this:

Code: Select all

cmd /C icacls "[APPDIR]" /t /q /grant Users:(RX)
there is a slash at the end of [APPDIR] which causes the icacls command to fail. Anyway around that slash?

thx
Markus
Daniel
Posts: 8283
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: setting permissions for files in synchronized folders

Hello Markus,

In order to achieve what you want you can take a look on our "Application path problem" thread which debates a similar issue.

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
mheckmann
Posts: 74
Joined: Wed Apr 20, 2011 6:24 pm

Re: setting permissions for files in synchronized folders

Thx Daniel, this works great.
Daniel
Posts: 8283
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: setting permissions for files in synchronized folders

You're welcome. Glad to help.

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Building Installers”