|
| 1 | +# Deploying an Onboarding Splash Screen with Swift Dialog and Intune via custom PKG |
| 2 | + |
| 3 | +## Overview |
| 4 | + |
| 5 | +swiftDialog is an [open source](https://github.com/bartreardon/swiftDialog) admin utility app for macOS 11+ written in SwiftUI that displays a popup dialog, displaying content to your users. |
| 6 | + |
| 7 | +swiftDialog's purpose is as a tool for Mac Admins to show informative messages via scripts, and relay back the users actions. |
| 8 | + |
| 9 | +Source: [bartreardon/swiftDialog: Create user-notifications on macOS with swiftDialog (github.com)](https://github.com/bartreardon/swiftDialog) |
| 10 | + |
| 11 | + |
| 12 | + |
| 13 | +## Dependencies |
| 14 | + |
| 15 | +In this example, we're going to use the Packages App to create a custom PKG that includes all of the resources we need for an oboarding package. |
| 16 | + |
| 17 | +1. Install [Packages App](http://s.sudre.free.fr/Software/files/Packages.dmg) and grant it full disk access |
| 18 | +2. Download and expand SwiftDialog_IntunePKG.zip from this repo. |
| 19 | + |
| 20 | +The ZIP file contains the following resources. |
| 21 | + |
| 22 | +``` |
| 23 | +|____Swift Dialog Onboarding |
| 24 | +| |____Swift Dialog Onboarding.pkgproj <-- This is the Packages project |
| 25 | +|____Payload |
| 26 | +| |____Application Support |
| 27 | +| | |____Dialog |
| 28 | +| | | |____Dialog.app |
| 29 | +| | |____SwiftDialogResources |
| 30 | +| | | |____swiftdialog.json <-- This is the SwiftDialog JSON |
| 31 | +| | | |____icons |
| 32 | +| | | | |____RemoteDesktop.png |
| 33 | +| | | | |____CompanyPortal.png |
| 34 | +| | | | |____Settings.png |
| 35 | +| | | | |____Edge.png |
| 36 | +| | | | |____vscode.png |
| 37 | +| | | | |____MicrosoftRemoteHelp.png |
| 38 | +| | | | |____office.png |
| 39 | +| | | | |____catlab.png |
| 40 | +| | | | |____GoogleChrome.png |
| 41 | +| | | | |____Defender.png |
| 42 | +| | | |____scripts <-- Any scripts in this folder will be executed by the post script |
| 43 | +| | | | |____01-installCompanyPortal.zsh |
| 44 | +| | | | |____02-installOffice365Pro.sh |
| 45 | +| | | | |____03-installEdge.sh |
| 46 | +| | | | |____04-installVSCode.zsh |
| 47 | +| | | | |____05-installRemoteDesktop.zsh |
| 48 | +| | | | |____06-installDefender.zsh |
| 49 | +| | | | |____99-setTZfromIP.sh |
| 50 | +| | | | |____99-DeviceRename.sh |
| 51 | +| | | | |____99-downloadWallpaper.sh |
| 52 | +| |____usr |
| 53 | +| | |____local |
| 54 | +| | | |____bin |
| 55 | +| | | | |____dialog |
| 56 | +``` |
| 57 | + |
| 58 | +# Getting Started |
| 59 | + |
| 60 | +First we need to check that everything is working as it should, to do this, open the Swift Dialog Onboarding folder and double click on the Swift Dialog Onboarding Packages project. It should open in the Packages app. |
| 61 | + |
| 62 | +Click on the Swift Dialog Package and select the Payload tab, check that none of the files are showing in red and there are no errors. Then press CMD+B to build our package. The most common reason for errors are files missing that are defined in the project and/or lack of permissions for the Packages app. |
| 63 | + |
| 64 | +If succesful you will now have a package created under the Swift Dialog Onboarding/Build folder. |
| 65 | + |
| 66 | +Your next step is to test that the package works by installing on a test machine and then you can run the following command. |
| 67 | + |
| 68 | +``` |
| 69 | +/usr/local/bin/dialog --jsonfile "/Library/Application Support/SwiftDialogResources/swiftdialog.json" --width 1280 --height 670 --blurscreen --ontop |
| 70 | +``` |
| 71 | + |
| 72 | +You should see the Swift Dialog UI displayed, but no scripts should execute. All Icons should display the right images. |
| 73 | + |
| 74 | +# Customising |
| 75 | + |
| 76 | +There are three areas to consider when customising the package |
| 77 | + |
| 78 | +1. **swiftdialog.json**: This file contains the information that Dialog will use to create the display. Not everything needs to be included here, you can also specify most things on the command line if you need to. Refer to the excellent [SwiftDialog Wiki](https://github.com/swiftDialog/swiftDialog/wiki) for more information about customising this file. |
| 79 | +2. **Icons**: It's important that any icons you reference are available, they can either be included in the package or you can define web URLs. |
| 80 | +3. **Scripts**: Any scripts that you put in the scripts folder will be executed in alphanumeric order. Some samples are provided here, but remove what you don't need they are provide to show whats possible. |
| 81 | + |
| 82 | +# Deploying via Intune |
| 83 | + |
| 84 | +Once you have your customised PKG ready, you should test it first and then we can upload to Intune for deployment. |
| 85 | + |
| 86 | +You can find out more detail about the unmanaged PKG deployment process in our [public documentation](https://learn.microsoft.com/en-us/mem/intune/apps/macos-unmanaged-pkg). |
| 87 | + |
| 88 | +Follow these steps from the Intune console: |
| 89 | + |
| 90 | +1. **Apps** > **macOS** > **Add** > **macOS app (PKG)** > **Select** > Select app package file > **OK** |
| 91 | +2. Edit App Information as required > **Next** |
| 92 | +3. Copy and paste Pre and Post install text from **IntuneScripts** folder (intunePre.sh / intunePost.sh) > **Next** |
| 93 | +4. Define minimum operating system version if you need to > **Next** |
| 94 | +5. Accept default detection rules > **Next** |
| 95 | +6. Assign to initial test group of users > **Next** |
| 96 | +7. **Create** |
| 97 | +8. Make a note of the appid, it's in the Intune Web URL after appid. We'll need this as we move into testing. |
| 98 | +https://intune.microsoft.com/#view/Microsoft_Intune_Apps/SettingsMenu/~/0/appId/**0b6e87b5-2e4b-4350-b551-bfb99d114c83** |
| 99 | + |
| 100 | + |
| 101 | +# Testing |
| 102 | + |
| 103 | +Now we have everything uploaded to Intune, we need to test it. The quickest way to do that is to trigger the Intune Agent to re-check for updates. |
| 104 | + |
| 105 | +Since this is the first time, it's a good idea to open the logs so that we can see what's going on |
| 106 | + |
| 107 | +1. Open the Mac Console app > Log Reports > search for Intune > Select the latest IntuneMDMDaemon log |
| 108 | +2. Double click on the log file and type the appid from above into the search box (it shouldn't return anything yet) |
| 109 | + |
| 110 | +Ok, so we can trigger the Intune agent to check-in and pick up our new PKG |
| 111 | + |
| 112 | +``` |
| 113 | +sudo pkill IntuneMdmDaemon |
| 114 | +``` |
| 115 | + |
| 116 | +If things go as expected, you should see the SwiftDialog UI appear and the scripts should start executing. |
| 117 | + |
| 118 | +You should see something like this in your IntuneDaemon log |
| 119 | + |
| 120 | +``` |
| 121 | +2024-05-15 02:15:12:703 | IntuneMDM-Daemon | I | 11254 | SyncActivityTracer | Validating data Context: mac app policies, Count: 2, PolicyID: ["05088685-1fe8-4107-aaec-a41d4f934a14", "0b6e87b5-2e4b-4350-b551-bfb99d114c83"] |
| 122 | +2024-05-15 02:15:12:703 | IntuneMDM-Daemon | I | 11254 | SyncActivityTracer | Processing data Context: mac app policies, Count: 2, PolicyID: ["05088685-1fe8-4107-aaec-a41d4f934a14", "0b6e87b5-2e4b-4350-b551-bfb99d114c83"] |
| 123 | +2024-05-15 02:15:12:704 | IntuneMDM-Daemon | I | 11255 | AppPolicyHandler | Handling app policy. PolicyID: 0b6e87b5-2e4b-4350-b551-bfb99d114c83, Primary BundleID: au.csiro.dialog, IgnoreVersion: true, Count: 1, AppType: PKG, App Policy Intent: RequiredInstall |
| 124 | +2024-05-15 02:15:12:704 | IntuneMDM-Daemon | I | 11255 | AppDetection | Detecting app with specific bundle ID. PolicyID: 0b6e87b5-2e4b-4350-b551-bfb99d114c83, AppName: Swift Dialog Onboarding, BundleID: au.csiro.dialog, IgnoreVersion: true |
| 125 | +2024-05-15 02:15:12:704 | IntuneMDM-Daemon | I | 11255 | ScriptOrchestrationLogger | Running system script. Domain: apps, User: root, PolicyID: 0b6e87b5-2e4b-4350-b551-bfb99d114c83 |
| 126 | +2024-05-15 02:15:12:735 | IntuneMDM-Daemon | I | 11255 | ScriptOrchestrationLogger | Finished system script. Domain: apps, User: root, PolicyID: 0b6e87b5-2e4b-4350-b551-bfb99d114c83 |
| 127 | +2024-05-15 02:15:12:735 | IntuneMDM-Daemon | I | 11255 | AppDetection | Did not find bundle path URL for app. PolicyID: 0b6e87b5-2e4b-4350-b551-bfb99d114c83, AppName: Swift Dialog Onboarding, BundleID: au.csiro.dialog, IgnoreVersion: true |
| 128 | +2024-05-15 02:15:12:735 | IntuneMDM-Daemon | I | 11255 | ScriptOrchestrationLogger | Running system script. Domain: apps, User: root, PolicyID: 0b6e87b5-2e4b-4350-b551-bfb99d114c83 |
| 129 | +2024-05-15 02:15:12:749 | IntuneMDM-Daemon | I | 11255 | ScriptOrchestrationLogger | Finished system script. Domain: apps, User: root, PolicyID: 0b6e87b5-2e4b-4350-b551-bfb99d114c83 |
| 130 | +2024-05-15 02:15:12:749 | IntuneMDM-Daemon | I | 11255 | PkgReceiptProvider | No app receipt found PolicyID: 0b6e87b5-2e4b-4350-b551-bfb99d114c83, BundleID: au.csiro.dialog |
| 131 | +2024-05-15 02:15:12:749 | IntuneMDM-Daemon | I | 11255 | AppDetection | App with specific bundle ID is NOT installed on the device. PolicyID: 0b6e87b5-2e4b-4350-b551-bfb99d114c83, AppName: Swift Dialog Onboarding, BundleID: au.csiro.dialog, IgnoreVersion: true |
| 132 | +2024-05-15 02:15:12:749 | IntuneMDM-Daemon | I | 11255 | AppInstallManager | App policy execution plan: Run pre-install script, Install PKG app Swift Dialog Onboarding, Run post-install script PolicyID: 0b6e87b5-2e4b-4350-b551-bfb99d114c83, AppName: Swift Dialog Onboarding, AppType: PKG, BundleID: au.csiro.dialog |
| 133 | +2024-05-15 02:15:12:749 | IntuneMDM-Daemon | I | 11255 | AppInstallManager | Pre-install script detected. Executing script. PolicyID: 0b6e87b5-2e4b-4350-b551-bfb99d114c83 |
| 134 | +2024-05-15 02:15:12:749 | IntuneMDM-Daemon | I | 11255 | ScriptOrchestrationLogger | Running management script. Domain: policy, User: root, PolicyID: 0b6e87b5-2e4b-4350-b551-bfb99d114c83 |
| 135 | +2024-05-15 02:15:12:759 | IntuneMDM-Daemon | I | 11255 | ScriptOrchestrationLogger | Finished management script. Domain: policy, User: root, PolicyID: 0b6e87b5-2e4b-4350-b551-bfb99d114c83 |
| 136 | +2024-05-15 02:15:12:759 | IntuneMDM-Daemon | I | 11255 | AppInstallManager | Pre-install script succeeded PolicyID: 0b6e87b5-2e4b-4350-b551-bfb99d114c83 |
| 137 | +2024-05-15 02:15:12:759 | IntuneMDM-Daemon | I | 11255 | AppInstallManager | Starting app installation for mac app policy. PolicyID: 0b6e87b5-2e4b-4350-b551-bfb99d114c83, AppName: Swift Dialog Onboarding, AppType: PKG, BundleID: au.csiro.dialog |
| 138 | +2024-05-15 02:15:12:759 | IntuneMDM-Daemon | I | 11255 | AppBinaryDownloader | Start app content info metadata download PolicyID: 0b6e87b5-2e4b-4350-b551-bfb99d114c83, AppName: Swift Dialog Onboarding, BundleID: au.csiro.dialog |
| 139 | +2024-05-15 02:15:12:759 | IntuneMDM-Daemon | I | 11255 | SidecarService | Getting mac app content info from GW PolicyID: 0b6e87b5-2e4b-4350-b551-bfb99d114c83, AppName: Swift Dialog Onboarding |
| 140 | +2024-05-15 02:15:13:230 | IntuneMDM-Daemon | I | 11258 | AppBinaryDownloader | Successfully fetched app content info response from GW. PolicyID: 0b6e87b5-2e4b-4350-b551-bfb99d114c83, AppName: Swift Dialog Onboarding, BundleID: au.csiro.dialog |
| 141 | +2024-05-15 02:15:13:230 | IntuneMDM-Daemon | I | 11258 | AppBinaryDownloader | Starting app binary download for mac app policy. PolicyID: 0b6e87b5-2e4b-4350-b551-bfb99d114c83, AppName: Swift Dialog Onboarding, Size: 11132265.0 |
| 142 | +2024-05-15 02:15:13:246 | IntuneMDM-Daemon | I | 11258 | AppBinaryDownloader | Attempt #1 out of 3 to download app binary PolicyID: 0b6e87b5-2e4b-4350-b551-bfb99d114c83, AppName: Swift Dialog Onboarding, BundleID: au.csiro.dialog |
| 143 | +2024-05-15 02:15:15:147 | IntuneMDM-Daemon | I | 11248 | AppBinaryDownloader | Successfully downloaded app binary content. PolicyID: 0b6e87b5-2e4b-4350-b551-bfb99d114c83, AppName: Swift Dialog Onboarding, BundleID: au.csiro.dialog |
| 144 | +2024-05-15 02:15:15:147 | IntuneMDM-Daemon | I | 11248 | AppInstallManager | Starting app binary decryption for mac app policy. PolicyID: 0b6e87b5-2e4b-4350-b551-bfb99d114c83, AppName: Swift Dialog Onboarding, AppType: PKG, BundleID: au.csiro.dialog |
| 145 | +2024-05-15 02:15:15:200 | IntuneMDM-Daemon | I | 11248 | AppInstallManager | Install required for app PolicyID: 0b6e87b5-2e4b-4350-b551-bfb99d114c83, AppName: Swift Dialog Onboarding, AppType: PKG, BundleID: au.csiro.dialog |
| 146 | +2024-05-15 02:15:15:200 | IntuneMDM-Daemon | I | 11248 | PkgInstaller | Starting PKG app installation PolicyID: 0b6e87b5-2e4b-4350-b551-bfb99d114c83, BundleID: au.csiro.dialog, AppName: Swift Dialog Onboarding |
| 147 | +2024-05-15 02:15:15:200 | IntuneMDM-Daemon | I | 11248 | ScriptOrchestrationLogger | Running system script. Domain: apps, User: root, PolicyID: 0b6e87b5-2e4b-4350-b551-bfb99d114c83 |
| 148 | +2024-05-15 02:15:17:541 | IntuneMDM-Daemon | I | 11248 | ScriptOrchestrationLogger | Finished system script. Domain: apps, User: root, PolicyID: 0b6e87b5-2e4b-4350-b551-bfb99d114c83 |
| 149 | +2024-05-15 02:15:17:541 | IntuneMDM-Daemon | I | 11248 | PkgInstaller | Successful PKG installation - installer completed with success status PolicyID: 0b6e87b5-2e4b-4350-b551-bfb99d114c83, BundleID: au.csiro.dialog, AppName: Swift Dialog Onboarding |
| 150 | +2024-05-15 02:15:17:542 | IntuneMDM-Daemon | I | 11248 | AppInstallManager | Post-install script detected. Executing script. PolicyID: 0b6e87b5-2e4b-4350-b551-bfb99d114c83 |
| 151 | +2024-05-15 02:15:17:542 | IntuneMDM-Daemon | I | 11248 | ScriptOrchestrationLogger | Running management script. Domain: policy, User: root, PolicyID: 0b6e87b5-2e4b-4350-b551-bfb99d114c83 |
| 152 | +2024-05-15 02:15:17:549 | IntuneMDM-Daemon | I | 11250 | AppInstallManager | App policy file cleanup successful. PolicyID: 0b6e87b5-2e4b-4350-b551-bfb99d114c83, AppName: Swift Dialog Onboarding |
| 153 | +2024-05-15 02:15:17:549 | IntuneMDM-Daemon | I | 11257 | AppInstallManager | App policy file cleanup successful. PolicyID: 0b6e87b5-2e4b-4350-b551-bfb99d114c83, AppName: Swift Dialog Onboarding |
| 154 | +2024-05-15 10:25:49:533 | IntuneMDM-Daemon | I | 11248 | ScriptOrchestrationLogger | Finished management script. Domain: policy, User: root, PolicyID: 0b6e87b5-2e4b-4350-b551-bfb99d114c83 |
| 155 | +2024-05-15 10:25:49:534 | IntuneMDM-Daemon | I | 11248 | AppInstallManager | Post-install script succeeded. PolicyID: 0b6e87b5-2e4b-4350-b551-bfb99d114c83 |
| 156 | +2024-05-15 10:25:49:534 | IntuneMDM-Daemon | I | 11248 | AppInstallManager | Successfully installed all apps PolicyID: 0b6e87b5-2e4b-4350-b551-bfb99d114c83, AppName: Swift Dialog Onboarding, ComplianceState: Installed, EnforcementState: Success, Product Version (BundleID of primary app): 2.3.2, Primary BundleID: au.csiro.dialog |
| 157 | +2024-05-15 10:25:49:534 | IntuneMDM-Daemon | I | 11248 | AppPolicyHandler | Handling app policy finished. PolicyID: 0b6e87b5-2e4b-4350-b551-bfb99d114c83, Primary BundleID: au.csiro.dialog, IgnoreVersion: true, Count: 1, AppType: PKG, App Policy Intent: RequiredInstall |
| 158 | +2024-05-15 10:25:49:534 | IntuneMDM-Daemon | I | 11248 | ExecutionClock | Measurement: Policy Identifier: 0b6e87b5-2e4b-4350-b551-bfb99d114c83, Type: macAppInstall, Duration: 636.8304209709167 |
| 159 | +2024-05-15 10:25:49:537 | IntuneMDM-Daemon | I | 31568 | AppResultStateChangeManager | This policy has never been executed on this device before the current check-in PolicyID: 0b6e87b5-2e4b-4350-b551-bfb99d114c83 |
| 160 | +2024-05-15 10:25:49:539 | IntuneMDM-Daemon | I | 31568 | AppResultStateChangeManager | Successfully cached new app policy state change record PolicyID: 0b6e87b5-2e4b-4350-b551-bfb99d114c83, PolicyResult: ["ResultCreatedTimeUTC": 2024-05-15T09:15:17Z, "Intent": 3, "EnforcementStateMessage": { |
| 161 | +}, "PolicyId": 0b6e87b5-2e4b-4350-b551-bfb99d114c83, "ApplicationName": Swift Dialog Onboarding] |
| 162 | +2024-05-15 10:25:49:539 | IntuneMDM-Daemon | I | 31568 | AppStateChangePersistence | Fetch app policy state change records PolicyID: [Optional("05088685-1fe8-4107-aaec-a41d4f934a14"), Optional("0b6e87b5-2e4b-4350-b551-bfb99d114c83")] |
| 163 | +2024-05-15 10:25:49:539 | IntuneMDM-Daemon | I | 31568 | AppPolicyResultsReporter | Create state change report for app policies PolicyType: macAppInstall, Count: 1, PolicyID: 0b6e87b5-2e4b-4350-b551-bfb99d114c83 |
| 164 | +2024-05-15 10:25:49:539 | IntuneMDM-Daemon | I | 31568 | AppPolicyResultsReporter | Number of app policies executed PolicyType: macAppInstall, Count: 2, PolicyID: 05088685-1fe8-4107-aaec-a41d4f934a14, 0b6e87b5-2e4b-4350-b551-bfb99d114c83 |
| 165 | +2024-05-15 10:25:49:539 | IntuneMDM-Daemon | I | 31568 | SyncActivityTracer | Reporting results Context: mac app policies, Count: 1, PolicyID: ["0b6e87b5-2e4b-4350-b551-bfb99d114c83"] |
| 166 | +``` |
0 commit comments