Fix Swift Dialog (PKG) onboarding to be idempotent (#245)#254
Open
theneiljohnson wants to merge 1 commit intomicrosoft:masterfrom
Open
Fix Swift Dialog (PKG) onboarding to be idempotent (#245)#254theneiljohnson wants to merge 1 commit intomicrosoft:masterfrom
theneiljohnson wants to merge 1 commit intomicrosoft:masterfrom
Conversation
Resolves microsoft#245. The 'have we run before?' guard in intunePost.sh was commented out and intunePre.sh had no equivalent check at all, so the destructive cleanup in pre always ran (rm -rf the existing swiftDialog install) and the onboarding scripts always re-ran whenever the PKG was re-evaluated. Changes: - intunePre.sh: check for the onboardingComplete marker before doing any cleanup; exit 1 to abort the PKG install entirely if present (per Microsoft Learn, a non-zero pre-install script aborts the install and skips post). This makes the marker an effective opt-out switch. - intunePost.sh: uncomment the matching marker check as a belt-and- braces guard. Marker is still written at the end of a successful onboarding run. - readme: document the marker path, how to pre-create it to opt a device out, and how to delete it to force a re-onboarding.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Resolves #245.
Thanks to @threeonparfive for the very detailed bug report — they were correct on every count.
Problem
The Swift Dialog (PKG) onboarding wrapper was supposed to run only once per device, but in practice it re-ran whenever Intune re-evaluated the PKG:
intunePost.shhad a marker check, but it was commented out.intunePre.shhad no marker check at all, so its destructive cleanup (rm -rfof the existing swiftDialog install, log dir wipe, etc.) always ran.Fix
intunePre.sh: added a marker check at the top, before any cleanup. IfonboardingCompleteexists the scriptexit 1s, which (per Microsoft Learn) aborts the entire PKG install and skips post — making the marker a genuine opt-out switch.intunePost.sh: uncommented the equivalent guard as belt-and-braces (changed itsexit 1toexit 0since by post-install stage there's nothing to abort). Marker is still written at the end of a successful run.readme.md: new "Run-once / opt-out marker" section documenting the marker path, how to pre-create it to opt a device out, and how to delete it to force re-onboarding.Marker path
/Library/Application Support/Microsoft/IntuneScripts/Swift Dialog/onboardingComplete