Skip to content

Commit e36f11d

Browse files
committed
Updated build process + UI tweaks
1 parent f9fceec commit e36f11d

6 files changed

Lines changed: 61 additions & 14 deletions

File tree

pkgbuild/build_pkg.zsh

Lines changed: 24 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,12 @@ scripts="scripts"
4343
# Path to Component plist
4444
component_plist="Support-component.plist"
4545

46+
# Requirements plist
47+
requirements_plist="requirements.plist"
48+
49+
# Distribution xml
50+
distribution_xml="distribution.xml"
51+
4652
# Install location
4753
install_location="/Applications"
4854

@@ -66,31 +72,41 @@ username=$(scutil <<< "show State:/Users/ConsoleUser" | awk '/Name :/ && ! /logi
6672
# NFS Home Directory of user
6773
nfs_home_directory=$(dscl . read /Users/${username} NFSHomeDirectory | awk '{print $2}')
6874

75+
# Create directory
76+
mkdir -p "${nfs_home_directory}/Downloads/${app_name}_${version}"
77+
6978
# Build and export pkg to Downloads folder
7079
pkgbuild --component-plist "${component_plist}" \
7180
--root "${payload}" \
7281
--scripts "${scripts}" \
7382
--install-location "${install_location}" \
7483
--identifier "${bundle_identifier}" \
7584
--version "${version}" \
76-
"${nfs_home_directory}/Downloads/${app_name} ${version}_unsigned.pkg"
85+
"${nfs_home_directory}/Downloads/${app_name}_${version}/Support_component.pkg"
86+
87+
# Create basic Distribution file
88+
# productbuild --synthesize \
89+
# --package "${nfs_home_directory}/Downloads/${app_name}_${version}/Support_component.pkg" \
90+
# --product "${requirements_plist}" \
91+
# "${nfs_home_directory}/Downloads/${app_name}_${version}/distribution.xml"
7792

7893
# Create distribution package to support InstallApplication MDM command
79-
productbuild --package "${nfs_home_directory}/Downloads/${app_name} ${version}_unsigned.pkg" \
80-
"${nfs_home_directory}/Downloads/${app_name} ${version}_dist.pkg"
94+
productbuild --distribution "${distribution_xml}" \
95+
--package-path "${nfs_home_directory}/Downloads/${app_name}_${version}/" \
96+
"${nfs_home_directory}/Downloads/${app_name}_${version}/${app_name} ${version}_dist.pkg"
8197

8298
# Sign package
8399
productsign --sign "${signing_identity}" \
84-
"${nfs_home_directory}/Downloads/${app_name} ${version}_dist.pkg" \
85-
"${nfs_home_directory}/Downloads/${app_name} ${version}.pkg"
100+
"${nfs_home_directory}/Downloads/${app_name}_${version}/${app_name} ${version}_dist.pkg" \
101+
"${nfs_home_directory}/Downloads/${app_name}_${version}/${app_name} ${version}.pkg"
86102

87103
# Submit pkg to notarytool
88-
xcrun notarytool submit "${nfs_home_directory}/Downloads/${app_name} ${version}.pkg" \
104+
xcrun notarytool submit "${nfs_home_directory}/Downloads/${app_name}_${version}/${app_name} ${version}.pkg" \
89105
--keychain-profile "${keychain_profile}" \
90106
--wait
91107

92108
# Staple the notarization ticket to the pkg
93-
xcrun stapler staple "${nfs_home_directory}/Downloads/${app_name} ${version}.pkg"
109+
xcrun stapler staple "${nfs_home_directory}/Downloads/${app_name}_${version}/${app_name} ${version}.pkg"
94110

95111
# Check the notarization ticket validity
96-
spctl --assess -vv --type install "${nfs_home_directory}/Downloads/${app_name} ${version}.pkg"
112+
spctl --assess -vv --type install "${nfs_home_directory}/Downloads/${app_name}_${version}/${app_name} ${version}.pkg"

pkgbuild/distribution.xml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<installer-gui-script minSpecVersion="2">
3+
<title>Support App</title>
4+
<pkg-ref id="nl.root3.support"/>
5+
<options customize="never" require-scripts="false" hostArchitectures="x86_64,arm64"/>
6+
<volume-check>
7+
<allowed-os-versions>
8+
<os-version min="11"/>
9+
</allowed-os-versions>
10+
</volume-check>
11+
<choices-outline>
12+
<line choice="default">
13+
<line choice="nl.root3.support"/>
14+
</line>
15+
</choices-outline>
16+
<choice id="default"/>
17+
<choice id="nl.root3.support" visible="false">
18+
<pkg-ref id="nl.root3.support"/>
19+
</choice>
20+
<pkg-ref id="nl.root3.support" version="%SUPPORT_VERSION%" onConclusion="none">Support_component.pkg</pkg-ref>
21+
</installer-gui-script>

pkgbuild/requirements.plist

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
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>os</key>
6+
<array>
7+
<string>11</string>
8+
</array>
9+
</dict>
10+
</plist>

src/Support.xcodeproj/project.pbxproj

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -556,7 +556,6 @@
556556
ASSETCATALOG_COMPILER_INCLUDE_ALL_APPICON_ASSETS = NO;
557557
CODE_SIGN_ENTITLEMENTS = Support/Support.entitlements;
558558
CODE_SIGN_IDENTITY = "Apple Development";
559-
"CODE_SIGN_IDENTITY[sdk=macosx*]" = "Apple Development";
560559
CODE_SIGN_STYLE = Automatic;
561560
COMBINE_HIDPI_IMAGES = YES;
562561
CURRENT_PROJECT_VERSION = 1656517987;
@@ -586,7 +585,6 @@
586585
ASSETCATALOG_COMPILER_INCLUDE_ALL_APPICON_ASSETS = NO;
587586
CODE_SIGN_ENTITLEMENTS = Support/Support.entitlements;
588587
CODE_SIGN_IDENTITY = "Apple Development";
589-
"CODE_SIGN_IDENTITY[sdk=macosx*]" = "Apple Development";
590588
CODE_SIGN_STYLE = Automatic;
591589
COMBINE_HIDPI_IMAGES = YES;
592590
CURRENT_PROJECT_VERSION = 1656517987;

src/Support/Views/HeaderView.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ struct HeaderView: View {
3333
Text(.init(preferences.title.replaceLocalVariables(computerInfo: computerinfo, userInfo: userinfo)))
3434
.font(.system(size: 20, design: .rounded))
3535
.fontWeight(.medium)
36+
.fixedSize()
3637

3738
Spacer()
3839

src/Support/Views/UpdateView.swift

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -73,16 +73,17 @@ struct UpdateView: View {
7373
Divider()
7474
.padding(2)
7575

76-
HStack {
76+
HStack(alignment: .top) {
7777

78-
Image(systemName: "info.circle")
78+
Image(systemName: "info.circle.fill")
79+
.font(.headline)
7980
.imageScale(.large)
81+
.foregroundColor(color)
8082

8183
// Supports for markdown through a variable:
8284
// https://blog.eidinger.info/3-surprises-when-using-markdown-in-swiftui
8385
Text(.init(preferences.updateText.replaceLocalVariables(computerInfo: computerinfo, userInfo: userinfo)))
84-
.font(.system(.headline, design: .rounded))
85-
.fontWeight(.medium)
86+
.font(.system(.body, design: .rounded))
8687

8788
Spacer()
8889
}

0 commit comments

Comments
 (0)