Home Forums Software InstaDMG Removing pkg receipts in 10.6

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #378783
    benfeea1
    Participant

    I 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?

    #378790
    Greg Neagle
    Participant

    The “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

    #378793
    benfeea1
    Participant

    I 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.

    #378795
    Allister Banks
    Participant

    I’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

    #378796
    benfeea1
    Participant

    Think 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.

    #379333
    benfeea1
    Participant

    Bump —

    Come on. I cannot be the Mac admin who wants to do this.

Viewing 6 posts - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.

Comments are closed