Skip to content

Commit

Permalink
Updated upstream create-dmg to latest version (#10)
Browse files Browse the repository at this point in the history
  • Loading branch information
dylanratcliffe authored Apr 10, 2024
1 parent 06d3e32 commit 798a803
Show file tree
Hide file tree
Showing 20 changed files with 936 additions and 654 deletions.
263 changes: 142 additions & 121 deletions internal/createdmg/bindata/bindata.go

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion internal/createdmg/bindata/generate.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
package bindata

//go:generate bash -c "go-bindata -prefix '../../../vendor/create-dmg' -pkg bindata ../../../vendor/create-dmg/*"
//go:generate bash -c "go-bindata -prefix '../../../vendor/create-dmg' -pkg bindata ../../../vendor/create-dmg/* ../../../vendor/create-dmg/.this-is-the-create-dmg-repo"
19 changes: 19 additions & 0 deletions vendor/create-dmg/.editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# EditorConfig for create-dmg project
# EditorConfig is awesome: https://EditorConfig.org

root = true

[*]
end_of_line = lf
insert_final_newline = true
charset = utf-8

# We use tabs in our own code
[{create-dmg,*.applescript,*.sh}]
indent_style = tab
indent_size = 2

# But the Python code we pull in from pyhacker uses spaces
[*.py]
indent_style = space
indent_size = 4
1 change: 1 addition & 0 deletions vendor/create-dmg/.gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
.svn
.vscode

*.dmg
.DS_Store
2 changes: 2 additions & 0 deletions vendor/create-dmg/.this-is-the-create-dmg-repo
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
This is just a dummy file so create-dmg can tell whether it's being run from
inside the Git repo or from an installed location.
1 change: 1 addition & 0 deletions vendor/create-dmg/LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
The MIT License (MIT)

Copyright (c) 2008-2014 Andrey Tarantsov
Copyright (c) 2020 Andrew Janke

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
33 changes: 33 additions & 0 deletions vendor/create-dmg/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# Makefile for Cowsay

PACKAGE_TARNAME = create-dmg

prefix = /usr/local
exec_prefix = ${prefix}
bindir = ${exec_prefix}/bin
datarootdir = ${prefix}/share
datadir = ${datarootdir}
docdir = ${datarootdir}/doc/${PACKAGE_TARNAME}
sysconfdir = ${prefix}/etc
mandir=${datarootdir}/man
srcdir = .

SHELL = /bin/sh
INSTALL = install
INSTALL_PROGRAM = $(INSTALL)
INSTALL_DATA = ${INSTALL} -m 644

.PHONY: install uninstall

install: create-dmg
$(INSTALL) -d $(DESTDIR)$(prefix)
$(INSTALL) -d $(DESTDIR)$(bindir)
$(INSTALL_PROGRAM) create-dmg $(DESTDIR)$(bindir)/create-dmg
$(INSTALL) -d $(DESTDIR)$(datadir)/$(PACKAGE_TARNAME)
cp -R support $(DESTDIR)$(datadir)/$(PACKAGE_TARNAME)
cp -R examples $(DESTDIR)$(datadir)/$(PACKAGE_TARNAME)
cp -R tests $(DESTDIR)$(datadir)/$(PACKAGE_TARNAME)

uninstall:
rm -f $(DESTDIR)$(bindir)/create-dmg
rm -rf $(DESTDIR)$(datadir)/$(PACKAGE_TARNAME)
124 changes: 77 additions & 47 deletions vendor/create-dmg/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,18 @@ create-dmg

A shell script to build fancy DMGs.


Status and contribution policy
------------------------------

This project is maintained thanks to the contributors who send pull requests, and now (Sep 2018) with the help of [@aonez](https://github.com/aonez).
Create-dmg is mostly maintained by [@aonez](https://github.com/aonez) and the contributors who send pull requests.
The project home page is <https://github.com/create-dmg/create-dmg>.

We will merge any pull request that adds something useful and does not break existing things, and will often grant commit access to the repository.
We will merge any pull request that adds something useful and does not break existing things.

If you're an active user and want to be a maintainer, or just want to chat, please ping us at [gitter.im/create-dmg/Lobby](https://gitter.im/create-dmg/Lobby).
If you're an active user and want to be a maintainer, or just want to chat, please ping us on Gitter at [gitter.im/create-dmg/Lobby](https://gitter.im/create-dmg/Lobby), or [email Andrew directly](floss@apjanke.net).

Create-dmg was originally created by [Andrey Tarantsov](https://github.com/andreyvit).
In May 2020 [Andrew Janke](https://github.com/apjanke) helped vastly with the project.

Installation
------------
Expand All @@ -23,50 +25,63 @@ Installation
brew install create-dmg
```

- You can download the [latest release](https://github.com/andreyvit/create-dmg/releases/latest)
- You can download the [latest release](https://github.com/create-dmg/create-dmg/releases/latest) and install it from there:

```sh
make install
```

- You can also clone the entire repository:
- You can also clone the entire repository and run it locally from there:

```sh
git clone https://github.com/andreyvit/create-dmg.git
git clone https://github.com/create-dmg/create-dmg.git
```

Usage
-----

```sh
create-dmg [options...] [output\_name.dmg] [source\_folder]
create-dmg [options ...] <output_name.dmg> <source_folder>
```

All contents of source\_folder will be copied into the disk image.

**Options:**

* **--volname [name]:** set volume name (displayed in the Finder sidebar and window title)
* **--volicon [icon.icns]:** set volume icon
* **--background [pic.png]:** set folder background image (provide png, gif, jpg)
* **--window-pos [x y]:** set position the folder window
* **--window-size [width height]:** set size of the folder window
* **--text-size [text size]:** set window text size (10-16)
* **--icon-size [icon size]:** set window icons size (up to 128)
* **--icon [file name] [x y]:** set position of the file's icon
* **--hide-extension [file name]:** hide the extension of file
* **--custom-icon [file name]/[custom icon]/[sample file] [x y]:** set position and custom icon
* **--app-drop-link [x y]:** make a drop link to Applications, at location x, y
* **--ql-drop-link [x y]:** make a drop link to /Library/QuickLook, at location x, y
* **--eula [eula file]:** attach a license file to the dmg
* **--rez [rez path]:** specify custom path to Rez tool used to include license file
* **--no-internet-enable:** disable automatic mount&copy
* **--format:** specify the final image format (default is UDZO)
* **--add-file [target name] [path to source file] [x y]:** add additional file (option can be used multiple times)
* **--add-folder [target name] [path to source folder] [x y]:** add additional folder (option can be used multiple times)
* **--disk-image-size [x]:** set the disk image size manually to x MB
* **--hdiutil-verbose:** execute hdiutil in verbose mode
* **--hdiutil-quiet:** execute hdiutil in quiet mode
* **--sandbox-safe:** execute hdiutil with sandbox compatibility and don not bless
* **--version:** show tool version number
* **-h, --help:** display the help

- **--volname \<name\>:** set volume name (displayed in the Finder sidebar and window title)
- **--volicon \<icon.icns\>:** set volume icon
- **--background \<pic.png\>:** set folder background image (provide png, gif, jpg)
- **--window-pos \<x\> \<y\>:** set position the folder window
- **--window-size \<width\> \<height\>:** set size of the folder window
- **--text-size \<text_size\>:** set window text size (10-16)
- **--icon-size \<icon_size\>:** set window icons size (up to 128)
- **--icon \<file_name\> \<x\> \<y\>:** set position of the file's icon
- **--hide-extension \<file_name\>:** hide the extension of file
- **--app-drop-link \<x\> \<y\>:** make a drop link to Applications, at location x, y
- **--ql-drop-link \<x\> \<y\>:** make a drop link to /Library/QuickLook, at location x, y
- **--eula \<eula_file\>:** attach a license file to the dmg
- **--rez \<rez_path\>:** specify custom path to Rez tool used to include license file
- **--no-internet-enable:** disable automatic mount&copy
- **--format:** specify the final image format (UDZO|UDBZ|ULFO|ULMO) (default is UDZO)
- **--filesystem:** specify the image filesystem (HFS+|APFS) (default is HFS+, APFS supports macOS 10.13 or newer)
- **--encrypt:** enable encryption for the resulting disk image (AES-256 - you will be prompted for password)
- **--encrypt-aes128:** enable encryption for the resulting disk image (AES-128 - you will be prompted for password)
- **--add-file \<target_name\> \<file|folder\> \<x\> \<y\>:** add additional file or folder (can be used multiple times)
- **--disk-image-size \<x\>:** set the disk image size manually to x MB
- **--hdiutil-verbose:** execute hdiutil in verbose mode
- **--hdiutil-quiet:** execute hdiutil in quiet mode
- **--bless:** bless the mount folder (deprecated, needs macOS 12.2.1 or older, [#127](https://github.com/create-dmg/create-dmg/pull/127))
- **--codesign \<signature\>:** codesign the disk image with the specified signature
- **--notarize \<credentials>:** notarize the disk image (waits and staples) with the keychain stored credentials
For more information check [Apple's documentation](https://developer.apple.com/documentation/security/notarizing_macos_software_before_distribution/customizing_the_notarization_workflow)
- **--skip-jenkins:** skip Finder-prettifying AppleScript, useful in Sandbox and non-GUI environments, [#72](https://github.com/create-dmg/create-dmg/pull/72)
- **--sandbox-safe:** hdiutil with sandbox compatibility, do not bless and do not execute the cosmetic AppleScript (not supported for APFS disk images)
- **--version:** show tool version number
- **-h, --help:** display the help

Encryption
-------
hdiutil supports native disk image encryption using AES-256 (slower but stronger) or AES-128 (faster but weaker). Enabling disk image encryption via create-dmg will require the entry of the password during the middle (compression phase) of the process. Take care to enter the password correctly, because hdiutil will not prompt a second time to confirm the password.

Example
-------
Expand All @@ -75,22 +90,37 @@ Example
#!/bin/sh
test -f Application-Installer.dmg && rm Application-Installer.dmg
create-dmg \
--volname "Application Installer" \
--volicon "application\_icon.icns" \
--background "installer\_background.png" \
--window-pos 200 120 \
--window-size 800 400 \
--icon-size 100 \
--icon "Application.app" 200 190 \
--hide-extension "Application.app" \
--app-drop-link 600 185 \
"Application-Installer.dmg" \
"source_folder/"
--volname "Application Installer" \
--volicon "application_icon.icns" \
--background "installer_background.png" \
--window-pos 200 120 \
--window-size 800 400 \
--icon-size 100 \
--icon "Application.app" 200 190 \
--hide-extension "Application.app" \
--app-drop-link 600 185 \
"Application-Installer.dmg" \
"source_folder/"
```

See the `examples` folder in the source tree for more examples.

Requirements
------------

Nothing except a standard installation of macOS/OS X is required.

We think this works in OS X 10.6 Snow Leopard and later.

We'd like to keep it working in as many versions as possible, but unfortunately, we just don't have test boxes running old versions of OS X adequate to make this happen. Development and testing mostly happens in the last 3-5 years' worth of macOS releases; as of 2020, this means macOS 10.12 and later.

But if you find a bug in an older version, go ahead and report it! We'll try to work with you to get it fixed.

If you're running OS X 10.5 or earlier, you're SOL. That's just too hard to deal with in 2023. ;)

Alternatives
------------

* [node-appdmg](https://github.com/LinusU/node-appdmg)
* [dmgbuild](https://pypi.python.org/pypi/dmgbuild)
* see the [StackOverflow question](http://stackoverflow.com/questions/96882/how-do-i-create-a-nice-looking-dmg-for-mac-os-x-using-command-line-tools)
- [node-appdmg](https://github.com/LinusU/node-appdmg)
- [dmgbuild](https://pypi.python.org/pypi/dmgbuild)
- see the [StackOverflow question](http://stackoverflow.com/questions/96882/how-do-i-create-a-nice-looking-dmg-for-mac-os-x-using-command-line-tools)
Loading

0 comments on commit 798a803

Please sign in to comment.