WWDC2004 Session 403
Transcript
Kind: captions
Language: en
welcome to a session for three regarding
the mac OS x install application
my name is Jean PFE dad and I work at
Apple in the installation and setup
group we write applications like the
installer application the software
update application and the setup
assistant which is the first application
you see after installing the us once you
reboot the machine first I have a
question for you how many of you are
familiar with creating installation
packages okay maybe sixty percent
seventy percent so for those of you who
are not familiar with creating packages
I'm going to start by giving you an
overview of what are the options
available for you and Mac os10 for those
of you who are familiar after the
overview we'll talk about some of the
new and updated features that we are
bringing to you in Tiger most
importantly we'll talk about
installation plugins and distributions
then we'll talk about how you can create
compatible packages that will install
all the way from 10 dot 12 tiger and at
the end we'll talk about where you can
find some more documentation about all
the Seas so there are two types of
installations that are available to you
on Mac OS 10 the first one drag and drop
installs this is the simplest way to
deliver your application to your users
in addition to that apple also provides
you with an application called package
maker to create packages and the
Installer application to install them on
the user's machine so let's start with
drag-and-drop what are the advantages
well the advantages to users are obvious
it's only one file one application
bundle that your user can just drag to
wherever it wants in the file system
very simple very simple to install it's
also very easy to remove the users the
user can just grab the application
bundle and drag it to the trash the
advantages for you there is absolutely
no complex installation instructions to
write it's very simple process now of
course there also some
edges of using a dragon to install all
the supporting files that your
application may need like additional
frameworks or things like that will have
to be located in your application bundle
you cannot put them anywhere else on the
system because the bundle will be
dragging one location only by the user
your application will need to handle any
read me any license agreement it will
also have to check for proper
configuration when it went when it's
launched again you know you have no way
to do additional checking now if any of
these of these disadvantages are real
prize for you you can actually use the
package base installation so our
installer supports custom installations
the user can go into the custom install
panel and select or unselect packages as
you want you can also check for proper
cut proper configuration you can check
for system you can also check for volume
to make sure that the targeted volume
has the right version of the US for
example you can run pre and post install
scripts or tools these are run before
you copy all the files and after you
copy all the files you can also perform
installation all across the file system
anywhere you want now I want to mention
something about this we recommend that
whenever it's possible you avoid
installing it / system the reason for
that is because some of you may be
familiar with the mac to mac upgrade
feature a view of you install tiger how
many of you have installed tiger so you
may have noticed that one of the first
panel that you see in the setup
assistant is a migration panel that ask
you if you want to migrate from another
machine or from another partition when
we do this migration we do not carry
over files that were installed into /
system or to be more precise we do it
but we do it on a case for case basis so
if we don't know about your file it will
not be migrated all the features of the
Installer it will handle authorization
for you
if your application needs to restart a
ninja log out we will ask the user to
restart a to log out we will also do the
optimizing system performance section of
the installer which is the we will run
the prevailing tool to pre-ban your
executable if you're installing an
application we will register it with
launch services and we will also allow
you to provide some customizable parts
of the UI namely the Welcome panel the
background image and a localized read me
or license agreement so how do you work
how what is an installer package so
first and foremost an installer package
contains the files that you want to
install this is what we call the payload
the payload is just a tax archive in
addition to that attacks a package a
package bundle contains a catalog the
catalog is a bill of materials it's an
indexed list of the files that are
contained in your archive in addition to
that you provide a description file that
gives us the title and the description
of the package also you provide some
flags that tells us how to behave you
know do you want some memorization and
you know things like that do you want to
follow symlinks then you also provide
all the UI parts of the of the
installation process the background
image to read me the license agreement
the welcome screen you also provide the
check tools that will check the system
to make sure that your package can be
installed on and same thing for the
volume the installation check and volume
check tool and then you provide a
collection of scripts that you may want
to be run before you install the files
or after you install the files we make a
difference between pre-install and pre
upgrade depending of depending if you're
doing an upgrade or an install obviously
now you can create as many packages as
you want and then you can group them
together in the UI by using a meta
package an installer meta package
structure is very similar to a package
except the
does not contain any payload it's only
purpose is to group things together in
the UI the way you list those packages
the packages that belong to this meta
package is by adding your key in the
info that TVs that will contain you know
the the list of packages now areata
package also contains some UI sections
the check tools and the different
scripts so how do you create a package
you create a package using package maker
package maker is installed on your
system as part of the Xcode tools its
installed in developer application
utilities and you can run package maker
as a as an application or you can also
run it as a command-line tool that you
can include the new build scripts as it
is today on your CV on the tiger CD that
you have the package maker is a very
simple version of the application it
only creates very simple packages you
will most likely have to go and edit the
file that gets created in order to
support some of the more advanced
feature of the installer however we are
actively working on package maker and we
really hope to deliver to you a much
better application of package maker for
GM so in package maker you provide the
root directory of your software you
specify the different installation flags
that you want to use and you give us the
name of your package description and
then the location of all the additional
files have the ring me in the license
agreement etc on that food package maker
will create a package that PKG bundle
that you will distribute to your users
that package will be installed on the
user's machine using the apple installer
which is located in application
utilities the installer has been
shipping in every single versions of Mac
OS 10 it's always available using the
familiar with it it's very easy to use
so now I would like to introduce you to
Jack Matthew the filthier of
installation
and he's also the person at Apple who
made a career out of creating installer
packages Thank about John Pierre my car
is an Isis feels like a drive a Toyota
so not quite as a much not quite filled
so as a jean pierre mentioned package
makers a really simple application the
things that you need in order to use
package maker our first of all a route
and you can think of this as as / and
let's just take a look at our route here
whoops so our route contains
applications and then our application
and one of the reasons we might want to
use a package based installers because
we're installing more than one thing on
the file system otherwise we'd want to
use a drag install so we also install
something into library application
support so in addition to the rude we
also have this package resources folder
and it contains let's say a
post-processing script that we were
going to run it also includes L proj
folders that contain are localized
resources so in this case I've got an
English read me and in honor of
jean-pierre we've got a friend shell
proj the French read me and so now we
can then begin actually making our
package so let's go ahead and launch
package maker really simple UI so title
let's call it my application version 1
point 0 and description description is
what appears in in custom installs this
package is included as part of a meta
package this is good okay so files this
is where we select our route so where is
that well I've got it right here there's
our route resources
here are the resources and info this is
where you can set up some of the meta
install flags in this particular case
we're installing an application and
something into application support so
you're going to want to have admin admin
privileges otherwise it's not going to
work if you have a really restricted
user that's running the package so
that's actually all there is to it so go
ahead and create package and we'll call
it my apps pkg and you'll go ahead and
put that on the desktop tada that's it
so we can go ahead and launch the
package that's all there is to it and
I'm going to turn the stage back over to
jump here thank you jack so this is very
simple you know there's not much to it
this is very useful so now we'd like to
talk to you about our new features so
first what do we get ideas for new
features well we mostly get them from
you you send us feedback we see we meet
you at WWDC you report bugs often the
more announcements requests and bugs and
sometimes there are real new features
and we listen to what you have to say we
also listen to people like Jack who
create packages at Apple who create
packages for the US and also for
applications there are great source of
information for us and we are please
keep the feedback coming so what have we
done in tiger so here are some of the
new features that might be a fan of
interest for you pal version checking
some of you may be familiar with bundle
version checking which is what prevents
the installer from overriding a newer
version of a bundle on the user's desk
we have extended that to files the
reason for that is because some files
are not part of a bundle things like
fonts for example and currently what our
installer would be doing is H we just go
and install an older version of the salt
over a newer one
so this is bad so we decided to address
that it's worked in a very simple way
for every file that you want to check we
give you a hook where you can provide
your own tool and basically tell us
whether or not the fashion you've
replaced we are going to provide some
standard ways some standard version
checks for some files multiple CD
installations that's a request that we
we heard last year that a lot of people
wanting to be able to actually have the
money to install to be able to handle
multiple cds or multiple dvds so we we
now have implemented that it will be
available through distribution scripts
you will hear about distributions later
minimum you are installation so this is
in order to provide a better solution
for automated installs we now allow the
package writer to specify if some panels
in the Installer should be skipped we
also provide in for some of the panels
will provide a minimal UI which means
that we do not force the user to always
answer a question in the Installer panel
we can we can assume certain replies so
it's useful for automated install it
will also be available through
distribution scripts application
selection one of the panel that you have
in the store today is a target selection
where we list all the volumes that you
have on your machine this is great when
you install in the US but really when
you deliver you have a new version of
your application to the user you want
you want to upgrade the existing one so
what application selection is is a
replacement for volume selection and
instead of disk you will see older
versions of your application on the
user's machine and the user can say this
is the one I want to upgrade and then we
have two more features that i would like
to call two more features that i would
like to go into more details and for
that i'm going to call to engineers in
my team and we're going to start with
plugins installed plugins and i would
like to call chris ran
thank you jump here so I'm going to talk
my name is Christopher Ryan and I work
on the setup and installation team and
I'm going to talk about installer
plugins so Oh dollar plugin so I'm going
to talk about why we have installer
plugins what they are and how they're
used how to create an installer plug in
some requirements when they should be
used and when they shouldn't be used as
well as some demos so let's get started
why do we have installed plugins so
jean-pierre mentioned there are many
ways to customize your installers
experience you ever read me a license a
welcome panel as well as a custom
background but we've been hearing
requests from many developers that you
want to do more you want to do things we
haven't thought of you want registration
serialization maybe even a summary or
conclusion at the end of the install and
so we're going to provide you some plug
a plug-in support so you can do this so
what are they they are customizable
section in the Installer similar to how
you see the readme and license and the
target flex panel they're provided by
developers inside your packages or
distributions they are loadable code
which can have nibs as well as other
resources you need but the best show you
these plugins we're going to bring Jack
Matthew up to show you a quick demo
Thanks well Chris so again this is just
best scene so let's go ahead and launch
a package that is using a couple of
custom plugins so the first thing you
might notice here is on the Left there's
some this some more stuff so let's just
go ahead and continue on to one of these
custom plugins here's a registration
plugin this is the what we call a
section and we're going to go into more
details in a moment but let's go ahead
and fill this out and then we're going
to enter our serial number and you might
notice that the continue button is
grayed out until we enter our extremely
secure product key and here's here's a
second pain so you'll notice that the
bullet over here stayed on registration
but this view here changed so let's go
ahead and ruin this disc
and incidentally or your various plugins
can talk to each other through a shared
dictionary so here we go and we're done
yay and look at this this is an example
of a late breaking news plugin you might
want to just give someone the latest
information off of your own webpage just
something we were able to make really
quick so you'll see over here breaking
news and oh yeah in case you didn't
notice the Installer windows resizable
knowledge and that is a package with two
custom plugins back over to Chris thank
you jack as you can see you can
customize the installers experience how
do we do this so we have an Xcode
template now in Tiger which will create
a very basic plug and you can use to
extend we have a new framework called
the Installer plugins framework which
contains two new concepts that Jack
alluded to the Installer section and
installer pain I'm going to go over
those in a second so here's the window
that you saw that Jack showed on the
screen with the late-breaking news
plugin each plug-in contains one section
so here's the registration section it's
provided by the registration plugin it
also contains two panes and the
late-breaking news section contains one
pain so you can have one or more pains
per section so in the Installer section
you can customize customize a few things
one is the title this can be either
dynamic or static so you can decide the
title at runtime you can also decide
whether to actually show the section or
not for registration for example you may
not want to show the registration
section if your product is already
registered on that machine also you can
decide the panel ordering at runtime
from your section so here's an example
here's the example registration section
and the title which you can customize is
highlighted so how do I do this you can
customize the title of your installer
section using the Installer section
title key in your info fewest file and
this is this is localized you can
pila strings file also you can do this
at runtime by using the Installer
sections title method in the Installer
session subclass and a subclass in
installous section you need to provide
the NS principle and that's principal
class key in your info.plist so the
Installer knows exactly which installer
section class to load and then we also
have a very important method called
should load which allows you to decide
at runtime whether your section should
load in the installs you are not so
here's a quick example of should load
method in this example we have a section
that should only run on a machine with a
with one gigabyte of memory as you
notice you can use this control or any
other system libraries to decide whether
your section should load or not and it
checks for one gigabyte of memory and if
there's one gigabyte of memory it
returns desk the Installer load the
section otherwise it's not loaded so the
real meat is the is the view and what
you see on the screen so you can
customize this using an installer pain
the Installer pane provides a title just
shown here in the top provides the
content view which is the content area
your custom view to the customer as well
as some slow control whether you can
move forward or backward and whether
they can press to go back or continue
buttons here so to customize these using
the Installer pain to customize the
title there's there's an installer pain
subclasses title method which you need
to override the content view you either
set up the content view outlet in your
nib which which is pretty obvious in the
Xcode template if you look at it as well
as you can also return it dynamically
using the content view method in your
installers pain subclass also to note
that Jack showed you that the Installer
window is now resizable so it's very
important that you stick with the
minimum size of 4 18 by 3 30 for your
pains but allow it to resize correctly
and look correct in a resize environment
so how do customized installers flow
control the Installer pains have a next
pain outlet which you can decide which
the next pain for your for the current
pain is in the nib or you can do it at
runtime using the next pain method
and there are also some entering and
exited will enter will exit did enter
did exit as well as a very important
should exit method which gets called
when the user clicks to continue or go
back button on your pain so you can
decide whether you want to exit the pain
or not at runtime so here's an example
of that so in this example you may want
to warn the user that they have to that
they might have we might have to send
their registration over the Internet and
so when the user clicks the continue
button we're going to the install is
going to call the should exit pain
method on your pain and you're going to
return no and show an alert warning them
that we're going to send their
registration and when the alerts
complete there's the Installer pains go
to next pain method which you call to
advance to the next pain so how to use
your plugin you have to put your plug-in
in the content plugins directory of your
package or distribution and you also
have to accompany it with the Installer
sections plist file which you'll find in
the Xcode template which defines exactly
where your section fits amongst all the
other built-in sections in the Installer
here the registration section a reg
registration plugins section will get
loaded between the license and the
target section and the Installer it's
also important to note that we've
actually turned we've actually using
this technology in our own installer and
each of the Installer sections our
installer plugins so let's show you how
to create one of these Jack
we really really high if theres the mic
we're going to make a very simple
plug-in it's going to be the hello world
of install our plugins here so since I'm
not very fast at typing I've got some
pre-canned code here we'll just go ahead
and put that in our pace board and we're
launch Xcode and as Chris mentioned this
is a standard template it's really easy
to find so X codes launched we're going
to go ahead and create a new project and
then you'll see a section called
standard apple plugins so let's go ahead
and find that where is it standard apple
plugins install our plug-in and we're
going to go ahead and put that on
desktop okay so first let's go ahead and
look at our code here so you'll see that
this is a part of the template here this
is the the title method it just returns
the the pain title and I go ahead and
paste in this code and this is going to
believe it or not just going to make us
a very very very simple basic plugin
this should exit pain method that Chris
mentioned this is going to get called by
the Installer when you click the
continue or go back button and we're
going to use this to present a goodbye
message before the user actually is able
to go to the next plugin so we'll go
ahead and save that and then we're also
going to go into the nib and add some
hello world text
okay so here's our content view
ok save
and let's go ahead and build it see what
happens
okay and I believe we are done so let's
look at the god I've got a package ready
to go here to take our plug-in just
confidence of this okay okay show
package contents and here's the contents
folder now we're going to need to create
a plugins folder inside of contents and
so as Chris mentioned it's going to need
to contain two things the first is of
course your plug-in bundle that you
built the other thing is the Installer
sections plist file and that determines
the order of your plug-in relative to
the to the everything else the built-in
plugins or any other plugins that you
might have so there's that here's our
bundle and that should be it now let's
go ahead and double-click our package
and see what happens now I didn't change
the the Installer sections plist file
but if we wanted to have our hello world
be first we would have done that and we
could have made it first continue read
me and there you go until let's try to
click continue and goodbye and that is
it simple
thank you jack as you can see it's
pretty easy to create an installer
plugin so some of the requirements and
restrictions on these plugins first of
all installed plugins are only available
on tiger so if you're making it packaged
and you include installer plug in these
plugins will be ignored on previous
builds what this means is that you
shouldn't rely on your plugins for
serialization of your application or for
registration you should you should use
this as a as a helper to get the best
user experience to your customers while
they're installing also it's important
to note that now we have a new feature
in the installer and tiger which is
multiple CD or disc DVD installs and
with this that means that your plugins
resources may not be available at all
times so it's very important that your
plugins do not access their resources or
data while they are not currently active
or not being methods aren't being called
from the Installer on your plugins so
with that I'm going to hand it over to
Peter Biermann who's going to talk about
distribution scripts Peter thank you
Chris I'm Peter Baron I work on the
installer team with Kristin jean-pierre
and some other people I'm going to be
talking about distribution script
another new feature we have in tiger
pretty excited about this it's going to
give us some cool new features so
distribution scripts are all about
controlling the installers user
interface I spent a lot of my time
advising developers that if they can
they should use a drag-and-drop
installer but often they can't and it's
because they have a more complicated
piece of software usually as their
software gets more complicated they move
into using what we call em packages or
meta packages that jean-pierre talked
about and when you start using meta
packages it gets to be difficult to
control the installers you I the good
thing about using the installer is that
you get a consistent user experience the
downside of especially meta packages is
it's hard to create that consistent user
experience so here's the diagram of the
installation package that jean-pierre
showed you earlier as you can see
there's lots of little files you have to
keep track of in particular this section
in the middle is all the user interface
controlling files
lots of flag lots of keywords things
have been added over the years when you
start to deal with meta packages you
have all the same packages and all the
same flags they're just scattered
everywhere so we've created distribution
script distribution scripts take all of
those flags and move them into a single
file hopefully it makes it easier for
you guys to create your packages keep
track of how the user interface is going
to look when the user is using your
installer so how do we do this we're
going to use XML and JavaScript we've
decided to use XML because it's easy for
machines to read and write and because
we're using application specific
elements it can be easy for humans to
read and write we're also using
javascript javascript looks like sea but
it has a lot of cool features like
garbage collection and associative
arrays makes some things a lot easier to
deal with it's also sandbox inside of
the installer application that means you
can't read write files you can't go to
the network you can't arbitrarily do all
sorts of other stuff but it's useful for
the installer to actually certain
questions about your user interface now
a lot of people they hear JavaScript and
they get concerned they've heard from
their friends who programming Java
scripts that it's it's a pain there's a
lot of things you have to worry about
almost all those things are web browser
specific the installer is in a web
browser well let you put one in your
plug-in so you don't have to worry about
any of that how would you start with the
distribution script well you'd have a
file it can be called anything we've
gotten away from those package space
filename have to have a DI st extension
it ends up in the content subfolder of
your package or em package and within
the distribution script itself any of
the strings you use that our user
interface items can actually be he's for
the localized strings elsewhere in your
package bundle
so to take a closer look at distribution
scripts here's some of the beginnings of
the distribution script vocabulary you
can see here there's the first element
is installer GUI script this actually is
the container elements for all the other
elements ease inside the distribution
script then we see a title element which
within the title elements contained your
title your package title and a welcome
or read me in license elements these use
a file attribute to specify a file
located in your package resources much
like there are flags for these same
things in the current installer package
format now things get a little more
complicated here we have a package
reference element this has an ID
attribute that's used to refer to the
package reference element elsewhere in
the distribution script it also has a
kilobytes attribute which will be used
by the Installer you I to show how big
your packages this particular package
finally there's a file URL here for
where the Installer framework itself
will go and get your package when it
comes down to do installing one of the
interesting things about this is what
you're seeing here is the beginning of
the Installer doesn't actually need to
look at your packages to present any of
the UI it's actually going to try to get
as much of this information from you up
front and then hand your list of
packages to the framework when it's done
so when we get to the UI we get to the
custom install panel and things get even
more interesting here we see a choices
outline element this is the beginnings
of you setting up what exactly that
custom install panel should look like
there's two line elements here they
refer to two choice elements named app
and extra these names can be whatever
you want the choice element the first
choice element here we've called app it
has a title in this case it's not
localized it's just right in the
distribution script and it also has
within it a connection to the package
ref element you saw in the previous
slide let me do that again with the
extras item so you put those two
together we end up with a very familiar
custom install pal there's nothing on
this screen that you can't do yourself
currently with packages or n packages
but it's a little simpler to do with
distribution script and we can throw
that all together here's the whole thing
all of them come
fine you can see the various choice
elements line elements how they all are
connected to each other so that's what
you can do today with a new syntax xml
file yeah it sounds great but there's a
bunch of cool new things you can do with
it for example you can now attach
multiple packages to any one choice you
can break up your software in any way
you want and connect the things to the
choices the user sees in the UI
completely separately from how you
package your software you can attach the
same package to different choices you
can have you know some app support
package that never changes that's
attached to all the various things that
the user could install you can show the
same choice in more than one place you
could create a very creative custom
install you I where you've got groups of
things and well you can use your
imagination there and you can enable or
select choices based on the user's other
selections inside the customization
channel and the system configuration now
within packages you can do this but it's
difficult there are flags and most of it
involves packages ruling themselves out
because they don't like how machines
configure your so on with distribution
script it's much more explicit you have
very complete control over whether
packages enabled or disabled selected or
be selected so how do we do that well we
have these choice elements I showed you
a few seconds ago and the choice
elements represent the choices a user
can make inside the customization you I
the choice elements have attributes like
selected enabled and visible and the
values of those attributes can be
JavaScript expression so here we see
again a very simple representation of
the custom install panel and let's take
a closer look at those two choices a
very common idiom is for people to have
a nap and some dependent package or they
want these two things to be related to
each other for example if I deselect the
app I want the extras to become
deselected and disabled so the user
can't install the extras separately from
the app I reflect the app the extras
become enabled that's
so how would we do that using a
distribution script here we see the
choices outline again that just sets up
the outline view and we see our two
choices our app and our extras choice in
the attributes for the extras choice we
have an enabled attribute and a selected
attribute the enabled attribute is a
JavaScript expression it's choices apps
dot selected now that refers back to the
chalk to the app choice that's in the
middle screen there that choices word
there that in that JavaScript expression
is actually an object that's provided by
the installers runtime that allows you
to connect to the attribute to the
choices declared in XML these are all
the attributes of the choices are
dynamic at runtime so when the user
checks something you can determine
whether checked which one's checked
whether it's enabled things like that
the selected attribute is a little more
complicated in this case we want the
user to only be able to select it if the
app is selected so that's that first
half of that and expression there the
other half of it is sort of
self-referring what that means is that
if the app is selected the value of the
selected attribute of the extras is
equal to whatever the user wants it to
be if the user clicks it it's selected
if the user unselected it's deflected
and again that choices object is
provided by the Installer runtime
connects you to all the live state of
the various choice elements now there's
a couple other objects that we provide
in the Installer runtime and I'll talk
about those so here we have the
JavaScript system object this is a again
provided by the installers runtime it
contains a bunch of methods and static
data about the configuration of the
machine it lets you inspect that from
your distribution script and it's
read-only you can't go into it and
change things about the machine you
can't say oh the machine has two gigs of
RAM now that's not going to be possible
but you can use
things like CTL you can get the values
out of a plist anywhere on the file
system and you can use the IO registry
find out if your hardware is connected
for example here's an example we can set
up our application to only be enabled if
the machine has 128 megs of ram here you
see the enabled attribute of the choice
of the app choice it's connected to a
JavaScript function that we've named has
128 megabytes and that functions
contained within a script element you
can have as many of these script
elements as you'd like within your
distribution script and you can put any
javascript you'd like inside these
script elements here we have a function
that I've written has 128 megs of ram it
uses the system dot CTL method to find
out how much physical ram the machine
has and returns yes or no depending on
whether there's enough so that's a
pretty quick look at some of the neat
things you can do just going to look at
more some of the more advanced things we
can do with it
okay put the clip on too so first let's
just go ahead and dive into a package
that is using a distribution script and
look at something that you've never been
able to do before we're really excited
about this okay
ok
so
so first off just going over what Peter
Peter showed you in the slides you can
you can do this again this is a very
common idiom say you had a font that
needed to go with your with your
application and you wanted to provide
this kind of optional install here but
the fonts no good without the app
something like that you can do now now
let's look at this this is a little more
interesting you'll notice that I clicked
on this but see something happened in
here so let's go ahead and we'll get the
look at this expanded here and you'll
see that as I click these items other
items become selected finally we can do
stuff like this this is great so let's
look at another example
ok
so well this this isn't very interesting
is it but let's let's just go ahead for
a moment and look at the the code for
this this is let me introduce you to the
first JavaScript I've ever written
literally this took me minutes to figure
out it's very very very simple so we
have some standard stuff in here like
has a welcomed RTF okay fine then we
start talking about here the choices the
line items that appear and the custom
install UI and then we begin to actually
accumulate information about each of
these choices and a few different other
XML tags here first we're saying here
here's choice that we're referring to as
a its got a title it's called nifty
application then we have a choice called
be be has a title as well and we're
saying that it's enabled you can you can
you can select this package but here's
another interesting field here start
selected what is the default selection
state of this of this choice well it's
the function so what is this function to
well we've gone and embedded some
JavaScript here inside of this XML tags
as cooking so say you wanted to say your
application goes and lays down a cookie
file and then on you know subsequent use
of an installer you don't want to
present that option by default so uneasy
install a more reasonable thing happens
so simply here I go ahead and use the
built-in system object system files file
exists to pass and then I guess and give
it a pass so let's go ahead and and for
fun go ahead and create that pass
permission denied I've been denied you
have our ways oh oh perhaps we don't
okay
Oh
okay well I assure you that if I had if
I had is successful it successfully
authorized here that upon second launch
of of that package we would have seen
that by default that optional item would
have been deselected okay so that is a
quick demo of distribution scripts and
and and the stage back over to here
thanks jack we actually tried a lot of
this stuff earlier today and something's
got to go wrong during the actual
presentation so there you have it so if
you do these if you work on these
there's a couple things you should watch
out for both XML and JavaScript are case
sensitive if you run into some
mysterious problems you're confused try
using users in XML lint it's included in
the system it'll look through your XML
point out any problem you have missing
characters missing Flash's things like
that one of the most common things you
have to watch out for is there's five
characters you have to escape and all
XML documents that's the left and right
angle brackets the single double quote
and the ampersand if you decide to write
some software or some scripts to create
distribution scripts for you instead of
doing them by hand you can use a
function such as the CF function CF XML
create string by escaping entities
that's a mouthful but beware that
function has a bug in 10 dot 3 it
doesn't make it very useful but it is
fixed in the tiger build that you all
have you can also use similar functions
in your favorite scripting languages so
distribution script this was just a
teaser we hope to buy the GM version of
Tiger have what we're going to call it
package translators that will look at
your existing end packages and build you
a distribution script so you'll have
something to start with there's also a
session download that's available on
connect on apple com for this session
that includes a documentation a test app
to play with distributions and some
sample distribution script unfortunately
the installers that is in the tiger
build that you all have doesn't
currently deal with distribution scripts
were in the process of building them up
and adding more support for them so now
is a great time for us to hear your
feedback about it it's still under
construction please play with it and
send your feedback to installer disk ash
feedback at group apple com and now the
man you've been listening to all through
the session jack is going to come up and
give his presentation on building
compatible packages yet oh well oh my
god okay so let me formally introduce
myself here my name is jack massie and
my team at Apple are apples and can we
get the slides on please all right okay
so my team are apples package developers
were like you guys we work on the OS
install the OS updates the ilife
applications the pro applications such
as Final Cut DVD Studio Pro a bunch of
other little random small updates like
security updates we also help keep
software update running and we work on
the windows installers as well so I'm
here to talk about compatibility we've
seen some really great new features here
today but if you're like us you have to
deliver software to people that have
older machines so let me just go over
what I'm going to talk about here first
of all making packages that work with
both 10.1 as well as tiger we're going
to talk about some of the things that
have happened to the package format over
time go over some features that you may
or may not be aware of we're going to
we're going to talk about if your
application or if your package really
must use some of these new features that
we've been talking about here that if
someone gets a hold of data on an older
system that the the right thing happens
and then we're going to talk about
packages that are a little bit more
complicated that use things
like custom install and a mixture of
some of these new and old features and
kind of how to get the get the best make
some compromises and deliver something
that's going to work for the maximum
number of people so first off simple
packages what do I mean by that packages
that basically just install your bits a
little more than that maybe they run a
pre or post processing script so the
first thing to understand is that a
package that you built on 10.1 is still
going to run when you launch it on tiger
and similarly if you build your package
using package maker on tiger it's going
to run on 10.1 and if you need a little
bit more functionality in your script
the installation check and volume check
scripts as well as the pre and post
flight scripts still work in Tiger and
work all the way back to 10.1 so let's
now talk about some of the stuff that's
happened to the package format over time
so 10.1 something called my app PKG as
you can see especially in the in the
scripts up there Maya my app is attached
to a lot of these resource names dump
that in 10.2 and 10.2 packages became a
real NS bundle and they have things like
an in soapy list and all the resources
inside of that package have a consistent
name this is good this is good because
well first of all for users if they
rename that package it works it used to
break consistent file names are really
useful for things like automation and
Apple localizes its software into 15
different languages a nice little bonus
that happened was that by separating the
meta install flags from the things like
the description and title now we no
longer have some of these met install
flags accidentally localized for us so
that was a nice little thing
additionally the payload and catalog
file that is the bill of materials and
the archives changed in file name only
so under the hood they're the same exact
file so what package maker does for you
is create symlinks that when you run
that package on the older system it's
tricked into the right thing happening
so some some features and changes here
and 10.2 we added a feature called fine
files and fine files is useful for
updating your application in a location
that the user may have moved it to users
extensively and all the OS updates
because we only ship parts of each
application we don't rishe if mail when
we want to update it just just a little
bit that changed so so we use it quite a
lot we depend on it we also added the
brac the background pictures feature
which allows you to include custom
artwork for the installer to display and
in 10.3 we made that slime files feature
a little bit easier to use and another
notable thing for a package authors here
is that we enhanced the follow symlinks
feature so that if those thin links
point to things on other devices that it
works and on Tiger 44 application
package developers there are more
features that apply then to to you guys
than any other OS release so I also
wanted to mention some some things that
you should be aware of if your
application has to work on 10.2 or
earlier now these are these are things
that we've fixed in 10 points3 but
things to keep in mind and we just like
to mention really quickly here so first
of all when you make your route make it
relative from / in other words if you
are creating an applique if you are
installing an application your route
should look like root and then
applications and then your app this is
as opposed to just slow
capas root and changing the default
location inside of package maker it's
actually gets around a few little edge
case bugs and especially important if
you're using the fine files feature the
what you expected would happen might not
happen if you don't do that additionally
make sure that in your route the
permissions are correct should be you
know 1775 for your route and and and and
so on this is because there's a bug
where on upgrade installs the state of
the override permission flag is ignored
so you reinstall the packages second
time it's going to make the permissions
be whatever was in your route which
might not be what you want additionally
meta packages do not run the
installation check tool so simply
include that logic inside of a packages
installation gentle and again all the
stuff works in 10 3 and integra so Tiger
only packages you need to use the
distribution scripts you need to use
plugins you want to make sure that if
someone gets ahold of that on on a 10 3
or earlier system that they're not able
to install that package because remember
it the 10.3 and earlier don't understand
what a distribution script is so what do
you do so you include an installation
check tool that is going to exit with an
error value and then on Tiger the
distribution script is going to take
precedence so you put your real
requirements inside of your distribution
script for your 10 for your tiger or
later customers and on the older systems
installation check gets run and it just
is its what's with an error and one nice
thing about this is that it doesn't
require any special strings files it's
going to use a generic error message
built-in to install or so it's going to
be localized for all languages as you
can see here that just makes it with the
value 96 very very simple it's just with
its five and six sets
so packages that use some more advanced
features and are still compatible so as
I mentioned before you can include a
distribution script as well as
installation check and volume check
scripts the installation check and
volume check scripts can of course meet
the requirements for your 10-3 customers
and the distribution script it's going
to get run on tiger and you can take
advantage of some of the more subtle
controls like the default selection
state for example probably you some of
you've seen this even if the
installation check and volume check
script meet your needs you should also
or you can also include a distribution
script and on tiger systems it's going
to get rid of this user interface so
distribution scripts again are a place
where a custom install is is when we
talk about customers all we talk about
distribution scripts so there are a few
things to keep in mind here a package or
meta package is a line item in custom
install for 10.3 and earlier you're
going to have to package around this now
there's nothing that says that you can't
make a little bit more subtle behavior
in 10 point or tiger and and have a
slightly different user experience
there's nothing wrong with that and also
keep in mind that the check scripts can
only skip packages can this package be
installed at all or not and again you
can't affect the default selection state
so moving on to file version checking
file version checking provides a really
nice framework for you to check check
versions of files now if you really have
to check the version of a file there's
nothing that prevents you today from
taking a badge of the pre and post white
folks
you run your own code and do the right
thing it's more effort but hey you can
you can still do it multi CD
installation is another great new
feature now on tiger you can use you can
use distribution scripts to make
everything happen and and have that nice
user to transfer tiger customers and for
pre tiger customers you can simply
include extra meta packages on each CD
that guide the user into installing for
example you know install me first dime
package and stolen second dub and
package install my third doesn't package
the important thing to remember here is
that you don't actually have to
repackage your bits but pkgs are the
same thing you're just including this
extra little thing that that make it
work now install our plugins as Chris
alluded to the Installer the pre tiger
installer ignores plug so you know you
can include the plug-in and will run for
tiger customers and what we recommend
that you do is if that UI is really
important to move it into your
application and on first launch display
it this is you know a really obvious use
for these plugins is some sort of
product key or serial is a serialization
now you should keep in mind that someone
can always go in from either the command
line or you know third-party third-party
tools and just pluck the contents out of
your package it's not secure it's it's
not going to be secure in that way it's
not a real gateway for copy protection
so you should move that kind of stuff
into your app anyways that said here's a
screenshot this is the final cut express
installer and you can see some user
interface that kind of looks like it's
part of the Installer it's not it's it's
own application we don't recommend that
you do this but it is possible this
particular example use the volume check
hook
and the installer is just running an
executable so your executable can be as
clever as it needs to be to kind of
pretend that it's a part of the
Installer again don't do this if you can
avoid it there are a number of edge case
bugs it just doesn't integrate well so
just summarize what I've talked about
some of the things that you should you
should remember to take away from this
so there grabbed a compatibility
packages that you made will still work
packages that you made in Titans that
you make and tiger can can still work on
older versions of the OS and this is all
true if you use package maker as a
starting point now it doesn't have a lot
of features hopefully we can add those
over time but still use it as a starting
point that's going to create the basic
structure of a package that's going to
be compatible now as you saw in the 10.1
a package diagram there are a lot of
other little names attached to the the
various resources with the exception of
preflight and post flights so if you use
pre-flight and post flight across the
board it's going to work everywhere and
finally you can use a mixture of both
some of the new features we've talked
about and the old teachers together all
in the same package and it's going to
get you something that'll basically work
out for you so at this point I'm going
to turn the stage back up with
jean-pierre Thank lot thank you so where
to find documentation well you can find
documentation in two places let me start
with the second one on that slide of the
software distribution document this does
not refer to the distribution script
that we talked about today this is a
document that we have that explains how
to create packages and on how to use
package maker this is actually on a
website you can go ahead and download it
it's very useful explains all the slides
you need for the tea list but that's for
Panther for tender three packages we
will expand it to
include some of the tiger features but
it's not it's not been updated yet now
we have a session download connected
apple com if you go to the session for
three you will find something that
contains all the example that we showed
you today you will find a simple example
of a file version checking and how it
works some documentation you will also
find a folder called install plugins
that will contain the plugins that we
showed you today and the sources and the
project file for xcode and you will also
find in there a distribution folder
which contains the distribution test app
remember that distributions do not work
with the tiger installer right now so
you need to use the distribution test
app and submit some of the examples that
you were shown today as well so thank
you for coming for this session we're
not going to have a Q&A and I would like
to call the people in my group back on
stage including a Jonathan sugar and al
dual are in solitary