- This topic has 5 replies, 3 voices, and was last updated 14 years, 7 months ago by
benfeea1.
-
AuthorPosts
-
June 17, 2010 at 1:23 am #378783
benfeea1
ParticipantI have a few payload free packages that are used simply to run a post-flight script.
For example, joining a Mac to Active Directory with the “dsconfigad” command, or simply uninstalling software with the “rm” command.In cases like this I usually also delete the pkg receipt.
For 10.4 and 10.5 it was simple.I setup this variable
PackageName=$( /usr/bin/basename “$PackagePath” )Then I run this to remove the receipt.
##########
RemovePackageReceipt () {
rm -rv “${TargetVolume}/Library/Receipts/${PackageName}”
}RemovePackageReceipt
##########The thing I run into with 10.6 is a kind of chicken and the egg problem. The receipts do not show up in /private/var/db/receipts until the installer is finished.
So the rm command in the post-flight script has nothing to delete.
I have some ideas for using the pkgutil command, but it too has nothing to delete.So I end up with two questions.
Does anyone have any suggestions for removing the receipt for 10.6?What is everyone’s general philosophy about removing a package receipt?
June 17, 2010 at 7:45 pm #378790Greg Neagle
ParticipantThe “right” way to remove receipts going forward is
pkgutil –forget com.myorg.somepackage
I think doing so in a package postinstall script is a bad thing to do, however.
-Greg
June 17, 2010 at 10:16 pm #378793benfeea1
ParticipantI agree. pkgutil –forget com.myorg.somepackage is the way to go.
However, it does not work from a postflight script, because the receipt has not been written yet.
Chicken and the egg.June 17, 2010 at 11:46 pm #378795Allister Banks
ParticipantI’ll raise my hand like the NOOB here, what’s bad about the audit trail that these receipts can function as?
And doesn’t deploystudio have functionality(ds binding, etc.) to inject this in images it restores, so how do they do it/handle this situation? I can’t see why this couldn’t be accomplished with first-boot scripts called by launchd, which I use paired with first-login scripts for two classes of customizations I want performed.
Link ’em if you got ’em(even lmgtfy’s),
Allister
June 17, 2010 at 11:56 pm #378796benfeea1
ParticipantThink about a payload free package used to uninstall something.
You would use a post-flight script to rm all the files and directories associated with the software.
In the end you really would not want or need a receipt for the uninstaller pkg hanging around..This question is not really about InstaDMG or image deployment per say. It is more of a package creation question. But I know all the packaging expertise is found in this forum.
August 25, 2010 at 11:42 pm #379333benfeea1
ParticipantBump —
Come on. I cannot be the Mac admin who wants to do this.
-
AuthorPosts
- You must be logged in to reply to this topic.
Comments are closed