Hey everyone not sure if i worded that properly but looking to create a preinstall script that installs and runs Lotus Notes uninstall silently in the background and installs Lotus Notes 10 after its down.
i created the package with composer yet im stuck on what's next i added a preinstall script that's built in yet don't know how to edit it properly
Also your package is going to drop all those files on the root level of the drive. You probably want to put them in a folder in /tmp or similar if they are only needed during the uninstall / install process.
You can create this in the PKG by putting the files you want in that location, then dragging them from there to the PKG in Composer.
you should put those temporary things to /tmp like Look said. Also, you need to test if the uninstaller is executable with root rights. In the POST-Install you should try to run the binary itself from the uninstaller app - similar to this below. After that you could try to install the pkg. Thereafter you should clean up your mess ;)
#!/bin/sh #uninstall the app with the recommended tool... /tmp/MyPackageName/Uninstaller.app/Contents/MacOS/uninstaller sleep 5 #installing fancy stuff /usr/sbin/installer -pkg /tmp/MyPackage/Name/IBM Lotus Notes.pkg -target / #moving stuff to their destinations... cp /tmp/MyPackageName/license/ /Users/Shared/license #cleaning up the mess rm -R /tmp/MyPackageName exit 0
If the Uninstaller needs an active user session, you should consider using "Packages" - there is a nice tutorial from rtrouton on his blog
While this thread is two years old and the issue is likely long since solved, I'll add this for posterity anyway, since someone else might come across it later. The original poster mentioned that the package will be distributed with Munki. With Munki, you can include the uninstall script directly in the pkginfo file as a preinstall_script for the installer without needing to create a custom package with Composer or other tools. This method offers more flexibility for future changes since the script exists outside of the package (i.e. you do not need to modify the package to change the script).
makepkginfo --preinstall_script /path/to/a/script
Munki can coexist with Jamf Pro or any other MDM.