Forum Replies Created
-
AuthorPosts
-
Rusty Myers
ParticipantThere have been a few threads about ts issue in the past. I’ve used some special characters and can use ” (single quotes) to create a proper hash file. You may need to experiment a little bit to get it working. I can’t answer if there are or are not illegal characters. My password uses | and letters and numbers. Good luck!
May 3, 2010 at 1:15 am in reply to: multiplescripts that need to be run, can this be done in InstaDMG, what is best way #378483Rusty Myers
ParticipantI used to do this with my instadmg image. I’ve since moved to deploystudio for most of the post imaging tasks. Anyway, you need to install a script and a launchd item to the system image then run said script the first time your machines boot.
The scripts can call each other or you can use a master script to call them individually.
Your launchd item should be in /Library/LaunchDaemons so it runs at boot and as an authenticated user (root I think). I can provide some scripts to do these actions if you’d email me. There are also plenty of examples on this site and google.
rustymyers (at) gmail dot com
Rusty Myers
Participantis launchd running the command or a script with the command in it? I’d try a script with the command in it if your not doing that. Also, where are you putting the launchd plist? /Library/LaunchDaemons/ or /Library/LaunchAgents/ or other?
Rusty Myers
ParticipantCheck this page out.
https://www.afp548.com/article.php?story=instadmg&query=Instadmg
It can do a better job at helping you than my memory could.
March 11, 2010 at 5:01 pm in reply to: Why is instaDMG trying to install packages on the build machine? #378177Rusty Myers
ParticipantWhen 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” != “” ]; thenecho ” 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
fifi
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.
March 5, 2010 at 9:20 pm in reply to: Why is instaDMG trying to install packages on the build machine? #378137Rusty Myers
ParticipantShort 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” != “” ]; thenecho ” 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!
Rusty Myers
ParticipantWell, if Your doing the presentation with Justin, they you probably are already using Pennsylvania State University. That’s where I am, but in the College of Education. I grant permission to use our name if you’d like. Thanks!
RustyRusty Myers
Participantbenfeea1:
New topic:
https://www.afp548.com/forum/viewtopic.php?showtopic=25626Rusty Myers
ParticipantI think your package could use a script to move the files to the username folder postflight. You could then just change the hard coded username in the postflight, instead of rebuilding the package. Just make sure to use the correct paths when moving the files ($3, i think?).
Rusty Myers
ParticipantI’ve been doing all user specific installs after the user creates their home folder. If it’s a generic install for all users, you could install it to the User Template folder, but not recommended. Also, a script that runs at first boot could copy (or move) the files to the correct user account.
How many different users are there? Do you use any other software that could deploy the package after it’s imaged, like DeployStudio?
How is the installer set up to target the current user? Can it target all users or does it have to be specific to users?
RustyRusty Myers
ParticipantAllan, Great work. I’m really glad to hear what you found. Will you be able to share your scripts either now or when your completely finished? Thanks!
RustyRusty Myers
ParticipantCan you use them whilst holding the function key? Is it set in system preferences -> Keyboard to use all the F keys as standard function keys?
Rusty Myers
ParticipantThis thread is a start:
https://www.afp548.com/forum/viewtopic.php?forum=45&showtopic=22701&highlight=autologinRusty Myers
ParticipantI would try requirements first, failing a postlight or pre(install/upgrade) script will not give the user any indication of why if fails.
Maybe, however, that’s what you want? =)
RustyRusty Myers
ParticipantWe script ARD. You can create a package to run in the build train or run it as a first boot script.
Here’s the posting on starting ard from a package in the build train:
https://www.afp548.com/forum/viewtopic.php?showtopic=20328&mode=&show=20&page=2
Last post on that page.Notice the $3 is what points to the disk image that your creating with instadmg when you run the script. This is the main difference between running scripts before first boot and after.
A little searching this forum should shed some more light on the ARD setup.
Rusty -
AuthorPosts
Recent Comments