Skip to content

Commit

Permalink
Install preference pane along with Beats
Browse files Browse the repository at this point in the history
The installer package includes the Beats preference pane and installs it
along with the Beat.
  • Loading branch information
adriansr committed Jun 19, 2018
1 parent 162ecbe commit 3951924
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
10 changes: 7 additions & 3 deletions dev-tools/packer/platforms/darwin/pkg/build.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/bash

BASEDIR=$(cd "$(dirname "$0")"; pwd)
ARCHDIR=${BASEDIR}/../../../
PACKERDIR=${BASEDIR}/../../../

die() {
echo "Error: $@" >&2
Expand All @@ -11,7 +11,7 @@ die() {
test "$(uname -s)" = Darwin || die "Must be run in macOS"

FAIL=0
for bin in gotpl markdown pkgbuild productbuild hdiutil codesign
for bin in gotpl markdown pkgbuild productbuild hdiutil codesign xcodebuild
do
which -s "$bin" || {
echo "Required command '$bin' not found in PATH" >&2
Expand Down Expand Up @@ -39,7 +39,7 @@ test -n "SIGN_IDENTITY_APP" || die "Codesigning certificate not found"
export SIGN_IDENTITY_INSTALLER SIGN_IDENTITY_APP

test -f "${BUILD_DIR}/package.yml" || die "package.yml not found in BUILD_DIR"
ARCH_FILE="${ARCHDIR}/archs/$ARCH.yml"
ARCH_FILE="${PACKERDIR}/archs/$ARCH.yml"
test -f "$ARCH_FILE" || die "$ARCH_FILE not found (check ARCH environment variable)"

TMPDIR=$(mktemp -d)
Expand All @@ -54,6 +54,10 @@ else
echo 'snapshot: ""' >> "${TMPDIR}/conf.yml"
fi

echo 'Building preference-pane'
make -e CODE_SIGNING_REQUIRED=YES -C "${PACKERDIR}/platforms/darwin/preference-pane" clean build pkg || die "Build of preference-pane failed"
cp -a "${PACKERDIR}/platforms/darwin/preference-pane/BeatsPrefPane.pkg" "${TMPDIR}/" || die "Preference pane package not found"

pushd "${BASEDIR}/templates"
for dir in $(find . -type d); do
mkdir -p "$TMPDIR/$dir" || FAIL=1
Expand Down
1 change: 1 addition & 0 deletions dev-tools/packer/platforms/darwin/pkg/internal_build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ cp "$BEAT_DIR/LICENSE.txt" LICENSE.txt

productbuild --distribution distribution.plist \
--resources . \
--package-path "BeatsPrefPane.pkg" \
--package-path "$INNER_NAME" \
--component-compression auto \
--sign "$SIGN_IDENTITY_INSTALLER" \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,11 @@
<choice id="default"/>
<choice id="{{.identifier_base}}.{{.beat_name}}" visible="false">
<pkg-ref id="{{.identifier_base}}.{{.beat_name}}"/>
<pkg-ref id="{{.identifier_base}}.preference-pane"/>
</choice>
<pkg-ref id="{{.identifier_base}}.{{.beat_name}}" version="{{.version}}{{.snapshot}}" auth="Root" onConclusion="none">internal-{{.beat_name}}-{{.version}}{{.snapshot}}-{{.osx_arch}}.pkg</pkg-ref>
<!-- <welcome file="LICENSE.txt" mime-type="text/plain" auto="yes"/> -->
<readme file="README.html" />
<license file="LICENSE.txt" />
<title>{{.beat_name}} {{.version}}{{.snapshot}}</title>
<pkg-ref id="{{.identifier_base}}.preference-pane" version="{{.version}}{{.snapshot}}" auth="Root" onConclusion="none">BeatsPrefPane.pkg</pkg-ref>
</installer-gui-script>

0 comments on commit 3951924

Please sign in to comment.