Install to /Applications folder on Mac OS X with non-admin account

Comments

2 comments

  • Avatar
    Dirk Stegemann

    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.

  • Avatar
    wojciechka

    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>

Please sign in to leave a comment.