The following acts as a tutorial and a reference checklist for preparing your build for release and packaging for deployment. It covers a checklist of things for your config files, preparing and converting an icon for your executable, and finally how to create a disk image with an “installer”.
Texture = ../../data # ./data
Prepare up the following suggested folder structure, eg:
My Game Application Contents MacOS Resources
Under MacOS, drop in your executable, liborx.dylib, and starting ini file.
Ensure your executable is named the same as the root folder name, eg: “My Game Application” (without quotes) Also ensure your starting .ini is using the same name so the executable can pick it up, eg: “My Game Application.ini” (without quotes)
Under the Resources subfolder, drop in your data assets and any other ini files.
Make sure all config paths and resource paths are correct, by loading your executable and ensuring it all runs fine.
You will need to create an icns file, which is a file that can contain one or more icons of varying sizes. Get a PNG image that you would like to use.
A new file called icon.icns will be created.
Rename this file in the same format of the application, eg: “My Game Application.icns” (without quotes).
Copy the file to Resources folder.
Package information is a way to add metadata into your application which identifies the name of the game, author, versions etc etc etc.
Create a Pkginfo file under the Contents folder. Add the following literal text to the file:
APPL????
Create another file in the Contents folder called: Info.plist
Paste in the following and change the string values to what suits your application:
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0"> <dict> <key>BuildMachineOSBuild</key> <string>13A561</string> <key>CFBundleDevelopmentRegion</key> <string>English</string> <key>CFBundleExecutable</key> <string>My Game Application</string> <key>CFBundleGetInfoString</key> <string>1.0, Copyright © 2014-2015, Mr Developer.</string> <key>CFBundleHelpBookFolder</key> <string>My Game Application.help</string> <key>CFBundleHelpBookName</key> <string>net.somedomain.somesubdomain.help</string> <key>CFBundleIconFile</key> <string>My Game Application.icns</string> <key>CFBundleIdentifier</key> <string>net.somedomain.somesubdomain.somesubsubdomain</string> <key>CFBundleInfoDictionaryVersion</key> <string>1.0</string> <key>CFBundleName</key> <string>My Game Application</string> <key>CFBundlePackageType</key> <string>APPL</string> <key>CFBundleShortVersionString</key> <string>1.0</string> <key>CFBundleSignature</key> <string>????</string> <key>CFBundleVersion</key> <string>123</string> <key>DTCompiler</key> <string>net.apple.compilers.llvm.clang.1_0</string> <key>DTPlatformBuild</key> <string>5A11344p</string> <key>DTPlatformVersion</key> <string>GM</string> <key>DTSDKBuild</key> <string>13A561</string> <key>DTSDKName</key> <string></string> <key>DTXcode</key> <string>0500</string> <key>DTXcodeBuild</key> <string>5A11344p</string> <key>LSApplicationCategoryType</key> <string>public.app-category.arcade-games</string> <key>LSApplicationSecondaryCategoryType</key> <string>public.app-category.simulation-games</string> <key>LSHasLocalizedDisplayName</key> <true/> <key>LSMinimumSystemVersion</key> <string>10.8.0</string> <key>NSMainNibFile</key> <string>My Game Application</string> <key>NSPrincipalClass</key> <string>NSApplication</string> <key>NSSupportsSuddenTermination</key> <true/> </dict> </plist>
Here is a handy guide to cover the keys above: https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html#//apple_ref/doc/uid/TP40009249-SW1
And wikipedia will help you locate values for your BuildMachineOSBuild
value. Start at: https://en.wikipedia.org/wiki/MacOS#Release_history and look under the “Most Recent Version” column to get a version code.
Create another file under the Contents folder called: version.plist. Paste in the following and change the string values to what suits your application:
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0"> <dict> <key>BuildVersion</key> <string>1</string> <key>CFBundleShortVersionString</key> <string>1.0</string> <key>CFBundleVersion</key> <string>1.0</string> <key>ProjectName</key> <string>My Game Application</string> <key>SourceVersion</key> <string>1</string> </dict> </plist>
Rename the “My Game Application” to “My Game Application.app”
Your icon should appear on the application and it will appear as a single file.
Double click on the Application file to check that the application launches fine.
In order to distribute your game, you'll need to turn the “My Game Application.app” folder structure into a disk image.
Open
button.Rather than an empty window with your icon, you can change this window to be more like an installer, giving the user instructions on how to install your game to onto the player's Mac.
Start with a background image like the following:
Save this image as: mac-installer-background.png.
Close the terminal, and any open windows to the “My Game Application” volume and then Eject it.
Finally, you need to compress the image to make it smaller, and no longer writable.
Disk Utility
application.The result is a compressed “My Game Application.dmg” disk image that can now be mounted and tested. A user can download this file, drag the game application into the Applications folder, and then throw the DMG away.
There are a number of other things you might like to consider when packaging your release.
Icons: when trying to make the icon.ics file, you may receive the following:
'icon' resource error: 'Failed to load image at 16@1x.
'
If so, you can probably ignore these warnings. Check that icon.ics
file was created anyway, and contains the icons you specified.
Application error: When running your *.app file, and you receive a: You can't open the application because it may be damaged or incomplete.
Ensure that your *.app folder name matches your key name which matches your actual executable filename.
Converting DMG: If you receive an error during Disk Utility converting, ensure that the original dmg is unmounted.