Mac OS X - best place for the demo files of application? - macos

I am new to developing for the Mac OS X.
What's best place for storing the demo files of application on Mac OS X?
What's best practices?

I suggest the "/Library/Application Support" directory, which the documentation defines as: -
The Application Support directory is where your app stores any type of file that supports the app but is not required for the app to run, such as document templates or configuration files. The files should be app-specific but should never store user data.

Related

Creating a Mac OS application installer from .Net Core project

I am completely new to Mac OS and I have an application written in .Net Core codebase. Now all I want is to get it installed on Mac OS machines. My question is how can I create an installer (.DMG) file? At the moment My Visual Studio on Windows has created a .dll file with all other dependencies in the folder. Also for now most of the configuration values I have hard-coded but in the release build it has to be chosen by an end-user. So how can I prompt them for required directories? If you can provide me a link for documentation tool or any kind of suggestion would be greatly appreciated. At the moment if I want to run my application on Mac I have to use Terminal and then dotnet myApplication.dll in order to run application. My end goal would be to ask user for all required file paths and at the end create a System level Daemon (similar to windows service) to keep it always Alive. Would Xcode help in this situation? I already tried to open my .Net core project using xcode but it failed to load saying unsupported proect type.
Thanking in advance for your help!
If you wanted to use the standard macOS Installer to distribute your .net Core app, you would need to create a .pkg file. There seem to be ways to do this on the console or with Third Party Tools
sudo pkgbuild -install-location /Applications -component /path/to/your/application ./Desktop/YourPackage.pkg
There is an older manpage for pkgbuild, or you can try running man pkgbuild on your Mac.
I haven't tried this, but creating a .pkg is the normal way to install stuff on a Mac for applications where you can't just drag/drop the .app into the Application folder. (macOS applications are actually Directories with a special structure)
A .DMG is just a disk image - it doesn't "do" anything, it's just a container for files. You can create one with Disk Utility.

Create an OS X today widget without a host app

Is it possible to create an OS X Yosemite Today Widget without a host app, like the builtin Weather, Stocks and World Clock apps?
You can not do that simply because your executable is still running in the companion app rather in the extension. It means that codes are actually belonged to the companion app. So, you must have your companion app.
Info from the official documentation:
An app extension is different from an app. Although you must use an
app to contain and deliver your extensions, each extension is a
separate binary that runs independent of the app used to deliver it.

What is CodeResources in Cocoa Mac apps?

I see these CodeResources folders in some of the system Mac apps and some third party apps. What are they?
The file is a result of code signing; it keeps track of the digital signatures of various application resources (images, etc.).

How to read/convert classic MAC app file on MAC OSX

I am new to MAC environment.
Is there any way that I can convert classic MAC app file so that it can be read on MAC OS X?
Also, is there any good tutorial for how to write .app file for a JAVA application.
Thanks
Support for classic mode ( runs older mac software was dropped with 10.5). If you search for classic mode you can find some emulators/virtual machines which may run classic apps. I have not tried any of these.
.app is not a file format. It is actually a directory with a defined structure. If you show contents on an app from finder, you can browse this contents of the directory.
As for putting an jar file in an .app bundle, check the help for Jar Bundler. It is included with XCode and can be found under Developer/Applications/Utilites. This utility turns a jar app into a .app bundle.

How can I receive notifications of filesystem changes in OS X?

In Windows, I can use the FindNextChangeNotification API to watch a file or folder for changes. For example, I can watch a folder and get notified when a file is added or removed.
Is there a similar API on OS X?
Mac OS X v10.5 introduces the File System Events API. Have a look at:
Technology Overview
Using the File System Events API
File System Events Programming Guide (PDF)
FSEvents is nice, but for watching just a small set of files or folders it's rather overkill, and it does require Leopard or newer. (The underlying technology was introduced in Tiger, but the API wasn't public.)
As a possible alternative, note that OS X inherits kqueue from FreeBSD (at least as of Panther). You can search for examples of EVFILT_VNODE usage, that's what you want to use to watch for file alterations.

Resources