Mac OS and PackageMaker: Allowing user to choose language during installation - cocoa

I am implementing a Mac application. Its Windows version is already implemented. Now I am facing the following issue:
implementation of the new package with multiple languages. I.e., for the Windows version of the software, when executing the installation file, the user can choose the language in which the application should be installed. I want this feature to be included in the Mac version.
Currently in the Mac version multiple language support is implemented using NSLocalizedString so that the app chooses a language according to the system language preference and the installation package is localized.
However, I specifically want the users to be able to choose the installation language of the app when installing. I am using PackageMaker now. Please help to solve this issue. I have been trying to implement this feature for several months, but no luck.

The official recommendation from Apple is that you shouldn't do that; just include all of the localization to the app just as you already do.
So, if it is not the requirement imposed on you by your employer, just don't do that and implement more useful things on your app.
The English user, who chose to install just English version, might suddenly marry a Japanese, who might want to use it in Japanese!

Related

Proper way to distribute Bonjour enabled Windows application

I am quite confused as to the proper way of distributing Bonjour as a part of a Windows application that would publish a service for a client iOS app.
No matter how much I google around, I cannot find a clear how-to guide. It would be great if someone could provide guidelines.
The main reasons of my confusion are:
Is it mandatory to distribute the entire bonjour Win SDK as a part of my Win application?
Since Apple provides source code to build mDNSResponder.exe, is it sufficient to only distribute such file along with dns-sd.dll?
What is the intended purpose of providing sources for mDNSResponder.exe otherwise?
What is the recommended way to handle the possibility of having Bonjour already installed on the system?
Also, where can I find the latest Bonjour SDK (3.x I guess?), I can only find 2.0.4. Is it only accessible if I am enrolled in the OSX developer program? (I am enrolled in iOS developer program for now.)
Many thanks.
This is information I gathered from various sources, including communications with official Apple support. I report it in the way I believe to be accurate, I hope it can be useful (no liability assumed!).
For Bonjour-enabled Windows application you have basically two main options:
Bundle the Bonjour Installer with your application (which is not the Bonjour SDK, the SDK if for your own developer use only).
If you choose to do so, the Bonjour installer must be called from your own installer during the installation process. The possibility of Bonjour being already installed in the system is totally handled by the Bonjour installer.
And here come some bad news: you must include de Bonjour Logo on your physical distribution medium (like a DVD cover sleeve) according to the Apple guidelines specified in the Windows Bundling Agreement, and you need Apple approval before distributing your product.
Do not bundle. I.e., do not distribute Bonjour with your application but simply use it if already present in the system. If you do not distribute Bonjour in any form the whole Windows Bundling Agreement simply does not apply. You application should search for the dnssd.dll and load it dynamically if found.
Consider that most of Windows users would have Bonjour already installed due to the fact that some popular apps use it (for example iTunes and Skype).
While the source code of Bonjour is released under an open-source library (Apache License, Version 2.0) this does not require Apple to do anything. In particular, they do not need to document how you'd use this license.
The license allows you to use and adapt Apple's source code, including its copyright, but not including its trademark "Bonjour(TM)". Since this is the standard Apache license, you don't have the requirement either to show the trademark.
So, to answer your questions:
No, you can build your own version of Bonjour from source and use that under the Apache license. You can't call it Bonjour, but why do you need a name in the first place? "mDNS" would be a reasonable choice, possibly prefixed with your trademark.
It seems sufficient to distribute the DLL and EXE. Arranging how they find each other might benefit from some tailoring, so your own build of Bonjour doesn't clash with Apple's.
(I won't speculate on Apple's motives)
The design problem here is that Bonjour acts as a system service, and services are inherently singletons. If you install it unmodified, Apple wouldn't be able to install its own build. That's not a legal problem, probably, but it is a bad customer experience. Installing your own build as a distinct service would avoid the clash, allowing both versions to co-exist.
(Resource request, off-topic)

Don't want to ask users to download JRE

My question is similar to the one asked in this forum in 2010 - "is JRE installed in Windows & Linux?". And I am wondering if things have changed since then
In particular, my site hosts a downloadable Java application that basically transmits specific files from the user's PC to our server. But every now and then I find that some of my users - all non-techies - don't have JRE installed. And hence, I have to ask them to install JRE first.
Asking users to download something before they can start using my application can only ruin the end user experience. Understandably, that is a no-no. And so, I am ready to re-implement the application. But before I can propose re-implementing the app in some other technology - like Qt - I need facts to make a case. In particular, I would like to know
Is it safe to assume that any PC with an OS that is XP or above would have JRE installed on it?
Is Qt a viable - and preferable - option for making a "download-now-use-now" type of application? Don't Qt applications need a JRE equivalent too?
Are Qt applications able to update themselves like Java apps can?
Other than having to maintain/compile multiple versions of Qt, are there any other disadvantages to using Qt?
Thanks for your responses
Abhinav
No, it is still not safe to assume that every machine had the JRE installed, though it is easy to install for every machine.from the Java website. Java is not installed by default on any Windows computer but I believe it is installed by default in many Linux distributions.
Qt is a GUI front end system for other programming languages. I know of Qt implementations for C, Python and now Java. If you are intending to use Java Qt then you will need to use the JRE to run it, it is not a way to get around restrictions of Java but is instead a way to make applications look consistent even though they are written in different languages.
A Java Qt application will have the same abilities as a normal Java application in terms of updating.

Bundling a private JRE on Mac OS X

Starting with the next version of Mac OS X, Java will no longer be included in the system and I don't want to force my customers to install it themselves. So I would like to do what I do on Windows - bundle it with my app. It also gives me some hope that it could get included in the Mac App Store.
Where can I download a Mac OS X JRE that I could include with my application? Or can I just copy the one that's installed on my Mac?
Update (4/15/2013):
As Thorbjørn helpfully pointed out, Oracle now has a solution for this. See http://docs.oracle.com/javase/7/docs/technotes/guides/jweb/packagingAppsForMac.html. However, I'm keeping the original content for "historical purposes", and because it was a fun research project.
Previous version (with edits):
This is a great question. I was going to respond that you are simply ahead of your time -- as you pointed out, Java is not going to be removed until the Lion release. However, this article makes it clear that using Java today is not allowed:
Apps that use deprecated or optionally installed technologies (e.g., Java, [PowerPC code requiring] Rosetta) will be rejected.
At the same time, no one has announced a redistributable JRE for Mac OS X yet. I think your best bet, bearing in mind that you are forging new ground, is to check out the Mac OS X Port wiki page of the OpenJDK project. It does describe how to compile your own JDK, but it does not clearly state whether or not the resulting JDK can be "bundled" cleanly or not. I think you will have to try it and see :-(.
Also, it's not clear if the OpenJDK licensing allows this at all (IANAL). Hopefully someone else has already figured this out with regard to Linux/Windows, although of course the rules may be different for the Apple contributions.
Hope this helps. If nothing else, it's a starting point.
EDIT: I am going to throw out one additional suggestion. We now know that Mono apps can be packaged for the App Store. Furthermore, IKVM.NET is a complete implementation of Java that runs on top of Mono. You could try, in theory, to put these two pieces together and get a Java app, bundled for the App Store, that does not in fact require a JRE!
If you try this, I would love to hear how it works out :-).
EDIT 2: Unfortunately, the App Store and the GPL do not appear to be compatible (see http://www.zdnet.com/blog/open-source/no-gpl-apps-for-apples-app-store/8046). The OpenJDK license isn't exactly the same as the GPL, but it's pretty close (again, IANAL). Therefore, Mono & IKVM.NET may be your best bet. Good luck!
In the same web search that I found this question, I've found the these instructions from the OpenJDK project. Not having tried them myself, I cannot comment on how well they work.
Meanwhile, another, very detailled article was published by Marco Dinacci which also goes into signing and sandboxing.
Apple has joined the Sun/Oracle OpenJDK open source project last month, so Java on Apple is alive and kicking.
Just tell the user to download and install the OpenJDK JRE for Mac OSX (when it becomes available, right now it´s just source code).
And no. you cannot include "the folder that is in your mac" without permission as it is copyrighted code from Apple.
Finally, packaging a "private JRE" is a very bad practice, it will make your app bloated, andif the user ends up running several Java apps, he will end up running multiple Java VMs simultaneously which is a terrible waste of system resources.

Does Mac App Store accept application written in Python/Java/Ruby?

Does Mac App Store accept application written in Python/Java/Ruby?
The Good News
Yes, you can submit a Java app to the Mac App Store. Not true in the past, but it is true at least as of now in 2013.
One example is the successful MoneyDance personal finance app currently available for sale in the Mac App Store.
The Bad News
Preparing and submitting your app is neither simple nor easy. You have to jump through some hoops.
Your app cannot depend on Java being installed on the Mac. You must include a JRE (Java Runtime Environment) within your Mac app.
You must write a thin Objective-C wrapper around your Java app. The source code and examples/tutorials are available on the web.
Like any other app, you must go through all hassle of the complicated build and deployment rigmarole with security restrictions Apple requires of any Mac App Store app.
More Info
Two articles, Take your Java application to the Mac App Store and Forking the OpenJDK for fun and profit, by Marco Dinacci. These articles may provide other useful information, but fortunately their discussion of forking the JDK is now outmoded. He and others have provided the needed patches now incorporated in the official releases.
How to Create a Mac OS X Installer for a Java Application (Updated for Mac OS X 10.8 — Mountain Lion) by Dem Pilafian of Center Key Software.
Packaging a Java App for Distribution on a Mac (Oracle)
Submitting to the Mac App Store (Apple)
By the way, you can use both Swing and JavaFX in your app. JavaFX is now bundled with Java, at least as of Java 7 Update 40 according to these Release Notes.
Java 9
The newly released Java 9 should make this process of wrapping an app with a runtime even easier and better.
Modules
Java 9 brings “modularization”, Java Platform Module System (JPMS), where the approximately 5,000 classes bundled with a JVM are grouped into about a hundred chunks known as modules. You can include only the modules containing classes actually used by your particular app rather hauling along every library. If you don't use JSON or CORBA, then you need not include the JSON or CORBA related modules.
The new jlink tool does this work for you, to assemble and optimize a set of modules and their dependencies into a custom run-time image. As a bonus, some link-time optimization work is performed to make your app launch faster.
These features are supported on 64-bit macOS systems, along with other platforms.
Native compiling
Java 9 also brings new support for native compiling, to build an app optimized for specific hardware. But this ability is experimental, and not yet ready for production use.
Update, as of 2018
Oracle has announced the end of web deployment technology, including Java Web Start, the previously recommended avenue for desktop apps. So now, Oracle expects all Java apps to be delivered bundled with a JVM such as is done with the jlink tool mentioned above.
So, the process of wrapping an app with a Java runtime that was something of a rarity just for the Apple App Store is now mainstream. Oracle expects any Java-based desktop app to be installed this way.
Yes and no. Apple doesn't care what language your App is written in, but it cannot depend on or install anything outside of the binary you submit to Apple. The relevant guidelines are below:
2.14
Apps must be packaged and submitted using Apple's packaging technologies included in Xcode - no third party installers allowed
2.15
Apps must be self-contained, single application installation bundles, and cannot install code or resources in shared locations
2.16
Apps that download or install additional code or resources to add functionality or change their primary purpose will be rejected
So, while this means you can't depend on Ruby or Python, you could use a framework like MacRuby to build your app in Ruby and embed the Ruby interpreter. Speaking for MacRuby, apps have been successfully submitted to the Mac App Store this way.
Ruby ? Yes !
Apple already accepted one of my apps written in MacRuby.
AFAIK, Cocoa will allow you include code written in different languages (including Ruby and Python, but not Java I don't think).
Check the Apple SDK's for more info, but I believe (thanks to Cocoa) it's not a problem.
For Python apps, I wrote a comprehensive article explaining how to build and submit such apps to the Mac App Store. It includes source code and build scripts for a barebones example app that I have successfully submitted.
Submitting a Python App to the Mac App Store
Possibly Java, if you bundle the Java application into a mac application.

What are some other comparable products to RealBasic?

I'm looking to get something that can create apps for Mac and Windows. It also seems that RealBasic can also create applications that have some sort of SQLLite DB built in. This is nice for standalone apps that need to save state/data.
I have Flash, which can create executables for Mac and Windows, but it doesn't have the easy database packaging or integration.
What are some other comparable products like RealBasic?
You can check out LiveCode
I do not have any experience using it but it also claims to support cross platform application development across Mac / Windows / Linux etc
Also, i think this product is what used to be called "Revolution" so it has been around atleast for a few years now - Revolution has been around since before 2001 to the best of my knowledge
The main problem with using Java is that the UI won't have the native look and feel of the platform it's running on. Sometimes that won't matter. But I've found that for most endusers the UI is a big deal.
Contrary to the above answer, RealBasic has never used an "interpreted runtime". It's compiled to machine code and linked to the runtime. These days it's compiled into LLVM instructions first before being compiled into machine code. So it's definitely faster than Java. It's main weakness seems to be the stigma attached to any language based on Basic.
I was using RealBasic for many years, due to its cross-platform capabilities. RealBasic was very long the only product that really managed both worlds.
With OS X 10.4 JAVA became a real alternative for RealBasic. On Windows JAVA was running well for several years, and with 10.4 it was also running well on OS X now.
The only thing with JAVA is: You need to have a JRE on the target system (OS X always has, Windows usually has but not always) - that is the only bad thing about JAVA. RealBasic is also "only an Interpreted runtime" - but it brings it's runtime in the binary, what on the other hand makes RealBasic .exe really huge if you compare them to a VB-project.
With 10.4 I decided to change to JAVA for Crossplatform-Development and from my point of view today, it was the best decission I could make.
You can try with Adobe Flex (now Apache Flex)
Flex for Web Apps (RIA apps) using web services (php, coldfusion, java, asp.net, etc)
AIR for Desktop (Windows, Mac)
AIR for mobile (Android, iOS, BlackBerry)
if you use AIR, then you need install AIR runtime
sorry for my bad english

Resources