1

I'm attempting to create a package installer for our product. Previously we installed with a .dmg, and the process was to just drag it to the /Applications folder. Now we want it to install to /Application/Company/Suite/product.

Problem is: If we use the .pkg installer on a system that previously had our product installed it creates the folders, but installs the product over the old location.

How can I make the pkg installer do the following:

  1. Remove the old version
  2. Install new version to proper location

I've had very little experience with OSX - so maybe I'm just missing something? Also looking in the applications folder - it doesn't appear that anything else is installed to a subdirectory, is it unusual to do things this way? Thank you!

EDIT: I'm looking into the answers located here OSX .pkg installer sometimes does not install .app file, differently worded problem - but the answer might be just what I need.

EDIT2: OSX .pkg installer sometimes does not install .app file Does not apply. We didn't install with any package manager - so there isn't a previous entry.

EDIT3: We were using dmg, but are now moving to pkg.

Community
  • 1
  • 1
lockout87
  • 11
  • 1
  • 4
  • It is unusual. Unless you have extenuating circumstances, please just distribute an app, and possibly a drag to applications .dmg thingie. – Max Oct 22 '14 at 18:12
  • The decision is pretty high above me, but if OSX really doesn't do things this way - I'll pass that info up. – lockout87 Oct 23 '14 at 18:10

1 Answers1

0

So I found the answer.

In order to have it install to a new location: The plist inside the app package (product.app/Contents/Info.plist) has an identifier "CFBundleIdentifier", these needs to be different from the old application. For instance ours was "Company.Product-Name", I've changed it to "Company.Product.Name". This will allow the new installation to go to the new location.

In order to remove the old installation: I simply added this line to the preinstall script: "sudo rm -Rf '/Application/Product Name.app'"

Thank you for your assistance.

lockout87
  • 11
  • 1
  • 4