Skip to content

Commit 7993255

Browse files
authored
Merge pull request #117 from PropGit/mac_release_3
Mac release 3
2 parents 5bec301 + 389e434 commit 7993255

File tree

6 files changed

+433
-7
lines changed

6 files changed

+433
-7
lines changed

.gitattributes

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,4 @@ chromestore/* filter=lfs diff=lfs merge=lfs -text
66
*.psd filter=lfs diff=lfs merge=lfs -text
77
*.exe filter=lfs diff=lfs merge=lfs -text
88
package/win-resources/nwjs/nwjs-v*.exe filter=lfs diff=lfs merge=lfs -text
9+
assets/BlocklyProp-Splash.png filter=lfs diff=lfs merge=lfs -text

assets/BlocklyProp-Splash.png

-141 KB
Loading

package/mac_app_notarize.sh

Lines changed: 141 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,141 @@
1+
#!/bin/sh --
2+
#
3+
# This script transmits a packaged macOS application to Apple for notarization.
4+
# Must be run on macOS Catalina (or later) with XCode installed.
5+
#
6+
# Requirements for this script are:
7+
#
8+
# User must specify the application bundle name without extension: (example -a "MyApplication")
9+
# IMPORTANT: Packaged application bundle must exist in folder noted below
10+
# User must specify the package version: (example: -v 1.0.56)
11+
# User must specify the Apple developer account: (example: -d "[email protected]")
12+
#
13+
# These files and folders must exist in the paths shown below (in relation to this script's folder):
14+
# ../dist/{APP_NAME}-{VERSION}-setup-MacOS.pkg
15+
#
16+
17+
usage()
18+
{
19+
cat << EOF
20+
Usage: $0 OPTIONS
21+
22+
This script transmits a packaged macOS application to Apple for notarization.
23+
24+
OPTIONS:
25+
-h show usage
26+
-a (REQUIRED) application bundle name
27+
- example: -a "MyApplication"
28+
-v (REQUIRED) version
29+
- example: -v 0.5.1
30+
-d (REQUIRED) developer account
31+
- example: -d "[email protected]"
32+
33+
examples: $0 -a "MyApplication" -v 1.0.56 -d "[email protected]"
34+
35+
EOF
36+
}
37+
38+
#
39+
# Resource path
40+
#
41+
DISTRIBUTION="../dist/"
42+
43+
#
44+
# initialize input options with default values
45+
#
46+
APP_NAME=
47+
VERSION=
48+
DEVELOPER_ACCOUNT=
49+
50+
#
51+
# get parms as flags or as requiring arguments
52+
#
53+
while getopts "ha:v:d:" OPTION
54+
do
55+
case $OPTION in
56+
h)
57+
usage; exit 1 ;;
58+
a)
59+
APP_NAME=$OPTARG
60+
;;
61+
v)
62+
VERSION=$OPTARG
63+
;;
64+
d)
65+
DEVELOPER_ACCOUNT=$OPTARG
66+
;;
67+
?)
68+
echo "[HALT] Misconfigured options - see usage notes"
69+
usage; exit ;;
70+
esac
71+
done
72+
73+
#
74+
# Error if no application bundle name (-a bundle) was declared
75+
#
76+
if [[ -z $APP_NAME ]]
77+
then
78+
echo "[HALT] No application bundle was declared - see usage notes for -a."
79+
echo
80+
usage
81+
exit 1
82+
fi
83+
84+
#
85+
# Error if no version (-v) option declared
86+
#
87+
if [[ -z $VERSION ]]
88+
then
89+
echo "[HALT] No version option was declared - see usage notes for -v."
90+
echo
91+
usage
92+
exit 1
93+
fi
94+
95+
#
96+
# Error if no version string declared
97+
#
98+
if [ ${VERSION}X == X ]
99+
then
100+
echo "[HALT] No version string was declared - see usage notes for -v."
101+
echo
102+
usage
103+
exit 1
104+
fi
105+
106+
#
107+
# Error if no developer account (-d bundle) was declared
108+
#
109+
if [[ -z $DEVELOPER_ACCOUNT ]]
110+
then
111+
echo "[HALT] No developer account was declared - see usage notes for -d."
112+
echo
113+
usage
114+
exit 1
115+
fi
116+
117+
#
118+
# Show Info
119+
#
120+
echo
121+
echo "----- Transmitting packaged app to Apple for notarization -----"
122+
echo "NOTE: use altool app password defined in Apple Developer Account"
123+
echo
124+
echo "Package: \"${DISTRIBUTION}${APP_NAME}-${VERSION}-setup-MacOS.pkg\""
125+
echo
126+
echo "... be patient - this will take a while ..."
127+
echo
128+
129+
#
130+
# Transmit app package for notarization
131+
#
132+
xcrun altool --notarize-app --primary-bundle-id "${APP_NAME}" --username "${DEVELOPER_ACCOUNT}" --file "${DISTRIBUTION}${APP_NAME}-${VERSION}-setup-MacOS.pkg"
133+
134+
echo
135+
echo "If no errors reported (above), wait a few minutes and check ${DEVELOPER_ACCOUNT} email for notarization verdict."
136+
echo "To see detailed report (after verdict), use: xcrun altool -u \"${DEVELOPER_ACCOUNT}\" --notarization-info <hash>"
137+
echo
138+
echo "If \"successful\" vertict, staple notarization ticket to package: xcrun stapler staple -v ${DISTRIBUTION}${APP_NAME}-${VERSION}-setup-MacOS.pkg"
139+
echo
140+
echo "Done!"
141+
exit 0

package/mac_app_sign_and_package.sh

Lines changed: 65 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,11 @@
99
# IMPORTANT: Application bundle must exist in folder noted below
1010
# User must specify the package version: (example: "-v 1.0.56")
1111
#
12-
# All other parameters are optional: (FTDI driver installer, restart requirement, developer identities, deploy package request)
12+
# All other parameters are optional: (FTDI driver installer, restart requirement, developer identities)
1313
#
1414
# These files and folders must exist in the paths show below (in relation to this script's folder):
1515
# ./drivers/FTDIUSBSerialDriver.kext
16+
# ./mac-resources/neededToRun.entitlements
1617
# ../dist/|application_bundle_name|.app
1718
#
1819
# To update the driver,
@@ -23,7 +24,7 @@
2324
# - copy the FTDIUSBSerialDriver.kext from /Library/Extensions/ to the ../drivers/ folder
2425
#
2526
# The ../dist/|application_bundle_name|.app will be modified by this script to digitally sign it with the default or optional
26-
# application developer identity certificate
27+
# application developer identity certificate as well as with the given runtime entitlements (neededToRun.entitlements)
2728
#
2829

2930
usage()
@@ -56,13 +57,21 @@ EOF
5657
#
5758
# Resource paths
5859
#
60+
# Notes:
61+
# * All are paths relative to this script.
62+
# * NWJS_FW_LIBRARIES (NW.js Framework Libraries) is the path inside of APP_BUNDLE (defined later)
63+
#
5964
RESOURCES="./mac-resources/"
6065
DISTRIBUTION="../dist/"
66+
NWJS_FW="/Contents/Frameworks/nwjs Framework.framework/"
67+
NWJS_FW_LIBRARIES="${NWJS_FW}Versions/Current/Libraries/"
68+
ENTITLEMENTS="${RESOURCES}neededToRun.entitlements"
6169

6270
#
6371
# Default installation locations
6472
#
65-
# note: the FTDI kext used to be in "/System/Library/Extensions/" per Apple's previous suggestion (before Mavericks?)
73+
# Note: the FTDI kext used to be in "/System/Library/Extensions/" per Apple's previous suggestion (before Mavericks?)
74+
#
6675
FTDIDRIVER_DEST_DIR="/Library/Extensions/"
6776
DEFAULT_APP_DIR="/Applications/"
6877

@@ -75,7 +84,8 @@ FTDIDRIVER_KEXT=${FTDIDRIVER}.kext
7584
#
7685
# Modified temporary distro xml
7786
#
78-
# note: will contain copied or sed-modified version of template DistributionXXXX.xml
87+
# Note: will contain copied or sed-modified version of template DistributionXXXX.xml
88+
#
7989
DIST_DST=DistributionMOD.xml
8090

8191
#
@@ -267,16 +277,64 @@ else
267277
exit 1
268278
fi
269279

280+
echo
281+
282+
#
283+
# Attempt to deeply codesign the known-to-be-unsigned nwjs libraries and nwjs framework
284+
#
285+
echo "Code signing nwjs libraries and framework within the application bundle: ${DISTRIBUTION}${APP_BUNDLE} with identity: \"${APP_IDENTITY}\""
286+
#
287+
# signing libEGL.dylib
288+
#
289+
codesign -s "$APP_IDENTITY" --deep -f -v --options runtime --timestamp --entitlements "${ENTITLEMENTS}" "${DISTRIBUTION}${APP_BUNDLE}${NWJS_FW_LIBRARIES}libEGL.dylib"
290+
if [ "$?" != "0" ]; then
291+
echo "[Error] Code signing nwjs library failed!" 1>&2
292+
exit 1
293+
fi
294+
#
295+
# libGLESv2.dylib
296+
#
297+
codesign -s "$APP_IDENTITY" --deep -f -v --options runtime --timestamp --entitlements "${ENTITLEMENTS}" "${DISTRIBUTION}${APP_BUNDLE}${NWJS_FW_LIBRARIES}libGLESv2.dylib"
298+
if [ "$?" != "0" ]; then
299+
echo "[Error] Code signing nwjs library failed!" 1>&2
300+
exit 1
301+
fi
302+
#
303+
# libswiftshader_libEGL.dylib
304+
#
305+
codesign -s "$APP_IDENTITY" --deep -f -v --options runtime --timestamp --entitlements "${ENTITLEMENTS}" "${DISTRIBUTION}${APP_BUNDLE}${NWJS_FW_LIBRARIES}libswiftshader_libEGL.dylib"
306+
if [ "$?" != "0" ]; then
307+
echo "[Error] Code signing nwjs library failed!" 1>&2
308+
exit 1
309+
fi
310+
#
311+
# libswiftshader_libGLESv2.dylib
312+
#
313+
codesign -s "$APP_IDENTITY" --deep -f -v --options runtime --timestamp --entitlements "${ENTITLEMENTS}" "${DISTRIBUTION}${APP_BUNDLE}${NWJS_FW_LIBRARIES}libswiftshader_libGLESv2.dylib"
314+
if [ "$?" != "0" ]; then
315+
echo "[Error] Code signing nwjs library failed!" 1>&2
316+
exit 1
317+
fi
318+
#
319+
# nwjs Framework
320+
#
321+
codesign -s "$APP_IDENTITY" --deep -f -v --options runtime --timestamp --entitlements "${ENTITLEMENTS}" "${DISTRIBUTION}${APP_BUNDLE}${NWJS_FW}nwjs Framework"
322+
if [ "$?" != "0" ]; then
323+
echo "[Error] Code signing nwjs framework failed!" 1>&2
324+
exit 1
325+
fi
326+
327+
270328
echo
271329

272330
#
273331
# Attempt to deeply codesign the app bundle
274332
#
275333
echo "Code signing the application bundle (hardened runtime with entitlements): ${DISTRIBUTION}${APP_BUNDLE} with identity: \"${APP_IDENTITY}\""
276-
codesign -s "$APP_IDENTITY" --deep -f -v --options runtime --timestamp --entitlements "./mac-resources/neededToRun.entitlements" "${DISTRIBUTION}${APP_BUNDLE}"
334+
codesign -s "$APP_IDENTITY" --deep -f -v --options runtime --timestamp --entitlements "${ENTITLEMENTS}" "${DISTRIBUTION}${APP_BUNDLE}"
277335
if [ "$?" != "0" ]; then
278-
echo "[Error] Codesigning the application bundle failed!" 1>&2
279-
exit 1
336+
echo "[Error] Code signing the application bundle failed!" 1>&2
337+
exit 1
280338
fi
281339

282340
echo

package/mac_app_staple.sh

Lines changed: 116 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,116 @@
1+
#!/bin/sh --
2+
#
3+
# This script staples a successfully notarized app ticket to an app package.
4+
# Must be run on macOS Catalina (or later) with XCode installed.
5+
#
6+
# Requirements for this script are:
7+
#
8+
# User must have successfully notarized the app first.
9+
# User must specify the application bundle name without extension: (example -a "MyApplication")
10+
# IMPORTANT: Packaged application bundle must exist in folder noted below
11+
# User must specify the package version: (example: -v 1.0.56)
12+
#
13+
# These files and folders must exist in the paths shown below (in relation to this script's folder):
14+
# ../dist/{APP_NAME}-{VERSION}-setup-MacOS.pkg
15+
#
16+
17+
usage()
18+
{
19+
cat << EOF
20+
Usage: $0 OPTIONS
21+
22+
This script staples a successfully notarized app ticket to a packaged macOS application.
23+
24+
OPTIONS:
25+
-h show usage
26+
-a (REQUIRED) application bundle name
27+
- example: -a "MyApplication"
28+
-v (REQUIRED) version
29+
- example: -v 0.5.1
30+
31+
examples: $0 -a "MyApplication" -v 1.0.56
32+
33+
EOF
34+
}
35+
36+
#
37+
# Resource path
38+
#
39+
DISTRIBUTION="../dist/"
40+
41+
#
42+
# initialize input options with default values
43+
#
44+
APP_NAME=
45+
VERSION=
46+
47+
#
48+
# get parms as flags or as requiring arguments
49+
#
50+
while getopts "ha:v:" OPTION
51+
do
52+
case $OPTION in
53+
h)
54+
usage; exit 1 ;;
55+
a)
56+
APP_NAME=$OPTARG
57+
;;
58+
v)
59+
VERSION=$OPTARG
60+
;;
61+
?)
62+
echo "[HALT] Misconfigured options - see usage notes"
63+
usage; exit ;;
64+
esac
65+
done
66+
67+
#
68+
# Error if no application bundle name (-a bundle) was declared
69+
#
70+
if [[ -z $APP_NAME ]]
71+
then
72+
echo "[HALT] No application bundle was declared - see usage notes for -a."
73+
echo
74+
usage
75+
exit 1
76+
fi
77+
78+
#
79+
# Error if no version (-v) option declared
80+
#
81+
if [[ -z $VERSION ]]
82+
then
83+
echo "[HALT] No version option was declared - see usage notes for -v."
84+
echo
85+
usage
86+
exit 1
87+
fi
88+
89+
#
90+
# Error if no version string declared
91+
#
92+
if [ ${VERSION}X == X ]
93+
then
94+
echo "[HALT] No version string was declared - see usage notes for -v."
95+
echo
96+
usage
97+
exit 1
98+
fi
99+
100+
#
101+
# Show Info
102+
#
103+
echo
104+
echo "----- Stapling packaged app with notarization ticket -----"
105+
echo
106+
echo "Package: \"${DISTRIBUTION}${APP_NAME}-${VERSION}-setup-MacOS.pkg\""
107+
echo
108+
109+
#
110+
# Staple app package
111+
#
112+
xcrun stapler staple -v "${DISTRIBUTION}${APP_NAME}-${VERSION}-setup-MacOS.pkg"
113+
114+
echo
115+
echo "Done!"
116+
exit 0

0 commit comments

Comments
 (0)