Skip to content

Commit 5b8c3ee

Browse files
Merge pull request #85 from root3nl/development
v2.4.1
2 parents 22d85f5 + bfd307c commit 5b8c3ee

20 files changed

Lines changed: 499 additions & 170 deletions

Jamf Pro Custom Schema/Jamf Pro Custom Schema.json

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -206,6 +206,21 @@
206206
}
207207
]
208208
},
209+
"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",
212+
"type": "boolean",
213+
"options": {
214+
"enum_titles": ["Enabled (default)", "Disabled"],
215+
"infoText": "Key name: OpenAtLogin"
216+
},
217+
"links": [
218+
{
219+
"rel": "Documentation",
220+
"href": "https://github.com/root3nl/SupportApp"
221+
}
222+
]
223+
},
209224
"InfoItemOne": {
210225
"title": "Info item 1st tile",
211226
"description": "Info item shown in the upper left corner",

LaunchAgent Sample/nl.root3.support.plist

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@
44
<dict>
55
<key>Label</key>
66
<string>nl.root3.support</string>
7-
<key>ProgramArguments</key>
8-
<array>
9-
<string>/Applications/Support.app/Contents/MacOS/Support</string>
10-
</array>
7+
<key>Program</key>
8+
<string>/Applications/Support.app/Contents/MacOS/Support</string>
119
<key>KeepAlive</key>
1210
<true/>
1311
<key>ProcessType</key>
1412
<string>Interactive</string>
13+
<key>AssociatedBundleIdentifiers</key>
14+
<string>nl.root3.support</string>
1515
</dict>
1616
</plist>

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -189,6 +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 |
192193

193194
### Info items
194195
Configuration of the top four items with diagnostic information.

pkgbuild/scripts/postinstall

Lines changed: 51 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,33 @@
33
# Install Support App LaunchAgent
44
#
55
#
6-
# Copyright 2021 Root3 B.V. All rights reserved.
6+
# Copyright 2022 Root3 B.V. All rights reserved.
77
#
8-
# This script will create the Support App LaunchAgent and reload it when needed.
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.
11+
#
12+
# THE SOFTWARE IS PROVIDED BY ROOT3 B.V. "AS IS", WITHOUT WARRANTY OF ANY KIND,
13+
# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
14+
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO
15+
# EVENT SHALL ROOT3 B.V. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
16+
# WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
17+
# IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
18+
19+
# ------------------ edit the variables below this line ------------------
20+
21+
# Load Requirements
22+
autoload is-at-least
23+
24+
# macOS Version
25+
os_version=$(sw_vers -productVersion)
926

1027
# LaunchAgent label
1128
launch_agent="nl.root3.support"
1229

30+
# Install location
31+
install_location="/Applications/Support.app"
32+
1333
# Get the username of the currently logged in user
1434
username=$(scutil <<< "show State:/Users/ConsoleUser" | awk '/Name :/ && ! /loginwindow/ { print $3 }')
1535
echo "Current logged in user: ${username}"
@@ -18,29 +38,40 @@ echo "Current logged in user: ${username}"
1838
uid=$(id -u "${username}")
1939

2040
# Remove "Downloaded from Internet" warning
21-
xattr -d -r com.apple.quarantine "/Applications/Support.app"
22-
23-
# Create the LaunchAgent
24-
defaults write "/Library/LaunchAgents/${launch_agent}.plist" Label -string "${launch_agent}"
25-
defaults write "/Library/LaunchAgents/${launch_agent}.plist" ProgramArguments -array -string "/Applications/Support.app/Contents/MacOS/Support"
26-
# Run every reboot
27-
defaults write "/Library/LaunchAgents/${launch_agent}.plist" KeepAlive -boolean yes
28-
# Set ProcessType to Interactive
29-
defaults write "/Library/LaunchAgents/${launch_agent}.plist" ProcessType -string "Interactive"
30-
# Set permissions
31-
chown root:wheel "/Library/LaunchAgents/${launch_agent}.plist"
32-
chmod 644 "/Library/LaunchAgents/${launch_agent}.plist"
33-
34-
# Reload the LaunchAgent
35-
if [[ -n "${username}" ]]; then
41+
xattr -d -r com.apple.quarantine "${install_location}"
42+
43+
# Install Legacy LaunchAgent only on macOS 12 and below
44+
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"
63+
fi
64+
65+
# Reload Legacy LaunchAgent
66+
if [[ -n "${username}" ]] && [[ -f "/Library/LaunchAgents/${launch_agent}.plist" ]]; then
3667
# Unload the LauchAgent
37-
launchctl bootout gui/${uid} "/Library/LaunchAgents/${launch_agent}.plist" &> /dev/null
68+
launchctl bootout gui/${uid} "/Library/LaunchAgents/${launch_agent}.plist" &> /dev/null
3869

3970
# Just to be sure, kill Support App if still running
4071
if pgrep -x "Support" ; then
4172
killall -9 "Support"
4273
fi
4374

4475
# Load the LaunchAgent
45-
launchctl bootstrap gui/${uid} "/Library/LaunchAgents/${launch_agent}.plist"
46-
fi
76+
launchctl bootstrap gui/${uid} "/Library/LaunchAgents/${launch_agent}.plist"
77+
fi

src/Support.xcodeproj/project.pbxproj

Lines changed: 31 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
archiveVersion = 1;
44
classes = {
55
};
6-
objectVersion = 50;
6+
objectVersion = 54;
77
objects = {
88

99
/* Begin PBXBuildFile section */
@@ -28,6 +28,7 @@
2828
4915291C259CD38800056B5F /* EffectsView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4915291B259CD38800056B5F /* EffectsView.swift */; };
2929
493FBB8D27406B5D002A79F9 /* ExtensionBSubview.swift in Sources */ = {isa = PBXBuildFile; fileRef = 493FBB8C27406B5D002A79F9 /* ExtensionBSubview.swift */; };
3030
495924F9265C535B00E083AC /* QuitButton.swift in Sources */ = {isa = PBXBuildFile; fileRef = 495924F8265C535B00E083AC /* QuitButton.swift */; };
31+
495F74EC28B39A9A00C20304 /* PopoverAlertView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 495F74EB28B39A9A00C20304 /* PopoverAlertView.swift */; };
3132
496C2FE1271477B800D51EE1 /* NotificationNames.swift in Sources */ = {isa = PBXBuildFile; fileRef = 496C2FE0271477B800D51EE1 /* NotificationNames.swift */; };
3233
496FE4D12651485E007746ED /* UserInfo.swift in Sources */ = {isa = PBXBuildFile; fileRef = 496FE4D02651485E007746ED /* UserInfo.swift */; };
3334
496FE4D326514C59007746ED /* PasswordSubview.swift in Sources */ = {isa = PBXBuildFile; fileRef = 496FE4D226514C59007746ED /* PasswordSubview.swift */; };
@@ -40,11 +41,26 @@
4041
49822CED24B4C3F200E8DE54 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 49822CEB24B4C3F200E8DE54 /* Main.storyboard */; };
4142
49857E9824D4B543009B6FBA /* Preferences.swift in Sources */ = {isa = PBXBuildFile; fileRef = 49857E9724D4B543009B6FBA /* Preferences.swift */; };
4243
49857E9A24D4B58B009B6FBA /* ComputerInfo.swift in Sources */ = {isa = PBXBuildFile; fileRef = 49857E9924D4B58B009B6FBA /* ComputerInfo.swift */; };
44+
49871A6F287CC98500715C7C /* HeaderView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 49871A6E287CC98500715C7C /* HeaderView.swift */; };
4345
498B7001272F460100BFA45E /* KerberosSSOExtensionModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 498B7000272F460100BFA45E /* KerberosSSOExtensionModel.swift */; };
4446
49B4952D2642E96A00A6AE64 /* DarkModeBorder.swift in Sources */ = {isa = PBXBuildFile; fileRef = 49B4952C2642E96A00A6AE64 /* DarkModeBorder.swift */; };
4547
49F6744E273F2DBC00C47403 /* ExtensionASubview.swift in Sources */ = {isa = PBXBuildFile; fileRef = 49F6744D273F2DBC00C47403 /* ExtensionASubview.swift */; };
48+
B03F2E5C28734ABD000478BC /* nl.root3.support.plist in CopyFiles */ = {isa = PBXBuildFile; fileRef = B03F2E53287340BD000478BC /* nl.root3.support.plist */; settings = {ATTRIBUTES = (CodeSignOnCopy, ); }; };
4649
/* End PBXBuildFile section */
4750

51+
/* Begin PBXCopyFilesBuildPhase section */
52+
B03F2E59287345A7000478BC /* CopyFiles */ = {
53+
isa = PBXCopyFilesBuildPhase;
54+
buildActionMask = 12;
55+
dstPath = Contents/Library/LaunchAgents;
56+
dstSubfolderSpec = 1;
57+
files = (
58+
B03F2E5C28734ABD000478BC /* nl.root3.support.plist in CopyFiles */,
59+
);
60+
runOnlyForDeploymentPostprocessing = 0;
61+
};
62+
/* End PBXCopyFilesBuildPhase section */
63+
4864
/* Begin PBXFileReference section */
4965
0A24AB432624CABB004208C4 /* NotificationBadgeTextView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NotificationBadgeTextView.swift; sourceTree = "<group>"; };
5066
0A315E5A2683C88800E9A1F9 /* FeatureView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FeatureView.swift; sourceTree = "<group>"; };
@@ -68,6 +84,7 @@
6884
4915291B259CD38800056B5F /* EffectsView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EffectsView.swift; sourceTree = "<group>"; };
6985
493FBB8C27406B5D002A79F9 /* ExtensionBSubview.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ExtensionBSubview.swift; sourceTree = "<group>"; };
7086
495924F8265C535B00E083AC /* QuitButton.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = QuitButton.swift; sourceTree = "<group>"; };
87+
495F74EB28B39A9A00C20304 /* PopoverAlertView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = PopoverAlertView.swift; path = Support/Views/PopoverAlertView.swift; sourceTree = SOURCE_ROOT; };
7188
496C2FE0271477B800D51EE1 /* NotificationNames.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NotificationNames.swift; sourceTree = "<group>"; };
7289
496FE4D02651485E007746ED /* UserInfo.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UserInfo.swift; sourceTree = "<group>"; };
7390
496FE4D226514C59007746ED /* PasswordSubview.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PasswordSubview.swift; sourceTree = "<group>"; };
@@ -83,11 +100,13 @@
83100
49822CEF24B4C3F200E8DE54 /* Support.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = Support.entitlements; sourceTree = "<group>"; };
84101
49857E9724D4B543009B6FBA /* Preferences.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Preferences.swift; sourceTree = "<group>"; };
85102
49857E9924D4B58B009B6FBA /* ComputerInfo.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ComputerInfo.swift; sourceTree = "<group>"; };
103+
49871A6E287CC98500715C7C /* HeaderView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HeaderView.swift; sourceTree = "<group>"; };
86104
498B7000272F460100BFA45E /* KerberosSSOExtensionModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = KerberosSSOExtensionModel.swift; sourceTree = "<group>"; };
87105
49B163AC26FCB154006D57C7 /* fr */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = fr; path = fr.lproj/Localizable.strings; sourceTree = "<group>"; };
88106
49B4952C2642E96A00A6AE64 /* DarkModeBorder.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DarkModeBorder.swift; sourceTree = "<group>"; };
89107
49F6744D273F2DBC00C47403 /* ExtensionASubview.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ExtensionASubview.swift; sourceTree = "<group>"; };
90108
A0532BCB2733F35A005CACF2 /* de */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = de; path = de.lproj/Localizable.strings; sourceTree = "<group>"; };
109+
B03F2E53287340BD000478BC /* nl.root3.support.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = nl.root3.support.plist; sourceTree = "<group>"; };
91110
/* End PBXFileReference section */
92111

93112
/* Begin PBXFrameworksBuildPhase section */
@@ -140,6 +159,8 @@
140159
4915290C259CCF7A00056B5F /* NotificationBadgeView.swift */,
141160
0A24AB432624CABB004208C4 /* NotificationBadgeTextView.swift */,
142161
495924F8265C535B00E083AC /* QuitButton.swift */,
162+
49871A6E287CC98500715C7C /* HeaderView.swift */,
163+
495F74EB28B39A9A00C20304 /* PopoverAlertView.swift */,
143164
);
144165
path = Views;
145166
sourceTree = "<group>";
@@ -171,6 +192,7 @@
171192
49822CE124B4C3F100E8DE54 /* Support */ = {
172193
isa = PBXGroup;
173194
children = (
195+
B03F2E53287340BD000478BC /* nl.root3.support.plist */,
174196
498B6FFF272F45EF00BFA45E /* Models */,
175197
4915290A259CCF2500056B5F /* Views */,
176198
0AFE0A8525014C6100957B52 /* Localizable.strings */,
@@ -237,6 +259,7 @@
237259
49822CDC24B4C3F100E8DE54 /* Frameworks */,
238260
49822CDD24B4C3F100E8DE54 /* Resources */,
239261
49FB1303273B244600650BD3 /* Run Script */,
262+
B03F2E59287345A7000478BC /* CopyFiles */,
240263
);
241264
buildRules = (
242265
);
@@ -303,6 +326,7 @@
303326
/* Begin PBXShellScriptBuildPhase section */
304327
49FB1303273B244600650BD3 /* Run Script */ = {
305328
isa = PBXShellScriptBuildPhase;
329+
alwaysOutOfDate = 1;
306330
buildActionMask = 12;
307331
files = (
308332
);
@@ -333,6 +357,7 @@
333357
498B7001272F460100BFA45E /* KerberosSSOExtensionModel.swift in Sources */,
334358
4976EB8B265317C6006EE097 /* AppView.swift in Sources */,
335359
49F6744E273F2DBC00C47403 /* ExtensionASubview.swift in Sources */,
360+
49871A6F287CC98500715C7C /* HeaderView.swift in Sources */,
336361
496FE4D12651485E007746ED /* UserInfo.swift in Sources */,
337362
4915290D259CCF7A00056B5F /* NotificationBadgeView.swift in Sources */,
338363
49857E9A24D4B58B009B6FBA /* ComputerInfo.swift in Sources */,
@@ -358,6 +383,7 @@
358383
0A24AB442624CABB004208C4 /* NotificationBadgeTextView.swift in Sources */,
359384
4915291C259CD38800056B5F /* EffectsView.swift in Sources */,
360385
0A446D572683A40600667602 /* WelcomeScreenView.swift in Sources */,
386+
495F74EC28B39A9A00C20304 /* PopoverAlertView.swift in Sources */,
361387
);
362388
runOnlyForDeploymentPostprocessing = 0;
363389
};
@@ -511,6 +537,7 @@
511537
ASSETCATALOG_COMPILER_INCLUDE_ALL_APPICON_ASSETS = NO;
512538
CODE_SIGN_ENTITLEMENTS = Support/Support.entitlements;
513539
CODE_SIGN_IDENTITY = "Apple Development";
540+
"CODE_SIGN_IDENTITY[sdk=macosx*]" = "Apple Development";
514541
CODE_SIGN_STYLE = Automatic;
515542
COMBINE_HIDPI_IMAGES = YES;
516543
CURRENT_PROJECT_VERSION = 1656517987;
@@ -524,7 +551,7 @@
524551
"@executable_path/../Frameworks",
525552
);
526553
MACOSX_DEPLOYMENT_TARGET = 11.0;
527-
MARKETING_VERSION = 2.4;
554+
MARKETING_VERSION = 2.4.1;
528555
PRODUCT_BUNDLE_IDENTIFIER = nl.root3.support;
529556
PRODUCT_NAME = "$(TARGET_NAME)";
530557
PROVISIONING_PROFILE_SPECIFIER = "";
@@ -540,6 +567,7 @@
540567
ASSETCATALOG_COMPILER_INCLUDE_ALL_APPICON_ASSETS = NO;
541568
CODE_SIGN_ENTITLEMENTS = Support/Support.entitlements;
542569
CODE_SIGN_IDENTITY = "Apple Development";
570+
"CODE_SIGN_IDENTITY[sdk=macosx*]" = "Apple Development";
543571
CODE_SIGN_STYLE = Automatic;
544572
COMBINE_HIDPI_IMAGES = YES;
545573
CURRENT_PROJECT_VERSION = 1656517987;
@@ -553,7 +581,7 @@
553581
"@executable_path/../Frameworks",
554582
);
555583
MACOSX_DEPLOYMENT_TARGET = 11.0;
556-
MARKETING_VERSION = 2.4;
584+
MARKETING_VERSION = 2.4.1;
557585
PRODUCT_BUNDLE_IDENTIFIER = nl.root3.support;
558586
PRODUCT_NAME = "$(TARGET_NAME)";
559587
PROVISIONING_PROFILE_SPECIFIER = "";

0 commit comments

Comments
 (0)