Home Forums Software InstaDMG PKG scripts – postflight, preflight, etc.

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #372047
    pteeter
    Participant

    For such scripts to work properly within the InstaDMG framework, one has to include the $3 argument when referring to the target installation volume, correct?

    Thus far I’ve written all postflight/preflight scripts in /bin/sh.

    A number of these preflight scripts do file removal for software updates. File removal for paths with tons of spaces in the full path.

    Anyone got a best practice technique for prepending a $3 argument to a path with spaces in it?

    $3″/path/to/filename with spaces in it”

    I’ve been playing around with it but can’t seem to find a consistent solution.

    #372060
    benfeea1
    Participant

    #!/bin/sh
    #
    # Authored by:
    # This script…
    #
    # Installer.app Environmental Variables
    # $0 Script path
    # $1 Package path
    # $2 Default location
    # $3 Target volume
    #
    echo variable 3 is “$3″/
    echo Current path is `pwd`/
    #
    # set working directory. This is good to start with so you are working from the volume you are installing to.
    cd “$3″/
    #
    # Start the script.
    # basically put “$3” in front of all your absolute paths. The quotes “$3” will take care of a hard drive with spaces in the name.

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

Comments are closed