Installers!

18 posts / 0 new
Last post
peteatjuce
Offline
Last seen: 3 months 1 week ago
Joined: 7 Mar 2007 - 08:42
Installers!

Hi Folks!

I thought I'd save all you fellow jucers some of my pain :) and fill-you in on the installation solutions we ended-up using for noatikl and liptikl (both of which are commercial apps built with Juce).

FWIW, I've had the pain in the past of having to write a generic windows-compatible scriptable installer in the past, and am so happy that those days are now behind me. :)

Windows: Inno Setup - free from http://www.jrsoftware.org/isinfo.php
A marvellous tool, really easy to auto-build "standard looking" setup .exe files using scripts. I use cygwin bash shell to grab latest files, build the setup .exe files and zip them up - dead easy. Spread the word!

Mac: PackageBuilder - free from Apple
Builds great looking "Mac Standard" installs, but can't see how to drive it automatically. I use one bash shell script to copy all the bits I need under a build folder, then I run the PackageBuilder manually using pre-prepared configuration file (can't figure-out how to run it from the command line!) (making sure I save the .pkg files into the right folder... that'll catch you out if you're not careful!) and then a second script to build the pkg file into a .dmg file, then zip it up.

Both these tools allow you to embed licenses that the user has to agree to in order to complete the install, which was important to us; in both cases, those text files can come from .rtf files so they're nicely formated!

Right - hoping that helps!

Pete

jules
Offline
Last seen: 8 hours 43 min ago
Joined: 29 Apr 2013 - 18:37

Good suggestions. I usually use NSIS, which is free, and does the job pretty well.

bld
Offline
Last seen: 1 month 4 days ago
Joined: 4 Dec 2007 - 14:10
Re: Installers!

peteatjuce wrote:
Mac: PackageBuilder - free from Apple
Builds great looking "Mac Standard" installs, but can't see how to drive it automatically. I use one bash shell script to copy all the bits I need under a build folder, then I run the PackageBuilder manually using pre-prepared configuration file (can't figure-out how to run it from the command line!)

Try
man packagemaker
or
/Developer/Tools/packagemaker -help
in terminal to see what you need. It runs smoothly from the command line with proper arguments.

Cheers,
Przemek

G-Mon
Offline
Last seen: 1 day 4 hours ago
Joined: 15 Mar 2006 - 20:41

I use InnoSetup, and I must agree, it's great.

Or, on the mac, don't even have an installer. Just put the app in a disk image.

When I was learning cocoa, I wrote a utility for creating disk images: http://rabien.com/software/KomodoDMG.dmg

peteatjuce
Offline
Last seen: 3 months 1 week ago
Joined: 7 Mar 2007 - 08:42

Hi Bld!

Quote:

It runs smoothly from the command line with proper arguments.

I guess I should have clarified that ... :) ... I tried using the command-line version, but simply couldn't figure out what the magic set of arguments was! There was also something in the manual page (not on my Mac right now so can't remember the exact wording...) about the command line version requiring us to have to have first created the file to drive the command-line builder in advance with package builder (which is no problem, as of course I've already done that!).

If you could possibly provide some example "working" shell code to show what arguments to provide, I'm sure that many of us Mac developers would really appreciate it!

All the best,

Pete

bld
Offline
Last seen: 1 month 4 days ago
Joined: 4 Dec 2007 - 14:10

No problem... Here is the line from my script which makes the installer package file:

/Developer/Tools/packagemaker -build -p $PACKAGE_FILE -f content -r resources -i tmp/Info.plist -d plist/Description.plist

In my case the variable $PACKAGE_FILE is set to pkg/productname-x.x.x.pkg. Of course constant value of the -p switch can be used instead of variable but I run this script in several runs with different values.

The -f switch defines package contents directory (content in my case). And it is the same directory I used earlier when I was working with the GUI version of Package Maker.

The resources directory passed to -r switch contains files to be included to generated installer package. There are three files in this directory: background.jpg, License.txt and Welcome.txt

Info.plist and Description.plist are included to the generated package file too. I have them in different source locations because Description.plist is the same across all versions of the installers while the tmp/Info.plist is generated dynamically based on Info.plist template (I just modify it a bit in few steps earlier in the script to change the bundle version in the template but it's not very important).

And that's all - after this line I get the destination package file (*.pkg) which is further processed with the hdiutil tool to make a disk image file (*.dmg) and uploaded to ftp server ;)

In any case I paste also the both .plist files. I'm almost sure that I got them from the package made earlier with the GUI version and modified them a little to actual needs.

The Info.plist file:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
	<key>CFBundleGetInfoString</key>
	<string>1.0.0, My Company Name</string>
	<key>CFBundleIdentifier</key>
	<string>com.company.productname</string>
	<key>CFBundleShortVersionString</key>
	<string>1.0.0</string>
	<key>IFMajorVersion</key>
	<integer>1</integer>
	<key>IFMinorVersion</key>
	<integer>0</integer>
	<key>IFPkgFlagAllowBackRev</key>
	<false/>
	<key>IFPkgFlagAuthorizationAction</key>
	<string>AdminAuthorization</string>
	<key>IFPkgFlagBackgroundAlignment</key>
	<string>topleft</string>
	<key>IFPkgFlagBackgroundScaling</key>
	<string>none</string>
	<key>IFPkgFlagDefaultLocation</key>
	<string>/Library</string>
	<key>IFPkgFlagFollowLinks</key>
	<true/>
	<key>IFPkgFlagInstallFat</key>
	<false/>
	<key>IFPkgFlagInstalledSize</key>
	<integer>18536</integer>
	<key>IFPkgFlagIsRequired</key>
	<false/>
	<key>IFPkgFlagOverwritePermissions</key>
	<false/>
	<key>IFPkgFlagRelocatable</key>
	<false/>
	<key>IFPkgFlagRestartAction</key>
	<string>NoRestart</string>
	<key>IFPkgFlagRootVolumeOnly</key>
	<true/>
	<key>IFPkgFlagUpdateInstalledLanguages</key>
	<false/>
	<key>IFPkgFormatVersion</key>
	<real>0.10000000149011612</real>
</dict>
</plist>

... and the Description.plist file:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
	<key>IFPkgDescriptionDescription</key>
	<string>My Great product ;)</string>
	<key>IFPkgDescriptionTitle</key>
	<string>Product Name</string>
</dict>
</plist>

Hope this helps :)

Cheers,
Przemek

peteatjuce
Offline
Last seen: 3 months 1 week ago
Joined: 7 Mar 2007 - 08:42

Hi Przemek,

Wow - that is so incredibly helpful, thank you very much for sharing this info!

I was particular puzzled by how to use the .plist file, so thanks again, I'll try using this later tonight!

Many thanks,

Pete

P.S. I'm always amazed how helpful Juce users are - this forum rocks. :)

peteatjuce
Offline
Last seen: 3 months 1 week ago
Joined: 7 Mar 2007 - 08:42

Here is the bash script I ended-up using. Note that I added a -proj argument to point to my command line; and I also ran with sudo to get around some file permission problems.

And for anybody reading this in a few months :), the .pmproj file is prepared by you, prior to repeated running of this script, by the PackageMaker GUI tool that is in /Developer/Applications/Utilities

Oh, and under myprod_install_root, I've created separate Applications, Library etc. folders containing copies of my App, Libraries etc. that I want installed, in a folder structure mirroring how they should get installed on the target Mac.

HTH!

Pete

sudo /Developer/Tools/packagemaker \
-build \
-v \
-p myprod/install/macosx/myprod_mac.pkg \
-proj imyprod/liptikl/install/macosx/myprod_mac.pmproj \
-f ./myprod_install_root \
-r ./myprod_install_root \
-i myprod/install/macosx/Info.plist \
-d myprod/install/macosx/Description.plist
peteatjuce
Offline
Last seen: 3 months 1 week ago
Joined: 7 Mar 2007 - 08:42

Hi Folks!

Thought I should add to this, that if you're using XCode 3.0, and have tried to build an installer package and encountered all sorts of annoying problems that prevent it from working; don't despair.

Instead, do what I did, and copy/use intead the PackageBuilder.app from from an XCode 2.x distribution; this works, and means you can totally avoid the buggy version in XCode 3.0 ... :)

The sort of problem this deals with includes this one:
- your application gets installed, but instead of appearing in ~/Applications, it appears in /Library/Applications ...!!!

Hoping this helps somebody out there! :shock:

Pete

jules
Offline
Last seen: 8 hours 43 min ago
Joined: 29 Apr 2013 - 18:37

Interesting - thanks, that might explain some stuff that I've seen recently...

peteatjuce
Offline
Last seen: 3 months 1 week ago
Joined: 7 Mar 2007 - 08:42

Sort of worrying, isn't it. :)

Doesn't say a lot for their quality control! :shock:

Pete

Pages