kc9wwh / macOSUpgrade

Workflow for doing in-place upgrades.
Other
418 stars 103 forks source link

finishOSInstall script does not delete the Install .....app #48

Closed ghost closed 6 years ago

ghost commented 6 years ago

Great process, thank you for sharing it. When checking the final results we noticed the installer app is still there. If we parse OSInstaller="$4" value like /Applications/Install macOS High Sierra.app we will need to escape the quotation marks in line 173 like:

/bin/echo "#!/bin/bash
## First Run Script to remove the installer.
## Clean up files
/bin/rm -fdr \"$OSInstaller\"
/bin/sleep 2
...

Thank you.

kc9wwh commented 6 years ago

I will work on fixing this in the next version I am working on.

Thanks!

ghost commented 6 years ago

Thanks

kc9wwh commented 6 years ago

Updated code...

/bin/echo "#!/bin/bash
## First Run Script to remove the installer.
## Clean up files
/bin/rm -fdr \"$OSInstaller\"
/bin/sleep 2
## Update Device Inventory
/usr/local/jamf/bin/jamf recon
## Remove LaunchDaemon
/bin/rm -f /Library/LaunchDaemons/com.jamfps.cleanupOSInstall.plist
## Remove Script
/bin/rm -fdr /usr/local/jamfps
exit 0" > /usr/local/jamfps/finishOSInstall.sh

Updated output...

#!/bin/bash
## First Run Script to remove the installer.
## Clean up files
/bin/rm -fdr "/Applications/Install macOS High Sierra.app"
/bin/sleep 2
## Update Device Inventory
/usr/local/jamf/bin/jamf recon
## Remove LaunchDaemon
/bin/rm -f /Library/LaunchDaemons/com.jamfps.cleanupOSInstall.plist
## Remove Script
/bin/rm -fdr /usr/local/jamfps
exit 0
kc9wwh commented 6 years ago

Fixed in v2.6 branch, will merge to master when milestone is complete.