Skip to content

Commit

Permalink
Tie-in with dmgbuild for #213
Browse files Browse the repository at this point in the history
  • Loading branch information
machawk1 committed Jan 12, 2016
1 parent 91659c5 commit b12f45b
Show file tree
Hide file tree
Showing 3 changed files with 76 additions and 25 deletions.
2 changes: 1 addition & 1 deletion build/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<plist version="1.0">
<dict>
<key>CFBundleShortVersionString</key>
<string>2015.11.09</string>
<string>2016.01.12</string>
<key>NSHumanReadableCopyright</key>
<string>Mat Kelly</string>
<key>CFBundleExecutable</key>
Expand Down
96 changes: 73 additions & 23 deletions bundledApps/MAKEFILE.sh
Original file line number Diff line number Diff line change
Expand Up @@ -39,30 +39,80 @@ if [ -d "$DIRECTORY" ]; then
done
fi

read -p "Would you like to install binary, create dmg, or both? (i/d/b) " ans

case "$ans" in
i|d|b)
;;
*)
echo "Invalid choice, choose one of i/d/b"
exit
;;
esac



createBinary ()
{
pyinstaller ./bundledApps/WAIL.py --onefile --windowed --clean --icon="./build/icons/whale_1024.icns"
# Replace default version and icon information from pyinstaller
cp ./build/Info.plist ./dist/WAIL.app/Contents/Info.plist
# Copy the bundledApps and support directories to inside WAIL.app/
cp -r ./bundledApps ./support ./build ./config ./archives ./archiveIndexes ./dist/WAIL.app/
#pkgbuild --install-location=/Applications --component ./dist/WAIL.app ~/Downloads/WAIL.pkg
}

deleteBinary ()
{
rm -rf /Applications/WAIL.app
}

mvProducts ()
{
mv ./dist/WAIL.app /Applications/
mv ./dist/WAIL /Applications/WAIL_cli
}

cleanupByproducts ()
{
# Remove installation remnants
rm -r ./dist
rm -r ./build/WAIL
}

buildDiskImage ()
{
# Create a dmg
dmgbuild -s ./build/dmgbuild_settings.py "WAIL" WAIL.dmg
}

tweakOS ()
{
# Instruct the system to update the version string
defaults read /Applications/WAIL.app/Contents/Info.plist > /dev/null

# Associate defined file types with WAIL
/System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/LaunchServices.framework/Versions/A/Support/lsregister -f /Applications/WAIL.app
}

createBinary
deleteBinary # Remove previous version
mvProducts
cleanupByproducts

# install binary, create dmg, or both? (i/d/b)

# Just build dmg, delete binary, no system tweaks required
if [ $ans = "b" ] || [ $ans = "d" ]; then
buildDiskImage
if [ $ans = "b" ]; then
deleteBinary
fi
fi

pyinstaller ./bundledApps/WAIL.py --onefile --windowed --clean --icon="./build/icons/whale_1024.icns"

# Replace default version and icon information from pyinstaller
cp ./build/Info.plist ./dist/WAIL.app/Contents/Info.plist

# Copy the bundledApps and support directories to inside WAIL.app/
cp -r ./bundledApps ./support ./build ./config ./archives ./archiveIndexes ./dist/WAIL.app/

#pkgbuild --install-location=/Applications --component ./dist/WAIL.app ~/Downloads/WAIL.pkg

rm -rf /Applications/WAIL.app
mv ./dist/WAIL.app /Applications/
mv ./dist/WAIL /Applications/WAIL_cli

# Remove installation remnants
rm -r ./dist
rm -r ./build/WAIL

# Instruct the system to update the version string
defaults read /Applications/WAIL.app/Contents/Info.plist > /dev/null

# Associate defined file types with WAIL
/System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/LaunchServices.framework/Versions/A/Support/lsregister -f /Applications/WAIL.app
if [ $ans = "i" ] || [ $ans = "d" ]; then # Tweak system for binary
tweakOS
fi
#killall Finder

#cleanup
Expand Down
3 changes: 2 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
requests
wxPython
pystache
pystache
dmgbuild

0 comments on commit b12f45b

Please sign in to comment.