Relocate MunkiStatus.app and Munki-notifier.app to ../Contents/Helpers/ from ../Contents/Resources/ - Munki6dev base (#1207)

* Relocate MunkiStatus.app and Munki-notifier.app to ../Contents/Helpers/ from ../Contents/Resources/

- Updated location of munki-notifier in code/apps/Managed Software Center/Managed Software Center/Controllers/MainWindowController.swift
- Added code/client/installhelper script
- Amended code/tools/make_munki_mpkg.sh with new locations for munki-notifier and MunkiStatus as well as changes required to leverage `installhelper`
- Amended code/tools/pkgresources/Scripts_app_usage/postinstall to leverage `installhelper`
- Deleted code/tools/pkgresources/Scripts_app_usage/preinstall as the actions within should be handled now by `installhelper`
- Amended code/tools/pkgresources/Scripts_launchd/postinstall to leverage `installhelper`
- Amended launchd/LaunchAgents/com.googlecode.munki.munki-notifier.plist to use the new path to munki-notifier.app
- Amended launchd/LaunchAgents/com.googlecode.munki.MunkiStatus.plist to use the new path to MunkiStatus.app

This is a resubmission of https://github.com/munki/munki/pull/1203, which needed it's base branch changing from `main` to `Munki6dev`

* Update installhelper

 - Removed CHECK_TIME global - https://github.com/munki/munki/pull/1207/files/374fbaf9220144740d0d0cef5acba20fd6ac554a#r1515000516
- Remove erroneous login window comments - https://github.com/munki/munki/pull/1207/files/374fbaf9220144740d0d0cef5acba20fd6ac554a#r1515006835 and https://github.com/munki/munki/pull/1207/files/374fbaf9220144740d0d0cef5acba20fd6ac554a#r1515006962
- Simplified IF condition - https://github.com/munki/munki/pull/1207/files/374fbaf9220144740d0d0cef5acba20fd6ac554a#r1515005565 this was in place incase LimitLoadToSessionType contained multiple values (as it can).

* Update installhelper

- Reverted changes made for - https://github.com/munki/munki/pull/1207/commits/374fbaf9220144740d0d0cef5acba20fd6ac554a#r1515005565
- Changed constant/global PASSED_ARG to local: launchd_group - https://github.com/munki/munki/pull/1207#discussion_r1515002646 and https://github.com/munki/munki/pull/1207#discussion_r1515002968

* Update installhelper

* Update installhelper

* Update installhelper

* Update installhelper

* Update make_munki_mpkg.sh

Amended so that the launchd pkg is installed by default
This commit is contained in:
macmule
2024-03-26 18:04:26 +00:00
committed by GitHub
parent 29fd72a80c
commit dc2725e4e7
8 changed files with 529 additions and 119 deletions
@@ -961,8 +961,8 @@ class MainWindowController: NSWindowController, NSWindowDelegate, WKNavigationDe
// we can't remove them directly since we didn't actually post them
// so we can't use
// NSUserNotificationCenter.default.removeAllDeliveredNotifications()
let munkiNotifierPath = Bundle.main.path(forResource: "munki-notifier", ofType: "app")
if let munkiNotifierPath = munkiNotifierPath {
let munkiNotifierPath = Bundle.main.bundlePath + "/Contents/Helpers/munki-notifier.app"
if FileManager.default.fileExists(atPath: munkiNotifierPath) {
NSLog("munki-notifier path: %@", munkiNotifierPath as String)
// now make sure it's not already running
let executablePath = munkiNotifierPath + "/Contents/MacOS/munki-notifier"