Re: Using result of external script
Re: Using result of external script
- Subject: Re: Using result of external script
- From: Andrew Keller <email@hidden>
- Date: Mon, 06 Jan 2014 16:59:11 -0500
On Jan 6, 2014, at 3:21 PM, Conor Schutzman wrote:
> I am installing a custom X11 application. As part of that installation, I want to check if the latest version of XQuartz is present, and if not, install it.
>
> Using Packages, I imported the XQuartz package, and set it as a custom install choice. I then added a requirements entry for that package, using the “Result of External Script” option. I set the options to look for a return value “equal to” 0, and if that requirement is not met, to “make this choice unelectable” and add a tooltip.
>
> Below is my script, the XQuartz package in the custom install screen is selected and available in all cases, I was hoping someone could help me determine why this isn’t working.
>
> <script>
> #!/usr/bin/env bash
>
> # Package Title: Safeword SofToken II 2.2.0
> # Author: Conor Schutzman <email@hidden>
>
> if [[ -e /Applications/Utilities/XQuartz.app ]]; then
> XQuartzVersion=$(defaults read "/Applications/Utilities/XQuartz.app/Contents/Info.plist" CFBundleShortVersionString)
> if [[ "$XQuartzVersion" = "2.7.5" ]]; then
> exit 1
> else
> exit 0
> fi
> fi
> exit 0
> </script>
I don't fully understand what that script is checking for or what is going wrong, but there is one detail that jumps out to me. According to the man page for `defaults`, if you wish to read an arbitrary file, you specify the full path, without the '.plist' extension. However, in the above code, the '.plist' extension is included.
Hope that helps,
- Andrew Keller
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Installer-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden