Skip to content

Commit

Permalink
Merge pull request #160 from root3nl/v2.5.2
Browse files Browse the repository at this point in the history
v2.5.2 bump and pkgbuild for SupportHelper
  • Loading branch information
jordywitteman authored Mar 14, 2024
2 parents e866b2a + ce61183 commit 78e7f3f
Show file tree
Hide file tree
Showing 10 changed files with 171 additions and 13 deletions.
8 changes: 4 additions & 4 deletions SupportHelper/SupportHelper.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -254,13 +254,13 @@
CODE_SIGN_IDENTITY = "Developer ID Application";
CODE_SIGN_STYLE = Manual;
CREATE_INFOPLIST_SECTION_IN_BINARY = YES;
CURRENT_PROJECT_VERSION = 5;
CURRENT_PROJECT_VERSION = 6;
DEVELOPMENT_TEAM = 98LJ4XBGYK;
ENABLE_APP_SANDBOX = NO;
ENABLE_HARDENED_RUNTIME = YES;
GENERATE_INFOPLIST_FILE = NO;
INFOPLIST_FILE = "$(PROJECT_DIR)/SupportHelper/Info.plist";
MARKETING_VERSION = 1.0;
MARKETING_VERSION = 1.0.1;
PRODUCT_BUNDLE_IDENTIFIER = nl.root3.support.helper;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
Expand All @@ -275,13 +275,13 @@
CODE_SIGN_IDENTITY = "Developer ID Application";
CODE_SIGN_STYLE = Manual;
CREATE_INFOPLIST_SECTION_IN_BINARY = YES;
CURRENT_PROJECT_VERSION = 5;
CURRENT_PROJECT_VERSION = 6;
DEVELOPMENT_TEAM = 98LJ4XBGYK;
ENABLE_APP_SANDBOX = NO;
ENABLE_HARDENED_RUNTIME = YES;
GENERATE_INFOPLIST_FILE = NO;
INFOPLIST_FILE = "$(PROJECT_DIR)/SupportHelper/Info.plist";
MARKETING_VERSION = 1.0;
MARKETING_VERSION = 1.0.1;
PRODUCT_BUNDLE_IDENTIFIER = nl.root3.support.helper;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
Expand Down
8 changes: 4 additions & 4 deletions SupportHelper/SupportHelper/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleShortVersionString</key>
<string>$(MARKETING_VERSION)</string>
<key>CFBundleName</key>
<string>$(PRODUCT_NAME)</string>
<key>CFBundleIdentifier</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleName</key>
<string>$(PRODUCT_NAME)</string>
<key>CFBundleShortVersionString</key>
<string>$(MARKETING_VERSION)</string>
</dict>
</plist>
16 changes: 16 additions & 0 deletions SupportHelper/pkgbuild/SupportHelper-component.plist
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>
111 changes: 111 additions & 0 deletions SupportHelper/pkgbuild/build_pkg.zsh
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"
21 changes: 21 additions & 0 deletions SupportHelper/pkgbuild/distribution.xml
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>
10 changes: 10 additions & 0 deletions SupportHelper/pkgbuild/requirements.plist
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.
4 changes: 2 additions & 2 deletions src/Support.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -569,7 +569,7 @@
"@executable_path/../Frameworks",
);
MACOSX_DEPLOYMENT_TARGET = 11.0;
MARKETING_VERSION = 2.5.1;
MARKETING_VERSION = 2.5.2;
PRODUCT_BUNDLE_IDENTIFIER = nl.root3.support;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
Expand Down Expand Up @@ -598,7 +598,7 @@
"@executable_path/../Frameworks",
);
MACOSX_DEPLOYMENT_TARGET = 11.0;
MARKETING_VERSION = 2.5.1;
MARKETING_VERSION = 2.5.2;
PRODUCT_BUNDLE_IDENTIFIER = nl.root3.support;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
Expand Down
4 changes: 2 additions & 2 deletions src/Support/Base.lproj/Main.storyboard
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.Cocoa.Storyboard.XIB" version="3.0" toolsVersion="21507" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES">
<document type="com.apple.InterfaceBuilder3.Cocoa.Storyboard.XIB" version="3.0" toolsVersion="22505" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES">
<dependencies>
<deployment identifier="macosx"/>
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="21507"/>
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="22505"/>
</dependencies>
<scenes>
<!--Application-->
Expand Down
2 changes: 1 addition & 1 deletion src/Support/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
<key>CFBundleShortVersionString</key>
<string>$(MARKETING_VERSION)</string>
<key>CFBundleVersion</key>
<string>1695998775</string>
<string>1710453751</string>
<key>LSApplicationCategoryType</key>
<string>public.app-category.utilities</string>
<key>LSMinimumSystemVersion</key>
Expand Down

0 comments on commit 78e7f3f

Please sign in to comment.