-
Notifications
You must be signed in to change notification settings - Fork 2
Build and Package: Mac
Parallax Git Administrator edited this page Nov 3, 2022
·
12 revisions
These steps need to be performed on a pre-configured development system every time a new installation package is desired.
- Checkout the desired BlocklyProp Launcher version
- Open a command window
- Check out the needed branch from the BlocklyPropLauncher repository
- in Git command line:
- $ cd /Users/{username}/{folder}/BlocklyProp_Launcher
- $ git checkout origin {branch}
- in Git command line:
- NOTE: The source can be run from here- no build process needed; however, follow extra steps below to package for Mac
- If needed, download and touch-up desired nw.js release (normally can reuse the existing one on dev computer from previous sessions)
- Download stable release (not -rcx, -alphax, or -betax) from http://dl.nwjs.io/
- Extract the downloaded archive
- Find extracted subfolder and locate nwjs.app within it
- Move nwjs.app to the ./dist subfolder
- Rename the nwjs.app file to BlocklyPropLauncher.app
- Touch-up BlocklyPropLauncher.app
- Copy the ./package/mac-resources/BlocklyProp.icns file (we'll use it soon)
- On BlocklyPropLauncher.app, right-click > Show Package Contents
- Then navigate to Contents/Resources subfolder
- Move the app.icns file to trash
- Paste the BlocklyProp.icns file in its place
- Navigate to the Contents subfolder
- Open BlocklyPropLauncher app bundle's Info.plist file with XCode
- Set the "Bundle display name" value to "BlocklyProp Launcher" (including quotes; that's important)
- Note that the "Executable file" should already be nwjs
- Set the "Icon file" value to BlocklyProp.icns
- Set the "Bundle versions string, short" value to the proper Major, Minor, and Release number of the BlocklyProp Launcher app
- All the rest can stay as-is. Save the file and quit XCode.
- Dequarantine the app bundle (else gatekeeper will refuse to let it run)
- Forcefully dequarantine the app bundle with: xattr -d com.apple.quarantine BlocklyPropLauncher.app
- NOTE: The app bundle's icon may not appear properly in Finder right away. It will resolve itself when the app bundle is signed in later steps, below.
- Make Release
- Run the build script from within the repository directory:
-
$ ./MakeRelease
- This builds and stores the application files in the ./release subfolder
-
$ ./MakeRelease
- Run the build script from within the repository directory:
- Copy release to app bundle
- Copy the contents of the ./release folder (the contents, not the folder) into the BlocklyPropLauncher app bundle's Contents/Resources/app.nw subfolder (create the folder if new nwjs app release was downloaded and touched up (from steps above)
- This can be achieved in Finder by...
- navigating to the ./dist subfolder,
- finding the BlocklyPropLauncher app,
- right-click > Show Package Contents,
- then navigate to Contents/Resources/app.nw subfolder and paste
- This can be achieved in Finder by...
- Copy the contents of the ./release folder (the contents, not the folder) into the BlocklyPropLauncher app bundle's Contents/Resources/app.nw subfolder (create the folder if new nwjs app release was downloaded and touched up (from steps above)
- Touch up BlocklyPropLauncher app product version (NOTE: This step is already done if a new nwjs app release was downloaded and touched up; from steps above)
- Open BlocklyPropLauncher app bundle's Contents/Info.plist file with XCode and set the "Bundle versions string, short" value to the proper Major, Minor, and Release number of the BlocklyProp Launcher app
- NOTE: At the time of this writing, the mac_app_sign_and_package script below says it's setting the version, but it fails to actually do so
- Open BlocklyPropLauncher app bundle's Contents/Info.plist file with XCode and set the "Bundle versions string, short" value to the proper Major, Minor, and Release number of the BlocklyProp Launcher app
- Sign and Package BlocklyProp Launcher
- $ cd ./package
- $ ./mac_app_sign_and_package.sh -a "BlocklyPropLauncher" -v #.#.# -d ;where #.#.# is the proper application version number
- (OPTIONAL) $ ./mac_app_verify_signatures.sh -a "BlocklyPropLauncher"
- Notarize BlocklyProp Launcher package; so Mac Gatekeeper (on macOS Catalina (10.15) and above) allows proper execution
-
$ ./mac_app_notarize.sh -a "BlocklyPropLauncher" -v #.#.# -d {apple_developer_email_address} ;where #.#.# is the proper application version number
- NOTES:
- Use the App Notarization password (from the Apple Developer account in our password database)
- After entering password, the CLI will appear frozen for a couple minutes; it's okay, it's uploading the package to Apple's notary service
- If no errors are reported, wait for notarization email (which may be a few minutes)
- It comes to the Apple Developer account email
- NOTES:
- If notarization arrives and was successful...
-
$ ./mac_app_staple.sh -a "BlocklyPropLauncher" -v #.#.# ;where #.#.# is the proper application version number
- NOTE: It may complain near the end of the response output that "We do not know how to deal with trailer version..." but this issue doesn't seem to be fatal as it later reports "The staple and validate action worked!"
-
$ ./mac_app_staple.sh -a "BlocklyPropLauncher" -v #.#.# ;where #.#.# is the proper application version number
-
$ ./mac_app_notarize.sh -a "BlocklyPropLauncher" -v #.#.# -d {apple_developer_email_address} ;where #.#.# is the proper application version number
- Rename installer
- $ package % mv ../dist/BlocklyPropLauncher-#.#.#-setup-MacOS.pkg ../dist/Setup-BPLauncher-#.#.#-MacOS.pkg