diff --git a/.gitignore b/.gitignore old mode 100644 new mode 100755 index d41278e..16c8597 --- a/.gitignore +++ b/.gitignore @@ -70,4 +70,6 @@ typings/ .idea .vscode +.DS_Store + # End of https://www.gitignore.io/api/node diff --git a/README.md b/README.md old mode 100644 new mode 100755 index 2a786e4..7223776 --- a/README.md +++ b/README.md @@ -85,10 +85,11 @@ For windows platform: ### Development Installation - Clone the repository -- Run from cmd `yarn install` -- Run from cmd `yarn get all` - this would download all external +- Run from cmd/Terminal `yarn install` +- Run from cmd/Terminal `yarn get all` - this would download all external modules for the launcher. Use `yarn get --help` to change the modules that you want to download. +- If you're using macOS, run from the Terminal ``sudo chmod -R u+x .``. ### Run Program Locally diff --git a/macos/afterPackHook.js b/macos/afterPackHook.js new file mode 100755 index 0000000..ba57bdf --- /dev/null +++ b/macos/afterPackHook.js @@ -0,0 +1,16 @@ + +const fs = require('fs') +const path = require('path') +const { exec } = require('child_process') + +exports.default = async function (context) { + if (context.appOutDir.endsWith('/mac')) { + fs.copyFile(path.resolve(__dirname, './setup/run'), context.appOutDir + '/run', (err) => { + if (err) throw err + console.log('The run script was copied to dist/mac.\nCreating the mac.zip...') + exec('cd ./dist && zip -r -X mac.zip mac', (err) => { + if (err) throw err + }) + }) + } +} diff --git a/macos/setup/run b/macos/setup/run new file mode 100755 index 0000000..4d30774 --- /dev/null +++ b/macos/setup/run @@ -0,0 +1,14 @@ +#!/bin/bash + +DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd ) +cd "${DIR}" + +echo "" +echo "" +echo "Welcome to FIRST LEGO League TMS!" +echo "This application requires super user status." +echo "If prompted, please enter in your account password." + +sudo chmod -R u+x . +mkdir -p "internals" +sudo "./FIRST LEGO League TMS.app/Contents/macOS/FIRST LEGO League TMS" diff --git a/package.json b/package.json old mode 100644 new mode 100755 index 053ef2e..78f9787 --- a/package.json +++ b/package.json @@ -26,6 +26,7 @@ "appId": "com.fll-tools.launcher", "productName": "FIRST LEGO League TMS", "artifactName": "fll-launcher-${version}", + "afterPack": "./macos/afterPackHook.js", "directories": { "buildResources": "resources", "output": "dist" @@ -33,6 +34,10 @@ "files": [ "dist/electron/**/*" ], + "mac": { + "category": "public.app-category.education", + "target": "dir" + }, "buildDependenciesFromSource": true }, "dependencies": { diff --git a/resources/dmg-background.png b/resources/dmg-background.png new file mode 100644 index 0000000..89f6a0a Binary files /dev/null and b/resources/dmg-background.png differ