Pages: 1
  Print  
Author Topic: Creating an Application Bundle for your macOS Distribution  (Read 1284 times)
Offline (Male) time-killer-games
Posted on: July 22, 2018, 01:27:51 am

Contributor
Location: Virginia Beach
Joined: Jan 2013
Posts: 1178

View Profile Email
Introduction

By default, ENIGMA does not export an application bundle for you; it just creates an executable.

Normally how apps are distributed, whether inside or outside the Mac App Store, an App Bundle is required.

It also enables you to add an application icon to your game, version and copyright information, package dependencies and resources, etc. It is just convenient to have overall anyway so in this topic I will be going over how to create this App Bundle.

Step 1: Download the App Bundle Template

Good news! I did most of the work for you already.

Download this ZIP archive: https://www.dropbox.com/s/jfwjei6nmoumo7t/Tiny%20File%20Dailogs.zip?dl=0

Once you have that file, open it it in the default program macOS has and it should extract to the same directory automatically.

Step 2: Edit the Info.plist File

In the folder you just extracted, you will see a sample app I built that demonstrates the different functions that come with the Tiny File Dialogs widget system. The contents of this app will be completely replaced with the contents of your application and its associated files.

But for starters, let's take a look at that Info.plist.



Right click on "Tiny File Dialogs.app" -> click "Show Package Contents".

This should look like the image below:



Now you'll see a "Contents" folder, open that...



Now we found the Info.plist. Yay!



Right click "Info.plist" -> open it with Xcode.



Now what you see is Xcode's PLIST file editor:



In the screenshot above, I recommend editing everything except for the last two lines at the bottom.

The two places where you see "Tiny File Dialogs" can be replaced with your game's title.

The two places where you see "1.0.0.0" can be changed to whatever version number you want for your game.

The Bundle ID "org.samuelvenable.tinyfiledialogs" can be replaced with your own.

I recommend using either "org" or "com" before the first period. Between the two periods you want either your real name, user name, company name, w/e your author name. After the second period you want the title of your game typically. Don't use spaces for this string. If you really want something that is at least close to spaces, use dashes or underscores.

Here's some example Bundle ID's:

com.companyname.gametitle
org.authorname.gametitle
com.time-killer-games.key_to_success

...and so on.

Change the copyright to your copyright. This I really shouldn't have to explain at this point.

Step 3: Replace Game Executable and Icon Files

Go back to your extracted ZIP Finder window, and you will also see in the "Contents" folder, a folder named "MacOS":



Open "MacOS" and you will see a file named "executable", as seen below:



As you can see for yourself by trying to open "executable" - this is my Tiny File Dialogs example game. Replace this file with your game executable that was built with ENIGMA. Make sure it has the same file name, otherwise you will need to go back and change the "Executable file" slot in the Info.plist file, so that they match.

If your game is not statically linked with its dependencies, you will need to include any DYLIB files that you rely on in the same "MacOS" folder as your executable.

Same goes for any "Included Files" or externally loaded sprites, sounds, scripts, text files, INI, and other external resources you might have - make sure they are all put in this directory so they may be read by your game.

Now for the icon.

Go back up a directory and you'll be in "Contents" again. You'll see a folder named "Resources" like the one in the screenshot below:



Open the "Resources" folder.

Now you'll see the game's icon -  replace this with your own icon file, simply create a PNG in your favorite drawing program with a standard resolution of 256 x 256 pixels, and convert it to an ICNS file using some downloadable or online converter - I recommend downloading the software available at www.iconverticons.com or using their online converter.

Just like the executable file, make sure your icon has the same file name as the original, "icon.icns", otherwise you will need to edit the "Icon file" textfield in the Info.plist file, so that it matches the new name you gave it.



Conclusion

And that's pretty much it. You are now ready to distribute your app. Just don't forget to rename "Tiny File Dialogs.app" to your desired file name.

Note: In the first 2 screenshots at the top, "Tiny File Dialogs.app" does not have the correct icon, this is because sometimes due to a bug with macOS, icons will not update like they are supposed to automatically.

I hope this is of any use to my fellow Mac users.
Samuel
« Last Edit: August 24, 2018, 01:39:54 am by time-killer-games » Logged
Pages: 1
  Print