Skip to content

Commit 69b14f9

Browse files
Merge pull request #92 from root3nl/development
v2.4.2
2 parents 5b8c3ee + 0ca87e3 commit 69b14f9

18 files changed

Lines changed: 283 additions & 124 deletions

File tree

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3+
<plist version="1.0">
4+
<dict>
5+
<key>PayloadContent</key>
6+
<array>
7+
<dict>
8+
<key>PayloadDescription</key>
9+
<string></string>
10+
<key>PayloadDisplayName</key>
11+
<string>Background Item Management - Root3</string>
12+
<key>PayloadIdentifier</key>
13+
<string>com.apple.servicemanagement.8AE9DFC3-EC42-4A57-8D75-973B310C81D8</string>
14+
<key>PayloadOrganization</key>
15+
<string>Root3</string>
16+
<key>PayloadType</key>
17+
<string>com.apple.servicemanagement</string>
18+
<key>PayloadUUID</key>
19+
<string>8AE9DFC3-EC42-4A57-8D75-973B310C81D8</string>
20+
<key>Rules</key>
21+
<array>
22+
<dict>
23+
<key>Comment</key>
24+
<string>Root3</string>
25+
<key>RuleType</key>
26+
<string>TeamIdentifier</string>
27+
<key>RuleValue</key>
28+
<string>98LJ4XBGYK</string>
29+
</dict>
30+
</array>
31+
</dict>
32+
</array>
33+
<key>PayloadDisplayName</key>
34+
<string>Background Item Management - Root3</string>
35+
<key>PayloadIdentifier</key>
36+
<string>4D6C18CA-467B-440C-9844-A8FAF2042F97</string>
37+
<key>PayloadScope</key>
38+
<string>System</string>
39+
<key>PayloadType</key>
40+
<string>Configuration</string>
41+
<key>PayloadUUID</key>
42+
<string>0FB7270B-40C1-4557-9D0A-B3A498AF10AF</string>
43+
</dict>
44+
</plist>

Configuration Profile Sample/Support App Configuration Sample.mobileconfig renamed to Configuration Profile Samples/Support App Configuration Sample.mobileconfig

File renamed without changes.

Jamf Pro Custom Schema/Jamf Pro Custom Schema.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -207,11 +207,11 @@
207207
]
208208
},
209209
"OpenAtLogin": {
210-
"title": "Automatically open Support at login",
211-
"description": "Enabled by default. Launch Support automatically at login and keep it open (macOS 13 and higher). This setting is ignored if a legacy LaunchAgent is installed/active. Disable this if you don't want to open Support at login or use your own LaunchAgent",
210+
"title": "Automatically Support (non-PKG) at login",
211+
"description": "Disabled by default. Launch Support (non-PKG) automatically at login and keep it open (macOS 13 and higher). This setting is ignored if a legacy LaunchAgent is installed/active. Keep disabled if you don't want to open Support at login or use your own LaunchAgent",
212212
"type": "boolean",
213213
"options": {
214-
"enum_titles": ["Enabled (default)", "Disabled"],
214+
"enum_titles": ["Enabled", "Disabled (default)"],
215215
"infoText": "Key name: OpenAtLogin"
216216
},
217217
"links": [

README.md

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ Note: There may not always be a TestFlight version available.
9292
## Features
9393

9494
### Menu Bar Icon
95-
The Menu Bar Icon can be customized to your own PNG with Alpha Channel or using an SF Symbol. Any image will be shown as template to match the rest of the Menu Bar Extras. Optionally a notification badge can overlay the icon to attract the user's attention when an Apple Software Update is available or any other warning was triggered. Please check the preference key "StatusBarIconNotifierEnabled".
95+
The Menu Bar Icon can be customized to your own PNG with Alpha Channel or using an SF Symbol. Any image will be shown as template to match the rest of the Menu Bar Extras. Icons larger than 22 points will automatically be resized to the recommended 16 points. Optionally a notification badge can overlay the icon to attract the user's attention when an Apple Software Update is available or any other warning was triggered. Please check the preference key "StatusBarIconNotifierEnabled".
9696

9797
### Title and logo
9898
The row above the buttons allow a custom title and company logo. The title supports both text and Emoji. On macOS Monterey and higher, it supports Markdown as well. The logo supports several images types like PNG, JPEG and ICNS and will be resized to a maximum height of 48 points. The original aspect ratio will be retained. A PNG with alpha channel is advised to get variable transparency around your logo.
@@ -179,7 +179,7 @@ All general settings
179179
| Logo | String | App Icon | Path to the logo shown in the top right corner when the app opens. Scales to 48 points maximum height. A subfolder in `/Library/Application Support/` is the recommended location due to sandboxing | `/Library/Application Support/Your Company/logo.png` |
180180
| LogoDarkMode | String | App Icon | Path to the logo shown in the top right corner when the app opens for Dark Mode. Scales to 48 points maximum height. A subfolder in `/Library/Application Support/` is the recommended location due to sandboxing | `/Library/Application Support/Your Company/logo_darkmode.png` |
181181
| NotificationIcon | String | App Icon | Path to a custom square image to be shown in alerts and the about window. | `/Library/Application Support/Your Company/logo.png` |
182-
| StatusBarIcon | String | Root3 Logo | Path to the status bar icon shown in the menu bar. Recommended: PNG, 16x16 points. A subfolder in `/Library/Application Support/` is the recommended location due to sandboxing | `/Library/Application Support/Your Company/statusbaricon.png` |
182+
| StatusBarIcon | String | Root3 Logo | Path to the status bar icon shown in the menu bar. Recommended: PNG, 16x16 points. Icons larger than 22 points will automatically be resized to 16 points. A subfolder in `/Library/Application Support/` is the recommended location due to sandboxing | `/Library/Application Support/Your Company/statusbaricon.png` |
183183
| StatusBarIconSFSymbol | String | Root3 Logo | Custom status bar icon using an SF Symbol. Ignored when StatusBarIcon is also set | “lifepreserver” |
184184
| StatusBarIconNotifierEnabled | Boolean | false | Shows a small notification badge in the Status Bar Icon when an info items triggers a warning or notification | true |
185185
| CustomColor | String | macOS Accent Color | Custom color for all symbols. Leave empty to use macOS Accent Color. We recommend not to use a very light color as text may become hard to read | HEX color in RGB format like "#8cc63f" |
@@ -189,7 +189,7 @@ All general settings
189189
| ErrorMessage | String | Please contact IT support | Shown when clicking an action results in an error | "Please contact the servicedesk", "Please contact COMPANY_NAME" |
190190
| ShowWelcomeScreen | Boolean | false | Shows the welcome screen when the Support App is opened for the first time. | true |
191191
| FooterText | String | - | Text shown at the bottom as footnote | "Provided by your **IT department** with ❤️" |
192-
| OpenAtLogin | Boolean | true | Launch Support automatically at login and keep it open (macOS 13 and higher). This setting is ignored if a legacy LaunchAgent is installed/active. Disable this if you don't want to open Support at login or use your own LaunchAgent | false |
192+
| OpenAtLogin | Boolean | false | Launch Support (non-PKG) automatically at login and keep it open (macOS 13 and higher). This setting is ignored if a legacy LaunchAgent is installed/active. Keep disabled if you don't want to open Support at login or use your own LaunchAgent | false |
193193

194194
### Info items
195195
Configuration of the top four items with diagnostic information.
@@ -378,6 +378,9 @@ A sample LaunchAgent to always keep the app alive is provided [**here**](https:/
378378
### Sample Configuration Profile
379379
A sample Configuration Profile you can edit to your preferences is provided [**here**](https://github.com/root3nl/SupportApp/blob/master/Configuration%20Profile%20Sample/Support%20App%20Configuration%20Sample.mobileconfig)
380380

381+
#### Background Item Management
382+
A sample Configuration Profile is provided (both signed and unsigned) for macOS 13 and higher to avoid users from disabling the LaunchAgent in System Settings > General > Login Items. The profile uses the Root3 Team ID to only allow signed software from Root3. [**Samples**](https://github.com/root3nl/SupportApp/blob/master/Configuration%20Profile%20Samples/Background%20Item%20Management)
383+
381384
## Logging
382385
Logs can be viewed from Console or Terminal by filtering the subsystems `nl.root3.support` (Support App) and `nl.root3.support.helper` (SupportHelper).
383386

pkgbuild/build_pkg.zsh

Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
#!/bin/zsh
2+
3+
# Build Support App Package
4+
#
5+
#
6+
# Copyright 2022 Root3 B.V. All rights reserved.
7+
#
8+
# This script will build the Support App Package
9+
#
10+
# USAGE:
11+
# - Make sure an Keychain profile is stored for notarytool
12+
# - Export .app to pkguild folder
13+
# - Navigate to folder: pkgbuild/payload
14+
# - Run the script
15+
#
16+
# THE SOFTWARE IS PROVIDED BY ROOT3 B.V. "AS IS", WITHOUT WARRANTY OF ANY KIND,
17+
# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18+
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO
19+
# EVENT SHALL ROOT3 B.V. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
20+
# WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
21+
# IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22+
23+
# ------------------ edit the variables below this line ------------------
24+
25+
# Exit on error
26+
set -e
27+
28+
# App Name
29+
app_name="Support"
30+
31+
# App Bundle Identifier
32+
bundle_identifier="nl.root3.support"
33+
34+
# App Version
35+
version="2.4.2"
36+
37+
# Path to folder with payload
38+
payload="payload"
39+
40+
# Path to folder with scripts
41+
scripts="scripts"
42+
43+
# Path to Component plist
44+
component_plist="Support-component.plist"
45+
46+
# Install location
47+
install_location="/Applications"
48+
49+
# Developer ID Installer certificate from Keychain
50+
signing_identity="Developer ID Installer: Root3 B.V. (98LJ4XBGYK)"
51+
52+
# Name of the Keychain profile used for notarytool
53+
keychain_profile="Root3"
54+
55+
# --------------------- do not edit below this line ----------------------
56+
57+
# Get the username of the currently logged in user
58+
username=$(scutil <<< "show State:/Users/ConsoleUser" | awk '/Name :/ && ! /loginwindow/ { print $3 }')
59+
60+
# NFS Home Directory of user
61+
nfs_home_directory=$(dscl . read /Users/${username} NFSHomeDirectory | awk '{print $2}')
62+
63+
# Build, sign and export pkg to Downloads folder
64+
pkgbuild --component-plist "${component_plist}" \
65+
--root "${payload}" \
66+
--scripts "${scripts}" \
67+
--install-location "${install_location}" \
68+
--identifier "${bundle_identifier}" \
69+
--sign "${signing_identity}" \
70+
--version "${version}" \
71+
"${nfs_home_directory}/Downloads/${app_name} ${version}.pkg"
72+
73+
# Submit pkg to notarytool
74+
xcrun notarytool submit "${nfs_home_directory}/Downloads/${app_name} ${version}.pkg" \
75+
--keychain-profile "${keychain_profile}" \
76+
--wait
77+
78+
# Staple the notarization ticket to the pkg
79+
xcrun stapler staple "${nfs_home_directory}/Downloads/${app_name} ${version}.pkg"
80+
81+
# Check the notarization ticket validity
82+
spctl --assess -vv --type install "${nfs_home_directory}/Downloads/${app_name} ${version}.pkg"

pkgbuild/scripts/postinstall

Lines changed: 35 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,7 @@
55
#
66
# Copyright 2022 Root3 B.V. All rights reserved.
77
#
8-
# This script will create the Support App Legacy LaunchAgent and reload it when
9-
# needed on macOS 12 and below. On macOS 13 and higher, the script will open the
10-
# app to allow registration of the LaunchAgent using SMAppService.
8+
# This script will create the Support App LaunchAgent and reload it when needed.
119
#
1210
# THE SOFTWARE IS PROVIDED BY ROOT3 B.V. "AS IS", WITHOUT WARRANTY OF ANY KIND,
1311
# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
@@ -18,12 +16,6 @@
1816

1917
# ------------------ edit the variables below this line ------------------
2018

21-
# Load Requirements
22-
autoload is-at-least
23-
24-
# macOS Version
25-
os_version=$(sw_vers -productVersion)
26-
2719
# LaunchAgent label
2820
launch_agent="nl.root3.support"
2921

@@ -32,40 +24,50 @@ install_location="/Applications/Support.app"
3224

3325
# Get the username of the currently logged in user
3426
username=$(scutil <<< "show State:/Users/ConsoleUser" | awk '/Name :/ && ! /loginwindow/ { print $3 }')
35-
echo "Current logged in user: ${username}"
3627

3728
# Get the username ID
3829
uid=$(id -u "${username}")
3930

4031
# Remove "Downloaded from Internet" warning
4132
xattr -d -r com.apple.quarantine "${install_location}"
4233

43-
# Install Legacy LaunchAgent only on macOS 12 and below
34+
# Load Requirements
35+
autoload is-at-least
36+
37+
# macOS Version
38+
os_version=$(sw_vers -productVersion)
39+
40+
# Open the app so the legacy LaunchAgent properly displays the app name and icon
41+
# in System Settings > General > Login Items
42+
# Tested and does only work when a user is logged in during the installation
43+
# Thanks to @PicoMitchell:
44+
# https://github.com/freegeek-pdx/macOS-Testing-and-Deployment-Scripts/blob/main/fgMIB%20Resources/Prepare%20OS%20Package/fg-prepare-os.sh#L971-L983
4445
if is-at-least 13.0 ${os_version}; then
45-
if ! pgrep -x "Support"; then
46-
# Open Support App to start LaunchAgent registration using SMAppService
47-
open "${install_location}"
48-
else
49-
# Quit Support App in case it needs to reload after an update
50-
killall -9 "Support"
51-
fi
52-
else
53-
# Create the LaunchAgent
54-
defaults write "/Library/LaunchAgents/${launch_agent}.plist" Label -string "${launch_agent}"
55-
defaults write "/Library/LaunchAgents/${launch_agent}.plist" ProgramArguments -array -string "/Applications/Support.app/Contents/MacOS/Support"
56-
# Run every reboot
57-
defaults write "/Library/LaunchAgents/${launch_agent}.plist" KeepAlive -boolean yes
58-
# Set ProcessType to Interactive
59-
defaults write "/Library/LaunchAgents/${launch_agent}.plist" ProcessType -string "Interactive"
60-
# Set permissions
61-
chown root:wheel "/Library/LaunchAgents/${launch_agent}.plist"
62-
chmod 644 "/Library/LaunchAgents/${launch_agent}.plist"
46+
OSASCRIPT_ENV_APP_PATH="/Applications/Support.app" osascript -l 'JavaScript' -e 'ObjC.import("LaunchServices"); $.LSRegisterURL($.NSURL.fileURLWithPath($.NSProcessInfo.processInfo.environment.objectForKey("OSASCRIPT_ENV_APP_PATH")), true)' &> /dev/null
47+
launchctl asuser "${uid}" sudo -u "${username}" open -na "${install_location}"
6348
fi
6449

65-
# Reload Legacy LaunchAgent
66-
if [[ -n "${username}" ]] && [[ -f "/Library/LaunchAgents/${launch_agent}.plist" ]]; then
67-
# Unload the LauchAgent
68-
launchctl bootout gui/${uid} "/Library/LaunchAgents/${launch_agent}.plist" &> /dev/null
50+
# Add AssociatedBundleIdentifiers to show app name in Login Items on
51+
# macOS 13 and higher instead of developer name
52+
defaults write "/Library/LaunchAgents/${launch_agent}.plist" AssociatedBundleIdentifiers -array -string "nl.root3.support"
53+
# Set the Label and ProgramArguments
54+
defaults write "/Library/LaunchAgents/${launch_agent}.plist" Label -string "${launch_agent}"
55+
defaults write "/Library/LaunchAgents/${launch_agent}.plist" ProgramArguments -array -string "/Applications/Support.app/Contents/MacOS/Support"
56+
# Run every reboot
57+
defaults write "/Library/LaunchAgents/${launch_agent}.plist" KeepAlive -boolean yes
58+
# Set ProcessType to Interactive
59+
defaults write "/Library/LaunchAgents/${launch_agent}.plist" ProcessType -string "Interactive"
60+
# Set permissions
61+
chown root:wheel "/Library/LaunchAgents/${launch_agent}.plist"
62+
chmod 644 "/Library/LaunchAgents/${launch_agent}.plist"
63+
64+
# Reload the LaunchAgent
65+
if [[ -n "${username}" ]]; then
66+
67+
# Unload the LaunchAgent
68+
if launchctl print "gui/${uid}/${launch_agent}" &> /dev/null ; then
69+
launchctl bootout gui/${uid} "/Library/LaunchAgents/${launch_agent}.plist" &> /dev/null
70+
fi
6971

7072
# Just to be sure, kill Support App if still running
7173
if pgrep -x "Support" ; then

src/Support.xcodeproj/project.pbxproj

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
496C2FE1271477B800D51EE1 /* NotificationNames.swift in Sources */ = {isa = PBXBuildFile; fileRef = 496C2FE0271477B800D51EE1 /* NotificationNames.swift */; };
3333
496FE4D12651485E007746ED /* UserInfo.swift in Sources */ = {isa = PBXBuildFile; fileRef = 496FE4D02651485E007746ED /* UserInfo.swift */; };
3434
496FE4D326514C59007746ED /* PasswordSubview.swift in Sources */ = {isa = PBXBuildFile; fileRef = 496FE4D226514C59007746ED /* PasswordSubview.swift */; };
35+
4972476828DBB1AB007194F0 /* StatusItemBadgeView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4972476728DBB1AB007194F0 /* StatusItemBadgeView.swift */; };
3536
4976EB892653151A006EE097 /* ChangePassword.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4976EB882653151A006EE097 /* ChangePassword.swift */; };
3637
4976EB8B265317C6006EE097 /* AppView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4976EB8A265317C6006EE097 /* AppView.swift */; };
3738
49822CE324B4C3F100E8DE54 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 49822CE224B4C3F100E8DE54 /* AppDelegate.swift */; };
@@ -88,6 +89,7 @@
8889
496C2FE0271477B800D51EE1 /* NotificationNames.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NotificationNames.swift; sourceTree = "<group>"; };
8990
496FE4D02651485E007746ED /* UserInfo.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UserInfo.swift; sourceTree = "<group>"; };
9091
496FE4D226514C59007746ED /* PasswordSubview.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PasswordSubview.swift; sourceTree = "<group>"; };
92+
4972476728DBB1AB007194F0 /* StatusItemBadgeView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = StatusItemBadgeView.swift; sourceTree = "<group>"; };
9193
4976EB882653151A006EE097 /* ChangePassword.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ChangePassword.swift; sourceTree = "<group>"; };
9294
4976EB8A265317C6006EE097 /* AppView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppView.swift; sourceTree = "<group>"; };
9395
49822CDF24B4C3F100E8DE54 /* Support.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Support.app; sourceTree = BUILT_PRODUCTS_DIR; };
@@ -161,6 +163,7 @@
161163
495924F8265C535B00E083AC /* QuitButton.swift */,
162164
49871A6E287CC98500715C7C /* HeaderView.swift */,
163165
495F74EB28B39A9A00C20304 /* PopoverAlertView.swift */,
166+
4972476728DBB1AB007194F0 /* StatusItemBadgeView.swift */,
164167
);
165168
path = Views;
166169
sourceTree = "<group>";
@@ -358,6 +361,7 @@
358361
4976EB8B265317C6006EE097 /* AppView.swift in Sources */,
359362
49F6744E273F2DBC00C47403 /* ExtensionASubview.swift in Sources */,
360363
49871A6F287CC98500715C7C /* HeaderView.swift in Sources */,
364+
4972476828DBB1AB007194F0 /* StatusItemBadgeView.swift in Sources */,
361365
496FE4D12651485E007746ED /* UserInfo.swift in Sources */,
362366
4915290D259CCF7A00056B5F /* NotificationBadgeView.swift in Sources */,
363367
49857E9A24D4B58B009B6FBA /* ComputerInfo.swift in Sources */,
@@ -551,7 +555,7 @@
551555
"@executable_path/../Frameworks",
552556
);
553557
MACOSX_DEPLOYMENT_TARGET = 11.0;
554-
MARKETING_VERSION = 2.4.1;
558+
MARKETING_VERSION = 2.4.2;
555559
PRODUCT_BUNDLE_IDENTIFIER = nl.root3.support;
556560
PRODUCT_NAME = "$(TARGET_NAME)";
557561
PROVISIONING_PROFILE_SPECIFIER = "";
@@ -581,7 +585,7 @@
581585
"@executable_path/../Frameworks",
582586
);
583587
MACOSX_DEPLOYMENT_TARGET = 11.0;
584-
MARKETING_VERSION = 2.4.1;
588+
MARKETING_VERSION = 2.4.2;
585589
PRODUCT_BUNDLE_IDENTIFIER = nl.root3.support;
586590
PRODUCT_NAME = "$(TARGET_NAME)";
587591
PROVISIONING_PROFILE_SPECIFIER = "";

0 commit comments

Comments
 (0)