Our application installs by default to the /Applications folder on Mac OS X, but this only works for admin user accounts, on non-admin accounts I am seeing 'Error changing permissions to 040755' is their anyway for the BitRock installer to install to this folder with a non-admin account?

asked 05 Jul '13, 08:46

Ben's gravatar image

Ben
0888
accept rate: 0%


You need to raise your file access permissions to administrative level. I don't know of any way to this on a per-component or on a per-folder basis; we're using the <requireinstallationbyrootuser> project property.

link

answered 05 Jul '13, 09:02

Dirk%20Stegemann's gravatar image

Dirk Stegemann
681283244
accept rate: 31%

edited 05 Jul '13, 09:03

You can use a helper variable and define default value for the installation depending on if /Applications is writable on OS X. For example:

<setInstallerVariable> <name>default_installdir</name> <value>${platform_install_prefix}/${product_shortname}-${product_version}</value> </setInstallerVariable> <setInstallerVariable> <name>default_installdir</name> <value>${user_home_directory}/${product_shortname}-${product_version}</value> <ruleList> <platformTest> <type>osx</type> </platformTest> <fileTest> <condition>not_writable</condition> <path>${platform_install_prefix}</path> </fileTest> </ruleList> </setInstallerVariable>

You should add that to <initializationActionList> and <preShowHelpActionList>.

The installdir variable should also use ${default_installdir} as the <default> value:

<directoryParameter> <name>installdir</name> <description>Installer.Parameter.installdir.description</description> <explanation>Installer.Parameter.installdir.explanation</explanation> <value></value> <default>${default_installdir}</default> <allowEmptyValue>0</allowEmptyValue> <cliOptionName>prefix</cliOptionName> <mustBeWritable>1</mustBeWritable> <mustExist>0</mustExist> <width>40</width> </directoryParameter>

link

answered 05 Jul '13, 10:08

wojciechka's gravatar image

wojciechka ♦♦
7.8k61122
accept rate: 26%

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Tags:

×130
×22
×13
×7

Asked: 05 Jul '13, 08:46

Seen: 3,519 times

Last updated: 05 Jul '13, 10:08