Home Forums Software InstaDMG Why is instaDMG trying to install packages on the build machine?

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #378132
    typofonic
    Participant

    Why is it that during the instaDMG process some installation dialogs show up on the system building the image? For instance when installing the package WireTap Studio I get this dialog on the machine building the image:
    “WireTap Studio Installer requires you to restart your computer.”

    Some times this pauses the whole building proces because the installer is waiting for a dialog to be closed. iWork 09 does this as well.

    Also I’ve noticed that some packages also install stuff on the machine building the image, in addition to installing it on the output image.

    Any ideas why this happens and how to stop it?

    #378137
    Rusty Myers
    Participant

    Short answer: Postflight scripts not pointing to the target disc.

    Long Answer:

    Wiretap studio, specifically, runs a postflight script that checks what kernel extension is running. If it finds the old version is running, or it isn’t running, then it asks for a reboot. Since your build machine isn’t running wiretap studio, or is running an old version, it asks for a restart:

    [code]KEXT_VERSION=`defaults read /System/Library/Extensions/AmbrosiaAudioSupport.kext/Contents/Info CFBundleVersion`
    KEXT_RUNNING=`kextstat | grep ‘com.AmbrosiaSW.AudioSupport’ | awk ‘{ print $7 }’`
    if [ “($KEXT_VERSION)” != “$KEXT_RUNNING” -o “$KEXT_UNLOAD_FAILED” != “” ]; then

    echo ” Installed kext version = ($KEXT_VERSION)”
    echo ” Running kext version = $KEXT_RUNNING”
    echo ” Forcing the user to restart”

    # — Display a dialog that requires the user to restart or shutdown
    “$GRAFFITI_PATH” postflightHelper scpt &

    exit 0[/code]

    You could try to re-package the software to get rid of that message, and possible any other issues that could arrise from the postflight not pointing to the target disc.

    Disclamer: I don’t know what I’m talking about, but it makes sense to me. This may be a correct answer to your question or it could be bullshit. Enjoy it either way!

    #378171
    typofonic
    Participant

    Thanks for your answer. So I assume I just repackage it without any postflight script? Wouldn’t that make Wiretap Studio nonfunctional?

    Can’t the path just be changed from /System/Library/Extensions/AmbrosiaAudioSupport.kext/Contents/Info to the same path but on the instaDMG image? If it can, how is it possible to find the path to this directory on the image?

    #378177
    Rusty Myers
    Participant

    When you repackage the app it will not have postflight scripts. But something may not work right. You would have to experiment with re-packaging it.

    Wiretap has a preflight script, which you shouldn’t have to worry about. It checks that wiretap and some other things are not running, not a problem with InstaDMG. The postflight script is a bit more involved:

    Adding my comments below with double hash! “##”

    [code]#!/bin/sh

    #installerPath=$2
    ##Setting up variables##
    echo ‘wiretap studio.mpkg postflight script—–‘

    NSNOTIFIER_PATH=$PACKAGE_PATH”/Contents/Resources/nsnotifier”
    WIRETAPPED_PATH=$PACKAGE_PATH”/Contents/Resources/wiretapped”
    GRAFFITI_PATH=$PACKAGE_PATH”/Contents/MacOS/Graffiti”

    WTA_PREFS_NAME=”com.ambrosiasw.wiretapanywhere.sharedsource”
    WTA_NOTIFY_KEY=”com.ambrosiasw.wiretapanywhere.prefschanged”

    KEXT_UNLOAD_RESULT=$INSTALLER_TEMP”/kext_unload_result”
    WTA_WAS_ENABLED=$INSTALLER_TEMP”/wta_was_disabled”
    SPX_WAS_RUNNING=$INSTALLER_TEMP”/spx_was_running”

    # — Check the original kext status from the preinstall script
    ##Preinstall script wont run anyway, but we know it’s a virgin install##
    if ( grep 0xe00002c2 “$KEXT_UNLOAD_RESULT” > /dev/null ) ; then
    echo ‘ AmbrosiaAudioSupport kext was virgin install’
    elif ( grep failed “$KEXT_UNLOAD_RESULT” > /dev/null ) ; then
    echo ‘ AmbrosiaAudioSupport kext failed to unload’
    KEXT_UNLOAD_FAILED=1
    fi

    # — Touch the /System/Library/Extensions dir, and load our kext
    ##if the kernel is there, it should load at boot##
    touch /System/Library/Extensions
    kextload -b “com.AmbrosiaSW.AudioSupport”

    # — Restore the WireTap Anywhere prefs so that they are valid on next startup
    ##If this is a virgin install, there should be no prefs##
    if [ -e “$WTA_WAS_ENABLED” ] ; then
    echo ‘ Restoring WireTap Anywhere settings’

    # Disable the WTA devices by writing to the prefs
    sudo -u $USER defaults write $WTA_PREFS_NAME Enabled -boolean YES

    # We don’t notify yet, since we may be forcing a restart
    fi

    # — Determine if the correct version of the kext is now running
    ##This will fail while running on InstaDMG if you don’t have wiretap installed on host machine##
    ##You should only have one kext (virgin install) and so you shouldn’t need the checks##
    KEXT_VERSION=`defaults read /System/Library/Extensions/AmbrosiaAudioSupport.kext/Contents/Info CFBundleVersion`
    KEXT_RUNNING=`kextstat | grep ‘com.AmbrosiaSW.AudioSupport’ | awk ‘{ print $7 }’`
    if [ “($KEXT_VERSION)” != “$KEXT_RUNNING” -o “$KEXT_UNLOAD_FAILED” != “” ]; then

    echo ” Installed kext version = ($KEXT_VERSION)”
    echo ” Running kext version = $KEXT_RUNNING”
    echo ” Forcing the user to restart”

    # — Display a dialog that requires the user to restart or shutdown
    “$GRAFFITI_PATH” postflightHelper scpt &

    exit 0

    else

    ##This section checks for registration and if it needs to restore preferences, I think.##
    ##It shouldn’t be needed on a virgin machine.##

    # Only now do we” send out the WTA notification
    if [ -e “$WTA_WAS_ENABLED” ] ; then
    “$NSNOTIFIER_PATH” “$WTA_NOTIFY_KEY”
    fi

    # Under 10.5.0, this call interferes with registering for all users
    # open “/Applications/Snapz Pro X/Snapz Pro X.app”

    touch “/Applications/WireTap Studio.app”

    # This way works however
    /usr/bin/osascript -e ‘tell application “Finder” to open application file “WireTap Studio.app” of folder “Applications” of startup disk’

    if [ -e “$SPX_WAS_RUNNING” ] ; then
    echo ‘ Launching Snapz Pro X’
    /usr/bin/osascript -e ‘tell application “Finder” to open application file “Snapz Pro X” of folder “Snapz Pro X” of folder “Applications” of startup disk’

    # Enable the WTA devices by writing to the prefs
    sudo -u $USER defaults write $WTA_PREFS_NAME Enabled -boolean YES

    # We don’t notify yet, since we may be forcing a restart
    fi

    fi

    echo “— exiting WireTap Studio $SCRIPT_NAME script —”

    exit 0
    [/code]

    So, it seems that if you can re-package the installer, and your not upgrading (old preferences and kexts) then you ‘should’ not have a ‘problem’ with the repackaged installer.

    I quoted should and problem because I really don’t know, test it out! I prefer Composer for re-packaging, but anything you use should be fine.

    Rusty

    EDIT: added more notes to postflight script.

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

Comments are closed