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:
Remove the old version
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.
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.
Related
I failed to understand the INSTALL.md file. I know few programming knowledge. I appreciate anyone can give me a thorough explanation or instruction.
The software I wanna install is https://sourceforge.net/projects/scidavis/
Information in INSTALL.md
Mac OS X - MacPorts instructions
These notes refer to use MacPorts. Using other build environments such
as HomeBrew is presumably equally as viable, but you may need to hack
the config files a bit.
Install MacPorts.
Install XCode and XCode command line
tools
If you want to be able to run your build on an earlier version of
MacOSX than your build machine, see How to build a Macintosh
executable that will run on older versions of
MacOSX.
Install the prerequisites for scidavis.
port install qt4-mac qwt52 qwtplot3d boost gsl py27-pyqt4 py-pyqwt py27-sip muparser
Sadly, you may need to do this step multiple times before eveything
is installed
link sip-2.7 share directory to where sip expects it to be:
ln -sf /opt/local/Library/Frameworks/Python.framework/Versions/2.7/share/sip /opt/local/share/py27-sip
Add qt's bin directory to your PATH
PATH=/opt/local/bin:/opt/local/libexec/qt4/bin:$PATH
Configure scidavis
qmake CONFIG+=osx_dist
Build scidavis
make qmake
make
Create the installable package
sh mkMacDist.sh
Thanks in advance
If you are trying to install a tar.gz files you must first run gunzip on the file. gunzip filename. This should give you a .tar file. To open the tar file run: tar -x filename.tar.
NOTE: if you're trying to install a unix executable, it's sometimes easier to use homebrew. Search the internet for the application you're trying to install and the term homebrew, and it might bring up a page on homebrew and give you a simple install command which you can run in the mac terminal.
Steps to install tar.gz on macOS
Double click it the tar.gz file open it
Its contents (e.g. directories/files it contained) should appear in the same directory the tar.gz file is in (to prevent clutter, consider placing the tar.gz file in a new, empty directory before double clicking on it)
One of the new files might be a unix executable that looks like this:
Open another finder window (command + n), navigate to this location /usr/local/bin, and place the executable file you found in the previous step in this new location (you can do this using the mac terminal if you prefer - here's a random example showing show)
At this point, open a new terminal tab, and type the name of the program (the file you moved in steps 4), terminal should recognise the program. However, if you see this there is one more step:
Go to System Preferences -> Security & Privacy -> General tab. Click the lock icon, type password if it asks for it, and then click on 'Allow'.
I use a 64-bit Windows 10 machine. I was trying to install Anaconda by following the steps mentioned on this DataCamp page. I was expecting a .exe file, instead, I got a .pkg file. I don't know how to open the .pkg file. I could see .exe files in Anaconda's archive. Not sure which one to download. Any help?
I had the same issue. You have to choose windows option cos it does not automatically detect you system. The default selected is for mac OS and thus it will download the pkg version. Its after downloading that I found out and had to redownload it.
Its really a poor web design, since the options don't really appear as options (they appear as saying anaconda is available in all these platforms) and are visibly in another section.
By default the anaconda website will set the option to MAC OS(.pkg is MAC extension) change and download by windows it works!
Anaconda often downloads the pkg version for Macs. If using windows you might want the .exe version. Make sure you click Windows on the main page to download that installer. You can also go here: https://repo.anaconda.com/archive/
Find the .exe version for windows - download it and install it.
I'm creating a Cocoa Application using SSHFS but I want to make a package installer when user install, it will install OSXFuse and SSHFS to their macbook. How can I do that?
Installing OSXFuse means simply copying several files go global locations, which requires admin privileges. Its not that simple actually, since there's a handful of stuff to copy, but its very doable.
What you need to do is hold a copy of the following files with your app, and copy it to the destination using the installer (you must have it before running your app itself or it may crash).
List of files/folders to copy:
/Library/Frameworks/OSXFUSE.framework
/Library/Filesystems/osxfusefs.fs
/usr/local/include/osxfuse
/usr/local/lib/libosxfuse_i32.2.dylib
/usr/local/lib/libosxfuse_i32.la
/usr/local/lib/libosxfuse_i64.2.dylib
/usr/local/lib/libosxfuse_i64.la
/usr/local/lib/pkgconfig/osxfuse.pc
Note that you will also have to create some symbolic links in /usr/local/lib/ and in /usr/local/lib/pkgconfig/. If you actually get to doing it and need help, let me know.
Using PackageMaker that is rather simple.
In order to get a copy of the mentioned files and folders, you could install OSXFuse and copy it yourself from the mentioned locations.
Reference:
https://github.com/osxfuse/osxfuse/wiki/FAQ#12-what-is-osxfuse-versiondmg
In the previous Mac release of our software, we foolishly put the major version number in the application bundle name: /Applications/CellProfiler2.0.app
Now we are about to release version 2.1. Is it possible to have pkgbuild make a .pkg package that installs the new version as /Applications/CellProfiler.app but removes the old /Applications/CellProfiler2.0.app?
It is; and in fact, You have, as we see it, two options here:
1) Use pre-install scripts in the pkg to either detect your old version and ask the user to remove it, or remove it yourself (or first just rename the directory to be without the 2.0)
2) Package your installer in a DMG, and run the installer as a separate file altogether, and do either of the above.
I downloaded file:
http://downloads.sourceforge.net/gladewin32/glade-3.4.3-win32-1.zip
and when I extract it an run glade-3.exe from /bin folder, I get "no libxml2.dll" error.
Now, I want to find installer (like GTK+ bundle for GTK+) that would install glade3 and all it's dependencies for Windows XP.
Well glade3 worked for me after I downloaded:
iconv.dll
libxml2.dll
and put it in path
This is not the answer, but it can help run it.
Another thing. I previously installed GTK+ bundle, so if you didn't do that, you may need more dll's etc...
Just for the record, the newer version available at http://downloads.sourceforge.net/gladewin32/ is an installer that already includes libxml.