How to include OSXFUSE and SSHFS into my Cocoa app Distribution? - cocoa

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

Related

MacOS: where to install global application data with r/w access

To where a pkg installer package on MacOS should install global application data ? All users of this specific system as well as the app itself should have read and write access to this data. Atm I install it to /Library/Application Support/"mycompany"/"MyApp" and modify the permissions. Is this a good practise for all MacOS versions ?
Thank you !
EDIT:
Meanwhile I have tested to r/w access files in this directory on Sierra and Mojave. It works like a charm when I set the permissions in my custom library folder recursively with chmod -R 777 (well, less would be enough).
BTW I do this with a batch post installation shell script in the packages app here. It's a great UI based app (instead of using a bunch of command line tools). Building the pkg can be automated by a single command line: /usr/local/bin/packagesbuild /path/to/the/project.pkgproj, so integration into a flawless workflow is easy.
Yes. The only change I'm aware of related to this was in 10.7 when Apple changed the /Library folder to a hidden directory. (unlisted in finder unless specified) The path remains unchanged.
https://developer.apple.com/library/archive/documentation/FileManagement/Conceptual/FileSystemProgrammingGuide/MacOSXDirectories/MacOSXDirectories.html

Copy python modules from one system to another

Is it possibe to copy all of the python modules from one Windows computer to another computer? They are both running the same version of Python 2.7.12.
The reason for doing so is that I have internet access on one of them, and manual installing modules on the other requires to much time because of dependencies.
I suppose you mean "copy the python installation from one system to another" (else the answer is: put your modules on a USB key and copy them to the other system).
the best way
The best way of course would be to install Python properly on the other system using setup. But as you said, all dependencies/external libraries that you could easily get using pip for instance would have to be re-done. Nothing impossible with a small batch script, even if you don't have internet, but you would have to get hold of all the .whl files.
the full treatment, portable-style
But if you cannot you can create a "portable" version of python like this:
zip the contents of C:\python27 to an USB key
copy all python DLLS: copy C:\windows\system32\py*DLL K: (if K is your usb drive)
unzip the contents of the archive somewhere on the second machine
add the DLLs directly in the python27 directory.
(those DLLs were installed in the windows system in previous Python versions, now it's even simpler since they are natively installed in the python directory)
The advantage of this method is that it can be automated to be performed on several machines.
There are some disadvantages too:
python is not seen as "installed" in the registry, so no "uninstall" is proposed. It's a portable install
associations with .py and .pyw are not done. But you can do it manually by altering some registry keys.
another method, better
You can have best of both worlds like this:
perform a basic install of python on the second machine
overwrite the install with the zip file
=> you get the registered install + the associations + the PATH... I would recommend that last method.
Last partial method, maybe best matching your question
Try copying the Lib directory only. It's where the libraries are installed. I'm not 100% sure but it worked for me when I wanted to put wx on a python install lacking wx.
Of course you will copy over already existing files, but they are the same so no problem. I let other people comment if this is acceptable or not. I'm not sure of all the installation mechanism, maybe that will fail in some particular case.
In my case, copy-pasting python installation didn't do the job.
You need to check the "C:\Users\\AppData\Roaming\Python*" folder. You may find installed python modules there. Copy and paste these into your source folder will add these modules to your python.

MAC OS X bundle with files supposed to reside in /Library Directory

I am new to MAC OS X. I have created a bundle for my app, but two files need to remain in the following two dirs:
/Library/Google/Chrome/NativeMessagingHosts/
/Library/Internet Plugin's/
Both the directories need root access to copy files into them. The first directory may not even exist and needs to be created.
In windows or Linux - setups or deb/rpm packages, it's pretty simple, but I couldn't figure out a way in MAC as every thing is contained in the bundle itself.
This amazing free app "Package" solved my problem
http://s.sudre.free.fr/Software/Packages/about.html

How to Force install location from OSX .pkg

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.

What is the correct directory layout for a web server under Mac OS X?

I'm packing the Cherokee Web Server, a very very fast webserver with a nice web-based GUI for configuration written by the spanish hacker Alvaro Lopez Herrera and available from http://www.cherokee-project.com.
So far, I've managed to create a .pkg installer using Apple's PackageMaker.app that comes with Xcode but i'm installing everything under /opt/cherokee.
I guess I'd like to have the binaries go to a dir that is already in the path and the same for the manpages and other stuff.
I looks like installing everything with prefix=/usr could work nicely, except for the config files that should go to /etc/cherokee and the document root with could go to /var/www but i'm not sure.
Would that work or should I use some directory structure under /Library? like /Library/Cherokee/VERSION/ ???
Apple's bundled Apache seems to be instaling with prefix=/usr but config files in /etc/apache2 and CGIs and the manual to /Library/WebServer with the document root in /Library/WebServer/Documents.
Maybe my docroot should be /Library/Cherokee/Documents or something like that...
For reference, Cherokee's default layout is like this: (only dirs)
http://pastebin.com/f57bc2d21
Thanks for the help in advance! :)
Do not install it directly in /usr. That's Apple's domain. Though /opt might be okay, it will not be in the default path and is not commonly used as a default installation location for third-party Unix software in Mac OS X.
My advice is to install everything under /usr/local. Apple will not touch this area (e.g., during system updates, etc.), /usr/local/bin should be in the default path for users, and I have observed many other Mac OS X server software packages using this location.
Most Mac OS X packages I've used (and most software I've built from source on Mac OS X) will create a /usr/local/whatever/... containing directory, however. So, for example, all of MySQL would be under /usr/local/mysql/... That means the MySQL binaries are in /usr/local/mysql/bin/... which is not in the default path for users. But I think the improved isolation of that extra level of directory structure is worth this sacrifice. (Another option is to install everything under /usr/local/whatever/... but then add symlinks to your most important executable(s) under /usr/local/bin)

Resources