Installers!


#1

Hi Folks!

I thought I’d save all you fellow jucers some of my pain :slight_smile: 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. :slight_smile:

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


#2

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


#3

[quote=“peteatjuce”]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!) [/quote]

Try

or

in terminal to see what you need. It runs smoothly from the command line with proper arguments.

Cheers,
Przemek


#4

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


#5

Hi Bld!

I guess I should have clarified that … :slight_smile: … 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


#6

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

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 :wink:

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 :slight_smile:

Cheers,
Przemek


#7

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. :slight_smile:


#8

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

#9

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 … :slight_smile:

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


#10

Interesting - thanks, that might explain some stuff that I’ve seen recently…


#11

Sort of worrying, isn’t it. :slight_smile:

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

Pete


#12

As I’ve had to look at getting this all working for XCode 4 (where the old copy of PackageMaker doesn’t work any more having upgraded to XCode 4!), I’d like to suggest those who are interested look here:

http://s.sudre.free.fr/Stuff/PackageMaker_Howto.html

A very useful page!

The key thing I think is to note the permissions settings that are mandated.

Best wishes,

Pete


#13

Actually, to solve all your Mac install builder needs - simply use this amazing, free tool from the above site.

http://s.sudre.free.fr/Software/Packages/about.html

I’ve changed our own installers to use this, and all my Mac installer issues have disappeared with an hours work. :slight_smile:

Best wishes,

Pete


#14

Another usefull link for all things related to Package Maker and Installer is this one.
I recently switched from Package Maker to Packages and it works far better than Package Maker.
However, there is one feature that I can not find. It is to allow the user to choose where to install one particular package inside a meta package, for instance if you have a huge sample library and want to give the possibility to install it in another disk.


#15

Sorry, I haven’t done anything as advanced as that…! :frowning:

You could try mailing the developer of Packages? Let us know what you find out!


#16

I tried on Installer-Dev mailing-list but didn’t get any answer.
It is a good idea to contact directly the developer. :wink:


#17

The developer answered me that it is not supported by Packages. So I have to keep using PackageMaker :frowning:


#18

Have any of you ever gotten so fed up with the lameness of PackageMaker and Inno to where you wrote your own installer with Juce? Considering doing so for my next major release. Mind you, PackageMaker and Inno work fine for my end users, but the process of setting up the installers every time, and the scripting involved, creates a lot of added work and wasted time for no good reason, simply trying to outsmart these stupid installers. PackageMaker can’t even overwrite files without the help of a shell script! :evil: