-
Notifications
You must be signed in to change notification settings - Fork 66
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #160 from root3nl/v2.5.2
v2.5.2 bump and pkgbuild for SupportHelper
- Loading branch information
Showing
10 changed files
with
171 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | ||
<plist version="1.0"> | ||
<array> | ||
<dict> | ||
<key>BundleHasStrictIdentifier</key> | ||
<true/> | ||
<key>BundleIsRelocatable</key> | ||
<false/> | ||
<key>BundleIsVersionChecked</key> | ||
<true/> | ||
<key>BundleOverwriteAction</key> | ||
<string>upgrade</string> | ||
</dict> | ||
</array> | ||
</plist> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,111 @@ | ||
#!/bin/zsh | ||
|
||
# Build SupportHelper Package | ||
# | ||
# | ||
# Copyright 2024 Root3 B.V. All rights reserved. | ||
# | ||
# This script will build the SupportHelper Package | ||
# | ||
# USAGE: | ||
# - Make sure an Keychain profile is stored for notarytool | ||
# - Export SupportHelper binary to pkguild folder | ||
# - Navigate to folder: pkgbuild/payload | ||
# - Run the script: /build_pkg.zsh TARGET_VERSION_HERE | ||
# | ||
# THE SOFTWARE IS PROVIDED BY ROOT3 B.V. "AS IS", WITHOUT WARRANTY OF ANY KIND, | ||
# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | ||
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO | ||
# EVENT SHALL ROOT3 B.V. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, | ||
# WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR | ||
# IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. | ||
|
||
# ------------------ edit the variables below this line ------------------ | ||
|
||
# Exit on error | ||
set -e | ||
|
||
# App Name | ||
app_name="SupportHelper" | ||
|
||
# App Bundle Identifier | ||
bundle_identifier="nl.root3.support.helper" | ||
|
||
# App Version | ||
version=$1 | ||
|
||
# Path to folder with payload | ||
payload="payload" | ||
|
||
# Path to folder with scripts | ||
scripts="scripts" | ||
|
||
# Path to Component plist | ||
component_plist="SupportHelper-component.plist" | ||
|
||
# Requirements plist | ||
requirements_plist="requirements.plist" | ||
|
||
# Distribution xml | ||
distribution_xml="distribution.xml" | ||
|
||
# Install location | ||
install_location="/usr/local/bin" | ||
|
||
# Developer ID Installer certificate from Keychain | ||
signing_identity="Developer ID Installer: Root3 B.V. (98LJ4XBGYK)" | ||
|
||
# Name of the Keychain profile used for notarytool | ||
keychain_profile="Root3" | ||
|
||
# --------------------- do not edit below this line ---------------------- | ||
|
||
# Exit when nu version is specified | ||
if [[ -z ${version} ]]; then | ||
echo "No version specified, add version as argument when running this script" | ||
exit 1 | ||
fi | ||
|
||
# Get the username of the currently logged in user | ||
username=$(scutil <<< "show State:/Users/ConsoleUser" | awk '/Name :/ && ! /loginwindow/ { print $3 }') | ||
|
||
# NFS Home Directory of user | ||
nfs_home_directory=$(dscl . read /Users/${username} NFSHomeDirectory | awk '{print $2}') | ||
|
||
# Create directory | ||
mkdir -p "${nfs_home_directory}/Downloads/${app_name}_${version}" | ||
|
||
# Build and export pkg to Downloads folder | ||
pkgbuild --root "${payload}" \ | ||
--scripts "${scripts}" \ | ||
--install-location "${install_location}" \ | ||
--identifier "${bundle_identifier}" \ | ||
--version "${version}" \ | ||
"${nfs_home_directory}/Downloads/${app_name}_${version}/${app_name}_component.pkg" | ||
|
||
# Create basic Distribution file | ||
# productbuild --synthesize \ | ||
# --package "${nfs_home_directory}/Downloads/${app_name}_${version}/Support_component.pkg" \ | ||
# --product "${requirements_plist}" \ | ||
# "${nfs_home_directory}/Downloads/${app_name}_${version}/distribution.xml" | ||
|
||
# Create distribution package to support InstallApplication MDM command | ||
productbuild --distribution "${distribution_xml}" \ | ||
--package-path "${nfs_home_directory}/Downloads/${app_name}_${version}/" \ | ||
"${nfs_home_directory}/Downloads/${app_name}_${version}/${app_name} ${version}_dist.pkg" | ||
|
||
# Sign package | ||
productsign --sign "${signing_identity}" \ | ||
"${nfs_home_directory}/Downloads/${app_name}_${version}/${app_name} ${version}_dist.pkg" \ | ||
"${nfs_home_directory}/Downloads/${app_name}_${version}/${app_name} ${version}.pkg" | ||
|
||
# Submit pkg to notarytool | ||
xcrun notarytool submit "${nfs_home_directory}/Downloads/${app_name}_${version}/${app_name} ${version}.pkg" \ | ||
--keychain-profile "${keychain_profile}" \ | ||
--wait | ||
|
||
# Staple the notarization ticket to the pkg | ||
xcrun stapler staple "${nfs_home_directory}/Downloads/${app_name}_${version}/${app_name} ${version}.pkg" | ||
|
||
# Check the notarization ticket validity | ||
spctl --assess -vv --type install "${nfs_home_directory}/Downloads/${app_name}_${version}/${app_name} ${version}.pkg" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<installer-gui-script minSpecVersion="2"> | ||
<title>SupportHelper</title> | ||
<pkg-ref id="nl.root3.support.helper"/> | ||
<options customize="never" require-scripts="false" hostArchitectures="x86_64,arm64"/> | ||
<volume-check> | ||
<allowed-os-versions> | ||
<os-version min="11"/> | ||
</allowed-os-versions> | ||
</volume-check> | ||
<choices-outline> | ||
<line choice="default"> | ||
<line choice="nl.root3.support.helper"/> | ||
</line> | ||
</choices-outline> | ||
<choice id="default"/> | ||
<choice id="nl.root3.support.helper" visible="false"> | ||
<pkg-ref id="nl.root3.support.helper"/> | ||
</choice> | ||
<pkg-ref id="nl.root3.support.helper" version="%SUPPORTHELPER_VERSION%" onConclusion="none">SupportHelper_component.pkg</pkg-ref> | ||
</installer-gui-script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | ||
<plist version="1.0"> | ||
<dict> | ||
<key>os</key> | ||
<array> | ||
<string>11</string> | ||
</array> | ||
</dict> | ||
</plist> |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters