I have build a flat package installer (meaning it is just a single pkg file) for Mac. Normally Mac installers are distributed inside a disk image (dmg) file. I know how to create a dmg file containing the pkg file, but I am wondering if this is necessary. Is there are reason why it is better to distribute the installer inside a disk image?
Mac applications are often distributed as DMG, but that was mostly because Mac .app bundles are really a directory tree, not a single file. If you have a single-file .pkg, it is probably fine to distribute as-is.
Note: in earlier versions of OS X this was true of .pkg also, but it has not been the case for some time, .pkg are now single file xar archives.
Related
As DMG and PKG both are widely used for installation in Mac OSX. I have seen many DMG in the last decade, now I see more PKGs.
I need to ship an app that is around 100 MB, I am not sure what installation style should I choose.
So why people moved to PKGs from DMGs?
Is there any Apple documentation that says what and when to use?
If you need to run some scripts pre or post installation of your app, then pkgs need to be used. If you just need the app to be copied to Dmg
I am completely new to Mac OS and I have an application written in .Net Core codebase. Now all I want is to get it installed on Mac OS machines. My question is how can I create an installer (.DMG) file? At the moment My Visual Studio on Windows has created a .dll file with all other dependencies in the folder. Also for now most of the configuration values I have hard-coded but in the release build it has to be chosen by an end-user. So how can I prompt them for required directories? If you can provide me a link for documentation tool or any kind of suggestion would be greatly appreciated. At the moment if I want to run my application on Mac I have to use Terminal and then dotnet myApplication.dll in order to run application. My end goal would be to ask user for all required file paths and at the end create a System level Daemon (similar to windows service) to keep it always Alive. Would Xcode help in this situation? I already tried to open my .Net core project using xcode but it failed to load saying unsupported proect type.
Thanking in advance for your help!
If you wanted to use the standard macOS Installer to distribute your .net Core app, you would need to create a .pkg file. There seem to be ways to do this on the console or with Third Party Tools
sudo pkgbuild -install-location /Applications -component /path/to/your/application ./Desktop/YourPackage.pkg
There is an older manpage for pkgbuild, or you can try running man pkgbuild on your Mac.
I haven't tried this, but creating a .pkg is the normal way to install stuff on a Mac for applications where you can't just drag/drop the .app into the Application folder. (macOS applications are actually Directories with a special structure)
A .DMG is just a disk image - it doesn't "do" anything, it's just a container for files. You can create one with Disk Utility.
I already cross-compiled my program for Windows, I now have an EXE and a directory which must reside alongside that EXE in the same directory.
So I need to create an MSI, that places them in the appropriate place (whatever that is) and handles the uninstall too, in a way that is organic with the operative system.
There are Windows tools that do just that, but I haven't been able to find any for OS X. Is there any?
tl;dr:
I am on OS X
I cross-compiled my program for Windows
using OS X, I need to create an installer for Windows, such as an MSI
I DO NOT need to create an installer for OS X, such as a DMG or whatever. I need to create an installer -->FOR<-- Windows, such as an MSI.
I just "happen" to be trying to use OS X to do it.
Using Wine only counts if that program is known to run fine with Wine.
Using a Virtual Machine doesn't count since it is using Windows, which is what I ruled out in this question.
It seems that msi-packager is your solution.
"Build MSI (Windows Installer) packages on Mac and Linux."
https://www.npmjs.com/package/msi-packager
Would it be acceptable to create an EXE-based installer instead of an MSI?
I use InstallBuilder to build installers on OS/X. InstallBuilder is a cross-platform program. There is a version that runs on OS/X and builds both EXE installers for Windows (though I have not tried that combination), as well as DMG/APPs for OS/X.
The InstallBuilder documentation mentions that it cannot build MSIs, because InstallBuilder provides functionality for which there is no equivalent in MSI.
I suggest installing InstallBuilder on your Mac, selecting "Windows" as your output format, and see what happens.
InstallBuilder is one of the better installer builders that I've worked with. It's powerful and comprehensive. Not cheap though. At $995, it's till cheaper than spinning your wheels with WiX. There is a free trial version.
Although WiX is not available for OSX, there's a port of it using the wine library. You can find it in msitools as wixl which can easily installed through brew.
brew install msitools
It sounds like you're looking for the DMG Installer specification for Mac. It's a similar function as MSI in that it is a single file containing the install components needed for an app.
Keep in mind that Mac OSX apps are very different. They are more similar to Windows directories than EXE's. They contain a sub-folder structure which includes the components of the app. If you right click on a Mac app and select "Show Package Contents" you will see a "Contents" top tier folder with everything underneath the app. Just mentioning that as it greatly impacts the lack of need for an uninstall as you simply highlight an app and click delete to remove it and all of its components. There are exceptions of course, but Mac users appreciate when dev's stick to this format.
For DMG this link may help: Demystifying the DMG
I need your help in choosing a Mac OS X installer version for my application, since I'm not a native Mac user (I am a Windows user).
As far as I know there are two popular installer versions: the regular setup wizard, and the one that uses a window in which you drag the file into the applications folder. Which is preferred and why?
If your application is entirely self contained with all its resources bundled in a single .app package (which is the preferred structure for Mac applications) then use drag and drop installation. If it isn't possible to bundle your application in this way then use an installer .pkg.
There may be other solutions that are appropriate for certain types of application. For example I develop a large Java application that runs on many platforms (including Mac) and we use IzPack to build one installer JAR that works on all platforms. We then package this up as an .exe for Windows users (using Launch4J) and as a .app bundle for Mac users.
If you are not familiar with command line tools or simply not inclined, I would recommend two different IDEs:
Packages - a free and great way to create OSX Installer packages. It is simple to use out of the box, but has great depth for conditional installs.
http://s.sudre.free.fr/Software/Packages/about.html
DMGPackager - shareware - a simple app to create DMG with optional backgrounds, licenses etc.
http://www.skoobysoft.com/utilities/dmgp.html
If you want to distribute, it would be best to sign the installer.
I am new to MAC environment.
Is there any way that I can convert classic MAC app file so that it can be read on MAC OS X?
Also, is there any good tutorial for how to write .app file for a JAVA application.
Thanks
Support for classic mode ( runs older mac software was dropped with 10.5). If you search for classic mode you can find some emulators/virtual machines which may run classic apps. I have not tried any of these.
.app is not a file format. It is actually a directory with a defined structure. If you show contents on an app from finder, you can browse this contents of the directory.
As for putting an jar file in an .app bundle, check the help for Jar Bundler. It is included with XCode and can be found under Developer/Applications/Utilites. This utility turns a jar app into a .app bundle.