Skip to content

Comments

Prompt timeout#771

Merged
scriptingosx merged 2 commits intoInstallomator:mainfrom
dnikles:prompt_timeout
May 26, 2023
Merged

Prompt timeout#771
scriptingosx merged 2 commits intoInstallomator:mainfrom
dnikles:prompt_timeout

Conversation

@dnikles
Copy link
Contributor

@dnikles dnikles commented Nov 18, 2022

This was originally #682 but I messed something up where I can't commit to that anymore
If prompt_user or prompt_user_then_kill is used and the user does not respond to the prompt after PROMPT_TIMEOUT seconds, exit the script. The behavior is similar to hitting "not now". Default timeout is set to 24 hours.

output:

Installomator v10 % sudo ./Installomator.sh slack DEBUG=0 BLOCKING_PROCESS_ACTION=prompt_user LOGO=jamf SYSTEMOWNER=1 NOTIFY=all INSTALL=force PROMPT_TIMEOUT=5
Password:
2022-11-18 09:15:58 : INFO  : slack : setting variable from argument DEBUG=0
2022-11-18 09:15:58 : INFO  : slack : setting variable from argument BLOCKING_PROCESS_ACTION=prompt_user
2022-11-18 09:15:58 : INFO  : slack : setting variable from argument LOGO=jamf
2022-11-18 09:15:58 : INFO  : slack : setting variable from argument SYSTEMOWNER=1
2022-11-18 09:15:58 : INFO  : slack : setting variable from argument NOTIFY=all
2022-11-18 09:15:58 : INFO  : slack : setting variable from argument INSTALL=force
2022-11-18 09:15:58 : INFO  : slack : setting variable from argument PROMPT_TIMEOUT=5
2022-11-18 09:15:58 : REQ   : slack : ################## Start Installomator v. 10.0, date 2022-11-18
2022-11-18 09:15:58 : INFO  : slack : ################## Version: 10.0
2022-11-18 09:15:58 : INFO  : slack : ################## Date: 2022-11-18
2022-11-18 09:15:58 : INFO  : slack : ################## slack
2022-11-18 09:15:58 : INFO  : slack : BLOCKING_PROCESS_ACTION=prompt_user
2022-11-18 09:15:58 : INFO  : slack : NOTIFY=all
2022-11-18 09:15:58 : INFO  : slack : LOGGING=INFO
2022-11-18 09:15:58 : INFO  : slack : LOGO=/Library/Application Support/JAMF/Jamf.app/Contents/Resources/AppIcon.icns
2022-11-18 09:15:58 : INFO  : slack : Label type: dmg
2022-11-18 09:15:58 : INFO  : slack : archiveName: Slack.dmg
2022-11-18 09:15:58 : INFO  : slack : no blocking processes defined, using Slack as default
2022-11-18 09:15:59 : INFO  : slack : App(s) found: /Applications/Slack.app
2022-11-18 09:15:59 : INFO  : slack : found app at /Applications/Slack.app, version 4.29.149, on versionKey CFBundleShortVersionString
2022-11-18 09:15:59 : INFO  : slack : appversion: 4.29.149
2022-11-18 09:15:59 : INFO  : slack : Label is not of type “updateronly”, and it’s set to use force to install or ignoring app store apps, so not using updateTool.
2022-11-18 09:15:59 : INFO  : slack : Latest version of Slack is 4.29.149
2022-11-18 09:15:59 : INFO  : slack : There is no newer version available.
2022-11-18 09:15:59 : REQ   : slack : Downloading https://slack.com/ssb/download-osx-universal to Slack.dmg
2022-11-18 09:15:59 : INFO  : slack : notifying
2022-11-18 09:16:07 : INFO  : slack : found blocking process Slack
2022-11-18 09:16:13 : INFO  : slack : App not closed, so no reopen.
2022-11-18 09:16:13 : ERROR : slack : ERROR: timed out waiting for user response
2022-11-18 09:16:13 : REQ   : slack : ################## End Installomator, exit code 25 

If prompt_user or prompt_user_then_kill is used and the user does not respond to the prompt after PROMPT_TIMEOUT seconds, exit the script. The behavior is similar to hitting "not now".

output:
```
Installomator % sudo utils/assemble.sh slack DEBUG=0 BLOCKING_PROCESS_ACTION=prompt_user_then_kill INSTALL=force PROMPT_TIMEOUT=3
2022-09-08 07:12:37 : INFO  : slack : setting variable from argument DEBUG=0
2022-09-08 07:12:37 : INFO  : slack : setting variable from argument BLOCKING_PROCESS_ACTION=prompt_user_then_kill
2022-09-08 07:12:38 : INFO  : slack : setting variable from argument INSTALL=force
2022-09-08 07:12:38 : INFO  : slack : setting variable from argument PROMPT_TIMEOUT=3
2022-09-08 07:12:38 : REQ   : slack : ################## Start Installomator v. 10.0beta3, date 2022-09-08
2022-09-08 07:12:38 : INFO  : slack : ################## Version: 10.0beta3
2022-09-08 07:12:38 : INFO  : slack : ################## Date: 2022-09-08
2022-09-08 07:12:38 : INFO  : slack : ################## slack
2022-09-08 07:12:38 : INFO  : slack : BLOCKING_PROCESS_ACTION=prompt_user_then_kill
2022-09-08 07:12:38 : INFO  : slack : NOTIFY=success
2022-09-08 07:12:38 : INFO  : slack : LOGGING=INFO
2022-09-08 07:12:38 : INFO  : slack : LOGO=/System/Applications/App Store.app/Contents/Resources/AppIcon.icns
2022-09-08 07:12:38 : INFO  : slack : Label type: dmg
2022-09-08 07:12:38 : INFO  : slack : archiveName: Slack.dmg
2022-09-08 07:12:38 : INFO  : slack : no blocking processes defined, using Slack as default
2022-09-08 07:12:38 : INFO  : slack : App(s) found: /Applications/Slack.app
2022-09-08 07:12:38 : INFO  : slack : found app at /Applications/Slack.app, version 4.28.171, on versionKey CFBundleShortVersionString
2022-09-08 07:12:38 : INFO  : slack : appversion: 4.28.171
2022-09-08 07:12:38 : INFO  : slack : Label is not of type “updateronly”, and it’s set to use force to install or ignoring app store apps, so not using updateTool.
2022-09-08 07:12:38 : INFO  : slack : Latest version of Slack is 4.28.171
2022-09-08 07:12:38 : INFO  : slack : There is no newer version available.
2022-09-08 07:12:38 : REQ   : slack : Downloading https://slack.com/ssb/download-osx-universal to Slack.dmg
2022-09-08 07:12:40 : INFO  : slack : found blocking process Slack
2022-09-08 07:12:43 : INFO  : slack : Telling app Slack.app to open
2022-09-08 07:12:43 : INFO  : slack : Reopened Slack.app as dnikles
2022-09-08 07:12:43 : INFO  : slack : dnikles
2022-09-08 07:12:43 : INFO  : slack : dnikles
2022-09-08 07:12:43 : INFO  : slack : dnikles
2022-09-08 07:12:43 : INFO  : slack : dnikles
2022-09-08 07:12:43 : ERROR : slack : ERROR: timed out waiting for user response
2022-09-08 07:12:43 : REQ   : slack : ################## End Installomator, exit code 25
```
This makes sure the app will not be brought to the front unexpectedly when the prompt times out
@dnikles dnikles mentioned this pull request Nov 18, 2022
@scriptingosx scriptingosx added the feature New feature or request label Nov 23, 2022
@scriptingosx scriptingosx added this to the v11 milestone Nov 23, 2022
@scriptingosx scriptingosx merged commit 6fd5d6b into Installomator:main May 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants