create DMG installer

I've written an application that allows me to make a Time Machine backup of my Mac at night (1AM). I've now tested this for almost a full year on various machines. However, now I want to roll this our further as quite a few people have expressed an interest.


Currently I install this completely manually

  • copy the files to the right location on my macbook
  • set rights properly
  • run some sudo commands
  • etc.

I can put this into a script as well to further automate this, but ideally I'd like to distribute it further by creating a DMG with two buttons: install and uninstall. It will be more user friendly and easier to distribute but I have no clue how to do this. Can this be done and if so, how?

Thanks in advance

MacBook Air, macOS 13.1

Posted on Jan 12, 2023 4:19 AM

Reply
Question marked as Top-ranking reply

Posted on Jan 12, 2023 9:18 AM

DMGs don't have "install" and "remove" buttons like that.


Usual approach is an app bundle (the app bundle then distributed in a DMG), as that app bundle gets dragged from the DMG into Applications and does its thing, can have launchd scripts to automate tasks, and—when no longer required—the app bundle can be deleted with all its accoutrements.


Packages and Bundles intro: About Bundles


The App would perform whatever setup is required at first launch, and would probably have an uninstall button or an embedded uninstall script within the bundle if the app changes are more pervasive.


The DMG will usually require an Apple Developer ID, and particularly on Apple silicon.


Distributing software on macOS - Apple Developer


While there are cases where this usage is necessary, I'd prefer to avoid packages. This because removing those and their changes can get gnarly. Keeping everything in the bundle and isolating or avoiding changes elsewhere is preferable.


For a product that does backups and a whole lot more, see Carbon Copy Cloner.


Similar questions

5 replies
Question marked as Top-ranking reply

Jan 12, 2023 9:18 AM in response to MV1969

DMGs don't have "install" and "remove" buttons like that.


Usual approach is an app bundle (the app bundle then distributed in a DMG), as that app bundle gets dragged from the DMG into Applications and does its thing, can have launchd scripts to automate tasks, and—when no longer required—the app bundle can be deleted with all its accoutrements.


Packages and Bundles intro: About Bundles


The App would perform whatever setup is required at first launch, and would probably have an uninstall button or an embedded uninstall script within the bundle if the app changes are more pervasive.


The DMG will usually require an Apple Developer ID, and particularly on Apple silicon.


Distributing software on macOS - Apple Developer


While there are cases where this usage is necessary, I'd prefer to avoid packages. This because removing those and their changes can get gnarly. Keeping everything in the bundle and isolating or avoiding changes elsewhere is preferable.


For a product that does backups and a whole lot more, see Carbon Copy Cloner.


Jan 12, 2023 9:19 AM in response to MV1969

There are two popular installer types. Unless you know better than everyone else, it might be a good idea to go with the tried and trusted methods that users expect.

  1. The .dmg with the self-contained app and and alias to the Applications folder (drag-and-drop install),
  2. The .pkg (in .zip or .dmg) with a guided installer, which allows scripting and authentication.



How to create drag to applications folder in dmg - Stack Exchange

Create installer package .pkg - Apple Developer Forums

Jan 13, 2023 4:28 AM in response to MrHoffman

Thanks for the reply.

I am familiar with CCC but it does not meet the requirements. It's beyond the scope of this post to highlight why I created my own solution. Core issue I'm trying to resolve is to make it possible to roll this out easier over many MacBooks in the same network.


Indeed the objective is to make install, and uninstall, as convenient as possible. I hate it myself when apps do an incomplete uninstall, so a clean solution with easy install AND uninstall is definitely preferred.

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

create DMG installer

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.