In this lesson, we're going to learn how to install package files using a script now more and more
applications that you download either come from the store or come in drag and drop disk images.
But occasionally you're going to come across a package file in later sections.
We're going to learn how to create our own.
So it's very important that you understand how to install a package file using a script.
Now, we're going to go ahead and use flash player as an example because it is available as a package
file, though, when you download it, it actually is a disk image.
And we'll take a closer look at that.
So, first of all, we can see that flash player is not installed and we go to the download link and
we click download.
Now, it's going to have us download a disk image like I had suggested.
All right.
So what's going on there?
Well, let's go ahead and take a look.
I've already downloaded it on my computer.
And if we go to our downloads folder and take a look, you can see that we've got the install flash
player disk image.
So what are we going to do is I'm going to go ahead and mount the disk image to my system and then I'm
going to go inside the flash player volume that is created.
All right, so if I give you a listing of the flash player volume, you can see that there is an app
called Installed Flash Player.
Now, if you double click on that app, it would bring up a wizard, kind of like you get when you install
applications on Windows.
If we take a look inside the app, because as you can see, an app folder is a directory.
And so when you have Firefox DOT app in your installs folder, it's also a directory.
So let's go ahead and take a look inside this directory.
So we're going to go ahead and we're going to do a find from our current folder name and then start
a package, which is package file.
So show me every package file inside the flash player volume.
And so as you can see, I'm getting feedback that there is a package in the contents resources folder
called Adobe Flash Player DOT package.
And basically the disk image is just hiding.
This package file in this package file actually is all you need to install Adobe Flash Player.
Now, the reason why things come in a package file as opposed to being a drag and drop app like we've
seen with other applications, is package files tend to need to put files in different places to in
order to work properly.
So Adobe Flash Player is a Web browser plug in and it's going to have to put things in the plugins folder.
So if we just put it, it'll be flash in the applications folder, then our Web browsers wouldn't be
able to see the plugin.
So what we need to do now that we found this package is what we need is we need to copy the package.
So we're going to copy from install Adobe Flash Player DOT app contents, resources, and then there
be Adobe Flash Player DOT package.
And we need to copy this to our install server.
All right.
Well, I've already done that.
So let's go ahead and take a look at our job.
And so what we're going to do is we're going to download the flash player package from our install server
and we're going to download it to our temp folder.
And then we're going to run and install our command with the package.
Perama, which gives it the location of our package, is located.
And then the target option says, where do we want the package installed to?
And we're going to stay the root of the hard drive.
And then after the installation is done, we're going to go ahead and delete the package file.
All right, so let's go ahead and first, let's quit Firefox.
And then let's go ahead and run the installation job, and it won't take but a moment and we'll see
that it is installed successfully and we'll go ahead and relaunch Firefox.
And let's go back to the.
The flash player helped site, and this time when we click check, it should say that we have flash
installed.
OK.
Which it does.
So that's how you can install a installation package with a script and in a later sections we're going
to learn how to create our own packages and you'll be able to deploy those with the same method.