Post Install Scripts

I am creating an image with System Utility. One module i can add is called "Add Packages and Post-Install Scripts".

I put one of my scripts in it:

#!bin/sh
defaults write /Library/Preferences/com.apple.loginwindow LoginwindowText "Hello"

But I get an error when trying to image saying "install setup failed: run postinstall script"

I know the script works because i tested it.

Any ideas?

intel, Mac OS X (10.5.8)

Posted on Oct 2, 2009 7:04 AM

Reply
15 replies

Oct 2, 2009 9:28 AM in response to Brian Nesse

No, I get the message when installing it. The image creates just fine. I go to deploy it, it installs the OS, then when it gest to the postimage script, it gives the error message.

In System Image Utility, I have the following:
"Define Image Source" (I use the DVD image)
"Add Packages and Post-Install Scripts"
"Create Images"

It runs through fine. It installs fine...until the post install script fails.

Oct 2, 2009 4:43 PM in response to NeedSomeAnswer

probably not…

try using the defined installer variables instead of a specific path. there's a quick rundown here, though there's probably better documentation of it elsewhere: http://tinyurl.com/yejppmm


basically, you probably want $3:

$1: Full Path to Package
$2: Full Path to target installation directory: /Applications
$3: Mountpoint of installation disk: / or /Volumes/External_Drive
$4: Root directory of currently booted system

your script may be failing because the installer is trying to run it on the booted volume, which won't work. you want it to apply to the restored/newly installed volume.

Oct 6, 2009 10:29 AM in response to Brian Nesse

Boy, this one is giving me a headache 🙂

foilplan, I don't really know what it is you are suggesting. I can't seem to understand it.

Brian, I checked the install logs. I changed the command to:
#!/bin/bash
/usr/bin/touch /var/hello

The logs say "/var/hello" Read-only file system.

Do you know if I have to put "sudo" before commands that alter the file system?

Oct 12, 2009 10:33 AM in response to NeedSomeAnswer

If anyone is still there, I seem to hit another big brick wall on the moduler image.

The post install script works. You have to put the $3\ in front of the path.

The problem lies whenever I add OS updates as well. I am using a 10.5.2 OS Disk to capture the image from. Therefore I add the following packages in the "Add Packages and Post-Insatll Scirpts" section:

MacOSXUpdCombo10.5.4.pkg
MacOSXUpdCombo10.5.6.pkg
MacOSXUpdCombo10.5.8.pkg

My image fails whenever it loads the 10.5.8 package. It will load 10.5.4 and 10.5.6 just fine.

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

Post Install Scripts

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.