Hello
I’ve been watching this forum for quite some time and I’ve been also using InstaDMG to create our deployment images. It’s a great software and I thought I’d share a script that I’ve been using a lot lately (since starting to use puppet for mac administration).
This script, buildpackage.sh, creates ARD (and hopefully InstaDMG) ready pkg files and it also creates puppet ready dmg files from the packages. The basic workflow is this:
1.) Create a project directory. In this example lets call it mysuperapp. cd into that directory and run “buildpackage.sh -c” which will create the basic directory structure
2.) Copy the files you want to install in the relative subdirectories in component directory. For example component/Applications/MySuperApp.app
3.) Run the script with the following options: “buildpackage.sh -t mysuperapp -n 1.0.7”
4.) You will get mysuperapp-1.0.7.pkg and mysuperapp-1.0.7.pkg.dmg files in your output directory, ready for deployment.
Get the script here: [url]http://users.jyu.fi/~hpjuutil/temp/buildpackage.tar.bz2[/url]
The script is especially useful when creating packages from simple apps. It makes sure the ownership is root:admin and that others do not have write access to the files. It also removes extended attributes (com.apple.quarantine, com.apple.FinderInfo) and removes Contents/Resources/TokenDefinitions.plist from the packages so that the installer doesn’t divert files.
Test it and please let me know if there’s any problems or suggestions.
Best,
Hannes Juutilainen
University of Jyväskylä
Information Management Centre
Thanks Hannes,
I’m just now getting into Puppet. This script will help out. I may deconstruct it, since some of my packages are from other programs than packagemaker.
Rusty
This is a very useful app. However there are a lot of bugs I’ve run into.
First the script won’t run from my network home folder. Every instance of chown gets an Operation not Permitted.
Next it seems it can’t be run if the path has spaces in it. My setup has two partitions , one System and the other Temporary Storage, and the script fails with invalid path that stops at the space.
Another thing I noticed is the timing for changing the permissions of these apps before packaging. It seems changing the application’s permissions causes flags to go up with Disk Utility and Package Maker about the disk permissions. This only throws warnings but it’s a bit unsettling and annoying seeing the same warning for every single file. Here’s a sliver of the output
[code]
Setting owner and mode to root:admin, rwxrwxr-x
—
Creating package with command:
/Developer/Applications/Utilities/PackageMaker.app/Contents/MacOS/PackageMaker \
–root /Volumes/System/facultyApps/component –resources /Volumes/System/facultyApps/resources \
–scripts /Volumes/System/facultyApps/scripts –id “com.perf.facultyApps-1.0.0” \
–title “facultyApps-1.0.0” –version 1.0.0 –target 10.4 –no-recommend \
–out /Volumes/System/facultyApps/disk/facultyApps-1.0.0.pkg
2009-05-05 10:57:08.473 PackageMaker[1565:10b] Setting to : 0 (null)
2009-05-05 10:57:08.476 PackageMaker[1565:10b] Setting to : 0 (null)
2009-05-05 10:57:08.617 PackageMaker[1565:10b] relocate: (null) 0
Warning: User ID 1255435942 does not match 0 of root volume for “/Applications”. Make sure to have disk permissions repaired with Disk Utility.
Warning: User ID 1255435942 for “/Applications” exceeds 16 bit. The package might not install correctly.
…
Warning: Mode drwxrwxr-x does not match drwxr-xr-x of root volume for “/Applications/Keychain Minder.app”. Make sure to have disk permissions repaired with Disk Utility.
Warning: User ID 0 does not match 501 of root volume for “/Applications/Keychain Minder.app”. Make sure to have disk permissions repaired with Disk Utility.
[/code]
It seems OS X doesn’t like the chmod to 775. Maybe it should be 755? Giving only root ability to write to it but others to read and execute should work maybe?
(Edited by Patrick Fergus, 5/8/09 2:31 p.m. CDT since treydock seemed ok with wrapping the PackageMaker command)
Hi and thanks for the info. My posts are being detected as spam so let’s try this without a link…
The first warning “User ID 1255435942 does not match 0 of root volume for “/Applications”” means that your component/Applications directory has different permissions than the /Applications directory on your local hard drive. This should be fixed by changing the owner of component/Applications to root (chown root:admin component/Applications).
The second warning means that you already have Keychain Minder.app installed in /Applications but the package you are creating has a different set of permissions. In this case the package you are creating has the correct permissions (root:admin drwxrwxr-x). You have propably installed the Keychain Minder using your own account which means that the permissions are you:staff drwxr-xr-x
The script sets the mode and permissions to be the same as Apple apps (root:admin drwxrwxr-x). This means that files are owned by root but can be modified by anyone in admin group. Normal users have only read and execute rights.
I’m not sure about using the script on a network drive. I’m currently running it on my build machine and build server and then moving the output to a network share.
Best,
Hannes
Damn this spam filter…
Version 1.0b2 05/2009
# – Every path should now be correctly quoted
# – Added repair functions for ./Library, ./Library/LaunchDaemons and ./usr/local/bin
# – We’re removing all extended attributes on source files (instead of only FinderInfo and quarantine)
Get it from the temp directory linked on my original post (remove the filename from the link).
PS. treydock, could you modify your post to not include the full PackageMaker command? It seems to make the page awfully wide… 🙂
Best,
Hannes
[QUOTE][u]Quote by: hjuutilainen[/u][p]Damn this spam filter…
PS. treydock, could you modify your post to not include the full PackageMaker command? It seems to make the page awfully wide… 🙂
Best,
Hannes[/p][/QUOTE]
Excuse the supidity , but how do I edit a post?
Edited it for you. I don’t know if you can edit a post after a certain amount of time–the board may lock posts (but don’t quote me on that).
– Patrick