Skip to content

Commit

Permalink
2.4.1
Browse files Browse the repository at this point in the history
  • Loading branch information
Graham Pugh committed Oct 5, 2023
1 parent ae33cc6 commit d3e4cb4
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 7 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,13 @@

No date

## [2.4.1]

05.10.2023

- Force-close Software Settings if open after the timeout period expires.
- Update for compatibility with swiftDialog 2.3.2.

## [2.4]

23.06.2023
Expand Down
4 changes: 2 additions & 2 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
identifier="com.github.grahampugh.nice_updater"

# Default version of the build, you can leave this alone and specify as an argument like so: ./build.sh 1.7
version="2.4"
version="2.4.1"

# The title of the message that is displayed when software updates are in progress and a user is logged in
updateRequiredTitle="macOS Software Updates Required"
Expand Down Expand Up @@ -38,7 +38,7 @@ startIntervalMinute="0" # valid is 0-59. Do not leave blank - set as 0
alertTimeout="3540"

###### Variables below this point are not intended to be modified #####
SWIFTDIALOG_URL="https://github.com/bartreardon/swiftDialog/releases/download/v2.2.1/dialog-2.2.1-4591.pkg"
SWIFTDIALOG_URL="https://github.com/bartreardon/swiftDialog/releases/download/v2.3.2/dialog-2.3.2-4726.pkg"
mainDaemonPlist="/Library/LaunchDaemons/${identifier}.plist"
mainDaemonFileName="${mainDaemonPlist##*/}"
mainOnDemandDaemonPlist="/Library/LaunchDaemons/${identifier}_on_demand.plist"
Expand Down
14 changes: 9 additions & 5 deletions nice_updater.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/bash

# Nice Updater 2
version="2.4"
version="2.4.1"

# These variables will be automagically updated if you run build.sh, no need to modify them
preferenceFileFullPath="/Library/Preferences/com.github.grahampugh.nice_updater.prefs.plist"
Expand All @@ -28,7 +28,7 @@ dialog_log=$(/usr/bin/mktemp /var/tmp/dialog.XXX)

# URL for downloading dialog (with tag version)
# This ensures a compatible dialog is used if not using the package installer
dialog_download_url="https://github.com/bartreardon/swiftDialog/releases/download/v2.2.1/dialog-2.2.1-4591.pkg"
SWIFTDIALOG_URL="https://github.com/bartreardon/swiftDialog/releases/download/v2.3.2/dialog-2.3.2-4726.pkg"

# set default icon if not included in build
if [[ "$iconCustomPath" == "/Applications/Self Service.app" ]]; then
Expand Down Expand Up @@ -65,7 +65,7 @@ check_for_dialog_app() {
writelog " [check_for_dialog_app] dialog is installed ($dialog_app)"
else
writelog " [check_for_dialog_app] Downloading swiftDialog.app..."
if /usr/bin/curl -L "$dialog_download_url" -o "$workdir/dialog.pkg" ; then
if /usr/bin/curl -L "$SWIFTDIALOG_URL" -o "$workdir/dialog.pkg" ; then
if ! /usr/sbin/installer -pkg "$workdir/dialog.pkg" -target / ; then
writelog " [check_for_dialog_app] dialog installation failed"
fi
Expand Down Expand Up @@ -164,10 +164,14 @@ open_software_update() {
timecount=0
while kill -0 "$suPID" 2> /dev/null; do
sleep 1
# set a maximum time that Software Update can be open before invoking another dialog
# set a maximum time that Software Update can be open before killing System Settings and invoking another dialog
((timecount++))
if [[ $timecount -ge 3600 ]]; then
break
if pgrep "System Settings"; then
pkill "System Settings"
elif pgrep "System Preferences"; then
pkill "System Preferences"
fi
fi
done
if [[ $timecount -ge 3600 ]]; then
Expand Down

0 comments on commit d3e4cb4

Please sign in to comment.