macapp

package
v0.2.72 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 14, 2024 License: BSD-3-Clause Imports: 17 Imported by: 0

README

DMG

https://medium.com/@mattholt/packaging-a-go-application-for-macos-f7084b00f6b5

Making a template DMG

The template need only be made once, which is good because it’s hard to automate this and get nice results.

Open Disk Utility. Press ⌘N to create a new disk image. Give it a name and a size that is large enough to fit your app bundle:

Go to your mounted image in Finder.

Customize the view settings for this folder so that it looks just the way you want when users mount their DMG to install your application. Consider setting a background image, hiding the toolbar and sidebar, and increasing the icon size.

NOTE: A background image must be contained within the DMG itself. This is usually done in a folder called .background. Because it starts with a dot, it will be hidden from view. Put the background image in there, and set it by dragging it into the View Options:

You’ll also need a shortcut (“alias”) to the /Applications folder in your DMG for convenience. You can right-click your own /Applications folder and choose “Make alias” then move it into your mounted image.

Finish customize the view

Now we just have to add our app bundle into the DMG and finish customizing the view:

Great! Our template DMG is all set up. Now we can get it ready to distribute.

Converting the DMG for distribution

The current DMG is not compressed and is writeable. That’s not ideal for distributing an application, so we’ll fix that by converting it.

Open Disk Utility and choose Images → Convert.

Name the file something presentable, and leave the rest of the settings the same. (Image format should be “compressed”.)

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateMacAppBundle

func CreateMacAppBundle(options *MacAppOptions, outputDir string) (appBundle string, err error)

Types

type MacAppBuilder

type MacAppBuilder struct {
	// contains filtered or unexported fields
}

func NewMacAppBuilder

func NewMacAppBuilder(args ...interface{}) (instance *MacAppBuilder, err error)

func (*MacAppBuilder) Build

func (instance *MacAppBuilder) Build(outputDir string) (appBundle string, err error)

type MacAppOptions

type MacAppOptions struct {
	Name        string `json:"name"`       // App name
	Author      string `json:"author"`     // App Author name
	Version     string `json:"version"`    // App Version
	Identifier  string `json:"identifier"` // bundle identifier
	Icon        string `json:"icon"`       // icon image file (.icns|.png|.jpg|.jpeg)
	Executable  string `json:"executable"` // path to exec file
	IsAgent     bool   `json:"is-agent"`   // only if app is an agent service not to store in dock
	TemplateDMG string `json:"template-dmg"`
}

func NewMacAppOptions

func NewMacAppOptions(args ...interface{}) (instance *MacAppOptions, err error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL