Skip to content

Commit

Permalink
Added macOS .app instructions/scripts, Added icon for macOS (#88)
Browse files Browse the repository at this point in the history
* Add macOS appgen instructions
Added instructions for generating a .app package for GModCEFCodecFix, as well as a directory to drop other documentation into.

* Create launcher.sh
Added launcher.sh, a proxy for running the Terminal version of GModCEFCodecFix inside of a .app package.

* Added appify.sh script for macOS
Generates a .app package from a shell script;
Source: https://gist.github.com/mathiasbynens/674099

* Added macOS compatible icon (.icns format)
  • Loading branch information
AkikoKumagara authored Nov 9, 2023
1 parent 2bae119 commit 6746724
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 0 deletions.
Binary file added GModCEFCodecFixIcon.icns
Binary file not shown.
9 changes: 9 additions & 0 deletions docs/macOS/appgen.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
// To generate .app version, use the following process from the repository's root instead of the normal pyinstaller script. This method creates a .app release which we modify to our needs.

pyinstaller --add-data version.txt:. --add-data LICENSE.txt:. --add-data README.md:. --onefile GModCEFCodecFix.py --windowed --icon=GModCEFCodecFixIcon.icns
mv "./dist/GModCEFCodecFix.app/Contents/MacOS/GModCEFCodecFix" "./dist/GModCEFCodecFix.app/Contents/MacOS/GModCEFCodecFix-macOS"
./docs/macOS/scripts/appify.sh ./docs/macOS/scripts/launcher.sh "GModCEFCodecFix"
mv "./GModCEFCodecFix.app/Contents/MacOS/GModCEFCodecFix" "./dist/GModCEFCodecFix.app/Contents/MacOS/GModCEFCodecFix"
rm -R "./dist/GModCEFCodecFix.app/Contents/_CodeSignature" && rm -R "./GModCEFCodecFix.app"

// We've now created a functional .app package for GModCEFCodecFix located in "./dist/GModCEFCodecFix.app"
28 changes: 28 additions & 0 deletions docs/macOS/scripts/appify.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#!/bin/bash

if [ "$1" = "-h" -o "$1" = "--help" -o -z "$1" ]; then cat <<EOF
appify v3.0.1 for Mac OS X - http://mths.be/appify
Creates the simplest possible Mac app from a shell script.
Appify takes a shell script as its first argument:
`basename "$0"` my-script.sh
Note that you cannot rename appified apps. If you want to give your app
a custom name, use the second argument:
`basename "$0"` my-script.sh "My App"
Copyright (c) Thomas Aylott <http://subtlegradient.com/>
Modified by Mathias Bynens <http://mathiasbynens.be/>
EOF
exit; fi

APPNAME=${2:-$(basename "$1" ".sh")}
DIR="$APPNAME.app/Contents/MacOS"

if [ -a "$APPNAME.app" ]; then
echo "$PWD/$APPNAME.app already exists :("
exit 1
fi

mkdir -p "$DIR"
cp "$1" "$DIR/$APPNAME"
chmod +x "$DIR/$APPNAME"

echo "$PWD/$APPNAME.app"
3 changes: 3 additions & 0 deletions docs/macOS/scripts/launcher.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/bash
scriptPath=$(dirname "$0")'/GModCEFCodecFix-macOS'
open -a Terminal "$scriptPath"

0 comments on commit 6746724

Please sign in to comment.