views:

275

answers:

7

I would like to know if there is any way that I could build a very simple GUI app (it doesn't even have to look good) that will run on a fresh install of Windows Vista and OS X with no other installations needed by the user. I would perfer not to use Java (just out of personal programming preference). I will use it though, if it is the only way. Specically, I am wondering if I can write a swing app with Scala or Groovy and run in on windows without them having to install anything. Sorry if this is a silly question, I am a Obj-C developer by trade.

A: 

In theory you could write a .net application using Mono that it should run without issues on any other one with the .net runtime environment installed.

But I'm not sure if it will work on practice.

Kico Lobo
Does the .net runtime ship with OS X? I have it on my machine but I think I installed it a while back.
Joe Cannatti
No, the .NET runtime is part of Mono but freely redistribute-able.
drewk
+1  A: 

As far as i know you won't be able to accomplish that with no other installations needed by the user. If you violate this restriction, mono (with gtk#) is a good choice.

n535
+4  A: 

You can pack the Scala jars into your own, which should work as long as Java is installed (which it usually is on a 3rd party vendor install of Vista or OS X). If you use Java web start, no installations are needed beyond Java itself. Plus, if you're going to install your own code, why not just copy along the Scala jars also?

If you really mean a fresh install--nothing but what the OS provides--then no, I don't think so.

Edit: You do always have javascript on the browser(s). I assume this won't cut it for what you want?

Rex Kerr
Great! There is no reason I can't ship the Scala jars. I just don't know much about deploying an app on the JRE. I get it now. Thanks!
Joe Cannatti
@Joe Deploying on the JRE is easy. Making sure the JRE is there is not so easy. Most Windows machines end up with Java on them, from what I've seen (because the computer manufacturer loads Java along with Windows), but it's entirely possible to not have it.
Rex Kerr
@Joe @Rex launch4j (http://launch4j.sourceforge.net/) seems to support shipping a Java application as a Windows executable with a JRE embedded. OS X comes with a JRE installed, so you might not have an issue there.
binil
I don't really see how that fits the requirement if Java has to be installed (no other installations needed by the user). Seems like a big dependency to me.. launch4j is only for windows (which defeats the Windows Vista and OS X requirement)
Ben
... and that's not even mentioning the other requirement (I would perfer not to use Java..). How did this get voted up?
Ben
+1  A: 

Scala and Groovy will have the same deployment issues as Java; all of these require a JVM to be installed. You generally have to first install the JVM (which is not included with Windows) and then install your program. Java is included in OS X, however.

It is possible to use Ruby or Python and one of the cross platform libraries (like wxWidgets) and compile these to an executable file that includes the entire set of runtime libraries (e.g. all of ruby and python).

Ken Liu
+3  A: 

If you really, really don't want to install anything (or carry anything in your app), then write the application as a web app (possibly a javascript app). Then any user can run that UI from any machine with a decent browser. But then, this will require that you host the app somewhere.

If that is not an option, you can develop your app to as a single html/xhtml file containing a self-contained, self-modifiable javascript application (like TiddlyWiki which I use a lot). Then the user user can download on it on his machine, point his browser to it and voila.

If you combine javascript with HTML5 (and assuming the user has a HTML5 compliant browser like safari), your application can use localStorage to keep its state in the user's machine (thus no longer needing to be self-modifiable to save state as TiddlyWiki does.)

But this would break your rule of not downloading anything on the user's host machine. It is a chicken-and-egg problem that has no solution since each OS implements its own set of application libraries. For multi-platform support, you must use a layer that abstracts out differences between operating systems, be it a vm (like JVM, Ruby or Mono) or a set of libraries (Qt, Gnome).

luis.espinal
A: 

REAL Studio (formally REALbasic) certainly meets this requirement. It creates native applications that have no external dependencies for OS X and Windows (plus Linux).

Paul Lefebvre
A: 

I've had some success with XulRunner

There's also a couple of recommendations from these questions I asked

http://stackoverflow.com/questions/2353305/building-cross-platform-app-recommendation

http://stackoverflow.com/questions/2384274/building-xul-app-a-la-songbird

XULRunner is pretty cool once you get into it, but it's a tad confusing at first (I thought).. the folks on the mozilla google groups are really nice and helpful though!

Ben