Creating an installer for my first Cocoa Application

Joined
Mar 12, 2010
Messages
7
Reaction score
0
Points
1
Hey everyone!

I'm new to the Mac. I've had one since about Thanksgiving, and I got it to do iPhone programming. That's going well, and I've made the transition (somewhat) to Cocoa Desktop development.

Deploying your application on the iPhone isn't easy, but there's generally one way to do it (at least, one for testing and one for sale). With desktop apps, however, I can't find a good resource to tell me how to get started with distribution and installation.

I've given my .app file to a fellow developer friend, and he can run my application. Step 1: check.

I've also played a little bit with packing my .app file in a .dmg. Step 2: check. (NOT packageMaker, which confuses me)

I further found a program that would let me create an installer package, but it still isn't quite what I want.

What I'd like to do is have a .dmg file that opens up with my app's icon on the left and an arrow in the middle pointing to the applications folder on the right. Then, the user can drag my app there to install it (which will also place it in their applications directory).

I've seen this done with many of the programs I've downloaded to install. It seems like everyone knows how to do this except for me. If you want to see a perfect example of what I want to do, check out the Google Chrome installer.

I've googled for hours, but I seem to be going around in circles. I've looked at ChocTop, but I can't get all of the steps to work. Some of the command-line stuff is still fairly advanced for me yet.

Does anyone know how to do this? Better yet, is there a graphical tutorial that explains the process?

Thanks for helping out a mac noob!
 

vansmith

Senior Member
Joined
Oct 19, 2008
Messages
19,924
Reaction score
559
Points
113
Location
Queensland
Your Mac's Specs
Mini (2014, 2018, 2020), MBA (2020), iPad Pro (2018), iPhone 13 Pro Max, Watch (S6)
I tried this with a project of my own once and I may not have done this the right way but I created a folder, changed the folder background, added an alias to the Applications folder and created a disk image of that folder. In other words, create the folder exactly as you would want the user to see it. There may be an easier way to do it but I believe that's what I did last time.

EDIT: If you're wondering how to give the folder a background picture, make sure the folder is in icon view > right-click > Show View Options > "Background:" > Picture.
 
OP
M
Joined
Mar 12, 2010
Messages
7
Reaction score
0
Points
1
Thanks for the quick response...

But this just exposes more of my lack of knowledge.

I followed most of what you were saying, but I have no idea how to "alias the applications folder". Do you mind explaining that?

Thanks!
 

vansmith

Senior Member
Joined
Oct 19, 2008
Messages
19,924
Reaction score
559
Points
113
Location
Queensland
Your Mac's Specs
Mini (2014, 2018, 2020), MBA (2020), iPad Pro (2018), iPhone 13 Pro Max, Watch (S6)
OP
M
Joined
Mar 12, 2010
Messages
7
Reaction score
0
Points
1
More help?

Van,

Thanks for the help. I thought I figured out your instructions, and I got my folder looking exactly as I wanted, but when I created the disk image and then opened it, the folder wasn't laid out at all like I wanted. No background image, icons not set like I wanted, etc...

Did I miss a step?

Thanks!
 

vansmith

Senior Member
Joined
Oct 19, 2008
Messages
19,924
Reaction score
559
Points
113
Location
Queensland
Your Mac's Specs
Mini (2014, 2018, 2020), MBA (2020), iPad Pro (2018), iPhone 13 Pro Max, Watch (S6)
Try this - create the disk image, mount it and customize that.

EDIT: Tried it and it should work for you. Give it a test and let me know if that works for you.
 
OP
M
Joined
Mar 12, 2010
Messages
7
Reaction score
0
Points
1
Didn't work

I tried doing what you suggested, but when I opened the dmg I couldn't move the icons. I was able to set the background image, but the icons kept snapping back where they were (2 icons, top left). I didn't see an option that would let me change that behavior. Align/arrange was set to "None".

This ought to be easy!!!

<mutter>Stupid Apple, it doesn't just work!</mutter>
 

vansmith

Senior Member
Joined
Oct 19, 2008
Messages
19,924
Reaction score
559
Points
113
Location
Queensland
Your Mac's Specs
Mini (2014, 2018, 2020), MBA (2020), iPad Pro (2018), iPhone 13 Pro Max, Watch (S6)
Open up your image. Right click, go to Show View Options. For "Arrange by:", make sure it's set to None. It sounds like your icons are being forced into some arrangement.
 
OP
M
Joined
Mar 12, 2010
Messages
7
Reaction score
0
Points
1
I did that (I think). Now, with my icon size being set pretty large, the icons are actually stuck in an overlaid pattern.

Man, I'm sure I'm not stupid, and this is hard, but COME ON!!! (Yelling into the void, not at you.) Are there other settings that I'm missing? Is it because I've got Snow Leopard? Like I said, I'm really pretty new to OS X, so I may be missing something obvious.

Any other ideas? Start over?

Thanks for you help.
 

vansmith

Senior Member
Joined
Oct 19, 2008
Messages
19,924
Reaction score
559
Points
113
Location
Queensland
Your Mac's Specs
Mini (2014, 2018, 2020), MBA (2020), iPad Pro (2018), iPhone 13 Pro Max, Watch (S6)
Did you change the arrangement settings? If you prevent Finder from arranging icons in a particular way, it should work.

P.S.: I'm running SL as well. ;)
 
OP
M
Joined
Mar 12, 2010
Messages
7
Reaction score
0
Points
1
Man, I appreciate the help, but I can't make sense of your last comment. How would I go about preventing arrangement other than what I've already done? Is there another setting I need to know about?

Let me recap:

1. I created new folder.
2. I set the background image of the folder to a custom image I made.
3. I placed my app in the folder and positioned it where I wanted it.
4. I placed an alias to the Applications folder in the folder and positioned it where I wanted it.
5. I created a disk image (using disk utility) of the folder.
6. When I open the dmg, the folder is not laid out like I want.

At first (in #6) the folder came up with small icons arranged in the top left of the window. I then resized the icons to 128x128, which I wanted. Then, somehow (and I'm not sure how), I changed something and now they're stuck overlaying each other. Not what I want.

The original folder is PERFECTLY like I want it. What happens between the folder in Finder and the folder inside of the dmg? A lot of the settings seem to be different or locked down in the dmg. Did I screw up a setting when creating the image?

Thanks for all your help tonight. I'm going to bed. If you don't mind commenting one more time, that would be awesome!

Thanks!
 

vansmith

Senior Member
Joined
Oct 19, 2008
Messages
19,924
Reaction score
559
Points
113
Location
Queensland
Your Mac's Specs
Mini (2014, 2018, 2020), MBA (2020), iPad Pro (2018), iPhone 13 Pro Max, Watch (S6)
You need to create the disk image first and then customize the image. In other words, create the image, mount it and customize that. If you do this, you need to make sure to create an image with r/w privileges (read/write).

My initial instructions were bad - create the image first, not the folder. From the instructions you just gave me, you're still creating a folder and then making an image of that.
 
OP
M
Joined
Mar 12, 2010
Messages
7
Reaction score
0
Points
1
That seems to have done it.

I'm having only one more problem. When I drag the app into the app folder, it installs and will run just fine. Why, though, would the icon for my program not display only when in the app folder? It displays fine in the Finder window. All looks good everywhere else, but not when I click on my Applications folder in my dock. If, however, I open the Applications folder in Finder, the icon shows up just fine. Ideas?

Thank you soo much for all of your help. What a great, great help you've been. Great help!!!

Thanks!
 

Shop Amazon


Shop for your Apple, Mac, iPhone and other computer products on Amazon.
We are a participant in the Amazon Services LLC Associates Program, an affiliate program designed to provide a means for us to earn fees by linking to Amazon and affiliated sites.
Top