3 Commits

Author SHA1 Message Date
Søren Theilgaard
b42bd7e408 Trapping the script
Using these signals:
```
SIGHUP SIGINT SIGQUIT SIGABRT SIGTERM SIGTSTP
```

Fixed #272
2022-02-08 13:11:08 +01:00
Armin Briegel
aea7d282fe updated contributing.md 2022-02-08 11:13:03 +01:00
Armin Briegel
cd6b1397c8 updated version 2022-02-08 10:50:55 +01:00
6 changed files with 43 additions and 6 deletions

View File

@@ -1,4 +1,9 @@
## v9?
## v10
- Now we trap the script, so if it is cancelled, we will run cleanupAndExit anyway, and have mounted diskimages unmounted and temporary files and folders removed.
-
## v9
- We have moved the root check to the beginning of the script, and improved DEBUG handling with two different modes. `DEBUG=0` is still for production, and `1` is still for the DEBUG we previously knew downloading to the directory it is running from, but `2` will download to temporary folder, will detect updates, but will not install anything, but it will notify the user (almost as running the script without root before).
- Added option to not interrupt Do Not Disturb full screen apps like Keynote or Zoom with `INTERRUPT_DND="no"`. Default is `"yes"` which is how it has worked until now.
@@ -7,7 +12,7 @@
- New variable `RETURN_LABEL_NAME`. If given the value `1`, like `RETURN_LABEL_NAME=1` then Installomator only returns the name of the label. It makes for a better user friendly message for displaying in DEPNotify if that is integrated.
- Changed logic if `IGNORE_APP_STORE_APPS=yes`. Before this version a label like `microsoftonedrive` that was installed from App Store, and that we want to replace with the “ordinary” version, Installomator would still use `updateTool`, even though `IGNORE_APP_STORE_APPS=yes`. So we would have to have `INSTALL=force` in order to have the app replaced, as `updateTool` would be used. But now if `IGNORE_APP_STORE_APPS=yes` then `updateTool` will be not set, and the App Store app will be replaced. BUT if the installed software was not from App Store, then `updateTool` will not be used, and it would be a kind of a forced install (in the example of `microsoftonedrive`), except if the version is the same (where installation is skipped).
- Added variable `SYSTEMOWNER` that is used when copying files when installing. Default `0` is to change owner of the app to the current user on the Mac, like this user was installing this app themselves. When using `1` we will put “root:wheel” on the app, which can be useful for shared machines.
- Added option `curlOptions` to the labels. It can be filled with extra headers need for downloading the specific software. It needs to be an array, like `curlOptions=( )`. See “mocha”-software-labels.
- Added option `curlOptions` to the labels. It can be filled with extra headers need for downloading the specific software. It needs to be an array, like `curlOptions=( )`. See “mocha”-software-labels.
Big changes to logging:
- Introducing variable `LOGGING`, that can be either of the logging levels

View File

@@ -4,6 +4,21 @@ __Please note, that if you are contributing to this project with new labels or o
We try to keep the script as short as possible, and with more than 300 labels, we can save 300 lines in the script, if we do not have credit lines on each of these. So we are thankful for your contribution, but we will be removing these lines in the coming releases.
## Branches
The branch list is as follows:
- `release`: this branch will have the latest released version
- `main`: (default) this branch will be the latest release plus new and updated app labels, and critical bug fixes
- `dev`: this will contain new and updated app labels, as well as any other code changes
there will be other branches for new features and testing
This should allow the contributing team to release minor updates for new and updated app labels while also work on new features for the next major release.
With all the new branches, your local repo may get confused. If you dont have local changes, it is easiest to delete your local repo and re-clone it. If you have local changes you want to preserve, then you should commit those to a local branch, pull the latest changes `git pull --all`, then delete the old master branch: `git branch -d master`.
Make sure you branch off of main for new and updated labels and off of `dev` for other code changes. Thank you for contributing!
## Labels
If you need a new label for a piece of software, please take a look at the tutorials in the Wiki, if those can be helpful for starting out on the creation of the label.

View File

@@ -1,4 +1,9 @@
# MARK: check minimal macOS requirement
# MARK: 3 Arguments
# Start trapping the script
trap_with_arg func_trap SIGHUP SIGINT SIGQUIT SIGABRT SIGTERM SIGTSTP
# check minimal macOS requirement
autoload is-at-least
installedOSversion=$(sw_vers -productVersion)
@@ -125,4 +130,4 @@ valuesfromarguments)
fi
;;
# label descriptions start here
# Mark: label descriptions start here

View File

@@ -1,4 +1,4 @@
# MARK: Functions
# MARK: 2 Functions
cleanupAndExit() { # $1 = exit code, $2 message, $3 level
if [ -n "$dmgmount" ]; then
@@ -29,6 +29,17 @@ cleanupAndExit() { # $1 = exit code, $2 message, $3 level
exit "$1"
}
# Two functions to trap the script
trap_with_arg() {
func="$1" ; shift
for sig ; do
trap "$func $sig" "$sig"
done
}
func_trap() {
cleanupAndExit 255 "Installomator has been terminated with: $1" ERROR
}
runAsUser() {
if [[ $currentUser != "loginwindow" ]]; then
uid=$(id -u "$currentUser")

View File

@@ -1,3 +1,4 @@
# Mark: 4 Main
*)
# unknown label
#printlog "unknown label $label"

View File

@@ -1 +1 @@
9.0
9.1beta