In this lesson, we're going to learn how to install applications from a disk image now a disk image
is probably the most popular type of download that you'll find for installing applications on a Mac.
So the first thing I want to do is go to my downloads folder.
And if we go in there, you can see that I've got a Firefox DMG or disk image file.
So what we're going to want to do is since we're going to be installing two tons of Macs, is we want
to put this in a common place that everybody can get to.
So previously we've used our installs website.
So let's go ahead and bring that up.
And you can see that we just still have our mobile config profile on it.
All right.
So let's go ahead and let's copy.
Or Firefox disk image from our download folder, and we're going to copy it to our installs share on
the Web server.
All right, so it's that's Kopi now let's go ahead and refresh, and we can see that Firefox's is here.
So what we're going to do is we're going to copy this link so we have the URL and we can put that out
of the way.
Now, what I want to do is start building a Firefox app.
So what we're going to do is we're going to have a job and we're going to go ahead and use that template
that we've created.
And what we're going to do is we're going to just start manipulating this template.
So we're going to first thing we want to do is we want to download the DMG and then we're going to also
use Chrome like we did before, except for now we're going to paste in the path to our Firefox image
and now we're going to copy the name of the Firefox image and we're going to put it into temp like we
did with the mobile config.
And what we're going to do is we're going to take this percent, 20 and we're going to just change that
to a space now, we're not going to be importing a profile now, as we saw in a previous lesson after
you downloaded GMG, you you basically mount the DMG.
And so we're going to go ahead and get rid of this.
And then after you mount the deed and you copy the application.
To your application folder.
And this line is not needed, and then after we copy the application to the folder, then we unmount
to the DNG and then after that we don't need the DMV anymore so we can delete the DMV.
OK, so now we've got a skeleton for our our job.
So let's go ahead and save this.
And we're going to save this to the install applications folder and we're going to call it Firefox sixty
six three and say.
OK, so if we go to install applications, we've got this job again now we've got this line that we
we haven't tested it, but it should work.
So let's go ahead and try that on on our machine.
And so we hit enter and it starts downloading, and if I do a listing of our temp folder, I can see
that Firefox is there.
OK, so that line work.
All right.
Now, the next step that we got to do is we got to mount the Firefox disk image.
So HDI util and then attach and then temp and then Firefox DMG.
OK, that seems to work, it's currently mounting.
And so I'm going to go ahead and copy this line and I'm going to go back to the app and I'm going to
put this under Mount DMG.
OK, so the next thing that we want to do is we want to copy the application to the application folder.
Now, if we go into volumes, you can see that we've got a Firefox volume that's mounted and we also
have our installs, which is our share, and we've got our Macintosh hard drive.
So let's go ahead and take a look inside the Firefox disk image.
I have to put volumes first.
So and now let's take a look and what we have here is we've got the Firefox app and APAs is a directory
and then we've got an L, which basically means a symbolic link, which is similar to a shortcut.
So basically it points to our applications folder.
So when you mount a disk image on the desktop using the GUI and you drag Firefox app, you're basically
moving the Firefox app into your applications folder.
So what we want to do is do that programmatically.
OK, so what we want to do next is we want to copy the Firefox app to the applications folder.
So what we're going to do is seek for copy are for recursive and then volumes Firefox and then the Firefox
app folder.
But what we need to do is you see this forward after the word app.
If we did this, then we would be getting everything at that below the Firefox app level.
So in other words, the subdirectory that we want, the top directory of the Firefox app and remember,
Firefox is a directory, then we need to get rid of that forward slash.
And what we're going to do is we're going to copy that to the applications folder.
OK, so that seems to work, so we're copying the Firefox app to our applications folder, so let's
go ahead and put that.
And.
And so now it's done, what we want to do is detach or unmount the disk image, so HDI util and then
detach and then volumes and then Firefox.
Oh, I think it's because we're in it, yet we're in it.
So let's get out of it.
So now we're in our home folder and let's go ahead and do it one more time.
All right.
So now it's rejected the disk image, so let's go ahead.
We know that this works.
Let's put this in.
And now what we want to do is we want to delete the disk image from the computer, so we're going to
do a remove recursive folder and then we're going to do temp and Firefox.
And you know that that works.
So let's go ahead and copy that and paste that here.
And we want to make sure it is run as root, which it is.
Now, we've basically generated a template for installing DMG, so let's go ahead and save this template.
So we will say install DMG from installs.
Server, it will hit, OK, and then we're going to go ahead and save this.
OK, so now we've got a job for Firefox created and here we've got our our target computer and we can
see that Firefox is not on it.
So let's go ahead and.
Run this job on this machine.
And so it should download from that Web server and then after that amount of disk image and then copy
it and then delete everything.
So there's the mount.
And it's copying.
And it's unmounted, and we can see that the job is done.
And let's go ahead and see if we can launch the app.
And the app does launch.
And let's go ahead and quit the ALP now.
I can see that this icon looks a little weird, though.
It looks fine down there.
Let's go ahead and close this and let's see if that makes the icon refresh.
And it does.
So there's no issues here.
Everything works fine, and so that's how we that's how through scripting, we can install Firefox or
any disk image with a drag and drop container to virtually an unlimited amount of max.