• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: progress messages from postinstall/postflight scripts?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: progress messages from postinstall/postflight scripts?


  • Subject: Re: progress messages from postinstall/postflight scripts?
  • From: "Bryan S. Lee" <email@hidden>
  • Date: Wed, 15 Apr 2009 21:50:56 -0400
  • Thread-topic: progress messages from postinstall/postflight scripts?

Title: Re: progress messages from postinstall/postflight scripts?
There’s not a direct method to do that in an installation package unfortunately. Would make life worth living and be very nice though.

Something I’ve resorted to using on a very long installation, is to use iHook (ihook.org) as an overlay to the installer to provide feedback to the user. Works well as long as there are definitive steps in your installation scripts that you could add calls to iHook to change the progress on screen.

For instance, in this one particular installation, I need to download a large hard drive image file to be cloned later. This piece of the script conducts the download, and constantly checks the file size (a known value) and does the math to calculate a percentage to update the progress in the iHook window. The main trick is to do any work as a separate process from the iHook feedback window and have to two communicate (or have the working part of the script update a separate file that the feedback window can check periodically. I do a similar trick during the cloning process to give the user feedback there as well.

### Must set the size of this variable to the size of the image file in Kilobytes
### Using the following command on the image directory
### ls -sk | grep total | cut -c 7-15
### Current values for Vers2 is 6455496. Round down to the nearest MB
TOTAL_SIZE="6455000"

### Must set the path to the file that contains the progress from Winclone
PROGRESS_FILE="/private/tmp/windowsvista/winclone_progress.txt"


### DOWNLOAD STAGE 1 ###

# Start Progress Bar for Downloading Image
echo "¾GINPOLE"
echo "Downloading Windows Image"

### Change directory to the Windows temp directory created by the installer
### and set the current file size variable

cd /private/tmp/windowsvista/
CURRENT_FILE_SIZE=$(ls -sk | grep total | cut -c 7-15)

### Download image needed for Windows imaging from the Web server
curl -O http://server.share.name.edu/windows/vista/version2/boot.img.gz &

### Loop to update download progress constantly until complete
until [ "$CURRENT_FILE_SIZE" -ge "$TOTAL_SIZE" ]; do
    sleep 7
    DOWNLOAD_PERCENT=`echo "($CURRENT_FILE_SIZE * 100) / $TOTAL_SIZE" | bc`
    echo "%$DOWNLOAD_PERCENT"
    echo "Download Is $DOWNLOAD_PERCENT Percent Complete"
    CURRENT_FILE_SIZE=$(ls -sk | grep total | cut -c 7-15)
    if [ "$PREVIOUS_FILE_SIZE" = "$CURRENT_FILE_SIZE" ]; then
        echo "¾EP"
        echo "¾EP"
        echo "¾EP"
        echo "%ENDPOLE"
        echo "File Download has lost connection, Please try installation again."
        sleep 5
        kill $KILL_IHOOK
        KILL_CURL=`ps acx | grep curl | cut -c 1-5`
        kill $KILL_CURL
        exit 1
    fi
    PREVIOUS_FILE_SIZE=$CURRENT_FILE_SIZE
done

echo "0"
echo "Download Is 100 Percent Finished"
sleep 2

echo "%ENDPOLE"


--
Bryan S. Lee




From: Bill Janssen <email@hidden>
Date: Sun, 12 Apr 2009 11:40:56 -0400
To: <email@hidden>
Subject: progress messages from postinstall/postflight scripts?

I've got an installer which runs a complicated postinstall script, and
I'd like to issue status messages from that script, somehow.  Something
that would show up where it says, "Running foobar installer script".  Is
there any way to do that with the Apple Installer?  I can always write a
Cocoa program which puts up a *different* window, but that's a
complicated and confusing way to do it, IMO.

Bill
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Installer-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Installer-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: progress messages from postinstall/postflight scripts?
      • From: Greg Neagle <email@hidden>
References: 
 >progress messages from postinstall/postflight scripts? (From: Bill Janssen <email@hidden>)

  • Prev by Date: progress messages from postinstall/postflight scripts?
  • Next by Date: Make the installer FAIL
  • Previous by thread: progress messages from postinstall/postflight scripts?
  • Next by thread: Re: progress messages from postinstall/postflight scripts?
  • Index(es):
    • Date
    • Thread