Creating a Simple Installer for OS X - xcode

I am quite new to Apple development for MAC OS X. I have a simple project that i wish to distribute as a DMG. I am new to this so don't know where to go from here
The application core that does performs the main application
A installer plugin
How do i create a DMG file from the installer plugin. How do i tie up my main application into the installer plugin. I am new, so a few pointers will be very helpful.
Kind Regards

You can create a DMG using Disk Utility (found in /Applications/Utilities/) the process is very simple. You can read a little bit about "Distributing your Application" in this Apple Developer Library document.
As shown here, creating it is pretty easy:
You will notice that when I created the DMG initially it's set to a "read/write" format. After you've added your application, read me's, disk icon's and any artwork you can then convert it to a "read-only" DMG file.
Personally, though, I've been a long time user of DropDMG which makes the process much simpler (n.b. I have no affiliation with C-Command other they licensing DropDMG).

Related

How to generate an installer package for Mac app?

How can I create a single installer package for an OS X binary as well as a few configuration and script files?
Final folders should look like this:
Any help would be appreciated. Thanks.
Installers are great if you want various things to be placed in different spots – app here, documentation there, support files over here, etc. They're also great for providing configurability of the installation experience (optional extras), or hand-holding for an unusual type of installation that the user might not otherwise understand, or extra work (configuration scripts, permissions modifications, authentication, compatibility checking, etc.) that need to run during the installation process. There is nothing wrong with installers, contrary to the answer from #d00dle, although there is also nothing wrong with distributing your app through the App Store, or as a dmg.
For setting up your own installers, I highly recommend a program called Packages (http://s.sudre.free.fr/Software/Packages/about.html). I am in no way connected to it, but I use it to build the installer for an app that I work on. It greatly smoothes the process of making a complex installer, and has an excellent GUI interface.
There's also macOS Installer Builder, which is a CLI you can use to create an installer wizard for your .pkg: https://github.com/KosalaHerath/macos-installer-builder
macOS does not normally use installers. Applications are packaged in app containers with the extension .app. This container is "executable" but you're also able to dig in and see what is inside. This is also the format distributed through App Store.
You can create .pkg or .dmg "installers" if necessary, however this is clearly not something apple aims to be standard. I would advise to use the .app pattern and any scripts needed should be self contained and executed on first run.
You can use .dmg to distribute your application outside of App Store (this is still fairly normal).
macOS also includes a terminal program called productbuild that builds a product archive for the macOS Installer or the Mac App Store. Enter man productbuild into the Terminal on a Mac for the manual page.

Auto-update .dmg on mac

As i am newbie on mac and .dmg for me is a black box. And i don't know is it possible rewrite some files in it like on Windows.
Someone can explain how user can update my app for one click: "There new version available. Do you want to install it now?" - [OK] [Cancel]
A .dmg container is read-only (typically, you can make them writable though). The recommended behaviour with an OS X application is to do one of two things:
Put a note in the .dmg to move the application to Applications (see: Creating nice dmg "installer" for Mac OS X)
Auto-move the Application on first run, however you need to be incredibly explicit to the user about what's happening and where they need to go to load the application in future.
I always go for option 1, it's clear and concise and there's a wealth of other software that go for it so it's understood by most OS X users.
In terms of doing an autoupdate, once it's in the user filesystem you can do it a number of ways. There's the Sparkle Framework, you can build a simple HTTP request service to grab the new .app bundle and copy it into place and then restart. Sparkle is good, well tested and very popular for OS X autoupdating, if you're going cross-platform then build the HTTP service.

Automating Application installation in Mac

I want to Automate the process of Installing the software which is downloaded and saved in some location. Pls explain me how to automate this process thru Applescript
Typically, a developer makes a disk image, a .dmg file using "Disk Utility.app" and then either:
Have an alias to the Application folder and has the end-user drag and drop from the disk image into the Application folder.
or
Have a disk image or some other means of delivering the executable and has an installer made with Apple's "PackageMaker.app" application. PackageMaker.app isn't distributed with Apple's Developer Tools anymore (inside of XCode.app) rather, PackageMaker.app is a separate download, available at the following URL.
Using PackageMaker.app is the preferred way of developing an installer since it's what users are used to and has a number of features that make it easier to develop an installer than developing one from scratch:
Link to Apple's Developer Tools:
https://developer.apple.com/downloads/index.action
Use the above link and then search for "PackageMaker" (with no space) and take the most recent version available.

How do I include one application inside another?

Our .app download includes a tool (another, smaller, app) with it that we'd like to allow users to run from the "Applications" folder, but we don't want them to have to download more than one file.
Is there a way to include one .app inside another that will result in the OS automatically adding both of them to the Applications folder when the user drags and drops it in there from the dmg file we distribute? Or would we have to use a package that extracts two separate applications?
Thanks for your help.
I don't think that apps bundled inside other apps (i.e. helper apps) would show up in Mac OS X's (Lion) Launch Pad. Much less from the Finder for end-users.
Apple distributes Xcode through the Mac App Store and it has many apps : Xcode, Intruments, Quartz Composer, etc. Perhaps downloading an installer from the Store (as is done with Xcode) would be an option for you.
I realize it's an extra step for the user but I don't see how you can bundle multiple distinct apps in the App Store.
Aside from that, perhaps offer each software as a seperate download. Or revisite if the apps actually do need to be their own islands. Good luck!

Application updates in Mac OS X

To provide application updates in Windows, we can simply download the installer and run it. Applications are installed in %PROGRAMFILES% and shortcuts are placed in various places. Keys and values are added to the registry to provide an entry in the system's Programs list.
To provide application updates in Linux, we can use the system's package manager.
How do you provide application updates in Mac OS X? I think in general you simply drag .app bundles to /Applications? Does the system provide any sort of registry other than "look in /Applications folder"? Should the general flow of updating simply involve downloading an opening a DMG file, prompting the user to drag the new application bundle into /Applications? Will copying an app bundle to a folder delete the existing bundle before copying, or does it act like a normal folder (e.g. add and replace existing files)? I'd just like some general information on how I know go about implementing a 'check for updates' feature consistent with what's expected for a Mac OS X application.
It sounds like you should look into Sparkle.
In my experience as a Mac user (not a Cocoa dev), it's become the de facto standard for self-updating apps, save for a few monoliths like Microsoft Office and Adobe CS.

Resources