Skip to content

Commit

Permalink
improved package
Browse files Browse the repository at this point in the history
  • Loading branch information
grahampugh committed Feb 6, 2024
1 parent 6760129 commit 6d63be2
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 6 deletions.
4 changes: 3 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@ No date
- Remove searches for cached DMG and sparseimages.
- Add missing `--credentials=XYZ` option (previously only `--credentials XYZ` worked) (thanks @allanp81).
- Remove quotes from the value obtained from any inputted `--parameter="value"` option.
- Bump swiftDialog version to 2.4.0 except for systems running macOS 11 which still get 2.2.1. Note that the installer package includes version 2.4.0. If running on Big Sur, this will be deleted and an internet connection is required to download version 2.2.1.
- Bump swiftDialog version to 2.4.0 except for systems running macOS 11 which still get 2.2.1.
- The installer package now includes both swiftDialog 2.4.0 and 2.2.1, and the postinstall script determines which version to install on the system based on the system OS.
- NOTE: This also limits the package installation to macOS 11 and newer. If you wish to use erase-install on macOS 10.15 or older, it is recommended to use v27.3.

## [32.0]

Expand Down
10 changes: 9 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,18 @@ build:

@echo
swiftdialog_version=$$(awk -F '=' '/swiftdialog_version_required=/ {print $$NF}' $(CURDIR)/erase-install.sh | tr -d '"') ;\
swiftdialog_tag=$$(cut -d"-" -f1 <<< "$$swiftdialog_version") ;\
echo "## Downloading swiftDialog v$$swiftdialog_version" ;\
swiftdialog_url="https://github.com/swiftDialog/swiftDialog/releases/download/v$$swiftdialog_version/dialog-$$swiftdialog_version.pkg" ;\
swiftdialog_url="https://github.com/swiftDialog/swiftDialog/releases/download/v$$swiftdialog_tag/dialog-$$swiftdialog_version.pkg" ;\
curl -L "$$swiftdialog_url" -o "$(PKG_SCRIPTS)/dialog.pkg"

@echo
swiftdialog_bigsur_version=$$(awk -F '=' '/swiftdialog_bigsur_version_required=/ {print $$NF}' $(CURDIR)/erase-install.sh | tr -d '"') ;\
swiftdialog_bigsur_tag=$$(cut -d"-" -f1 <<< "$$swiftdialog_bigsur_version") ;\
echo "## Downloading swiftDialog v$$swiftdialog_version" ;\
swiftdialog_bigsur_url="https://github.com/swiftDialog/swiftDialog/releases/download/v$$swiftdialog_bigsur_tag/dialog-$$swiftdialog_bigsur_version.pkg" ;\
curl -L "$$swiftdialog_bigsur_url" -o "$(PKG_SCRIPTS)/dialog-bigsur.pkg"

@echo
mist_version=$$(awk -F '=' '/mist_version_required=/ {print $$NF}' $(CURDIR)/erase-install.sh | tr -d '"') ;\
echo "## Downloading mist-cli v$$mist_version" ;\
Expand Down
25 changes: 21 additions & 4 deletions pkg/erase-install/scripts/postinstall
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,28 @@
# current directory
DIR=$(dirname "$0")

# swiftDialog
if /usr/sbin/installer -tgt / -pkg "$DIR/dialog.pkg"; then
echo "swiftDialog successfully installed"
# swiftDialog - required version depends on macOS version
system_version=$( /usr/bin/sw_vers -productVersion )

# macOS 12 and greater uses the latest swiftDialog
system_os=$(/usr/bin/cut -d. -f 1 <<< "$system_version")

if [[ $system_os -ge 12 ]]; then
if /usr/sbin/installer -tgt / -pkg "$DIR/dialog.pkg"; then
echo "swiftDialog successfully installed"
else
echo "ERROR: swiftDialog was not installed"
exit 1
fi
elif [[ $system_os -eq 11 ]]; then
if /usr/sbin/installer -tgt / -pkg "$DIR/dialog-bigsur.pkg"; then
echo "swiftDialog (Big Sur version) successfully installed"
else
echo "ERROR: swiftDialog was not installed"
exit 1
fi
else
echo "ERROR: swiftDialog was not installed"
echo "ERROR: swiftDialog not compatible with this version of macOS"
exit 1
fi

Expand Down

0 comments on commit 6d63be2

Please sign in to comment.