# WinApp() equivalent in MacOSX/0



## stolmax (Aug 2, 2003)

I created a simple C++ windows applications that does not have a GUI, but also not a console application. It is a simple application that loads jvm.dll, creates a new JVM environment and uses JNI (Java Native Interface) to execute my Java Application. What I am trying to do right now, is to port it to MacOSX/9. Can some one please show me how and using what tools I can develop the same application on Mac OSX? When I execute this application I don't want neither GUI nor console from appearing, I want all the processing to be done on the background. Thanks in advance.


----------



## Lycander (Aug 3, 2003)

It's just plain ol' main(). Use the C/C++ runtime library as far as you can but if you need something more, look into using Carbon library.

What you want to do is basically make a console-like app but that doesn't mean it has to be executed from the console.


----------



## stolmax (Aug 3, 2003)

Thanks, but will my MacOS open a terminal window at the time I run my console application? I know that windows will open a terminal window if I run a console application not from the terminal window? Will this happen on Mac also? Also, is there a way, a standard way, to locatel installation directory for other programs on the Mac OSX/9. Such as application X was installed on a user's Mac sometime ago. I come with my application and I want to determin if that applicaiton X was already installed on the user's computer? Can this be done. In windows, I can look up the registry for that information, how can this be done on MacOSX/9? Thanks


----------



## brianleahy (Aug 4, 2003)

IF you have the Developer Tools installed, you can look at the Package Maker app.

It takes a little getting used to, but you can create a package that will install files to any directory you specify (although not to a user's home directory, oddly enough) or to a directory the user selects at install time.

Packages you create will launch in the Apple "Installer" program, and it can also determine whether the package has already been installed.  

As for running terminal apps without a terminal window:
Check out MRJAppBuilder to create an application icon from a Java app, and you can also consider writing an Applescript app that will execute terminal commands (using the Applescript command do shell script "shellcommandshere")


----------



## anarchie (Aug 4, 2003)

To make a double-clickable, faceless app, just make an ordinary Cocoa application in Project Builder, then remove its main.m file, and add in your own source files for your console app.  The resulting app will be double-clickable, won't show up in the dock, and won't open Terminal.  If you want such an app to have any output, I suggest you write it so that its stderr is opened on a convenient log file, or /dev/console.  This way, you can read its output using Console.app.


----------



## brianleahy (Aug 4, 2003)

No kidding!  You can really put Unix shell script files in via Project Builder?!?


----------



## anarchie (Aug 4, 2003)

You'd have to add an extra build phase to copy the shell script to the right place, but yeah.  You can put any valid executable in an app, including a #! equipped shell script.


----------



## wiz (Aug 5, 2003)

> _Originally posted by stolmax _
> *Thanks, but will my MacOS open a terminal window at the time I run my console application? I know that windows will open a terminal window if I run a console application not from the terminal window? Will this happen on Mac also? Also, is there a way, a standard way, to locatel installation directory for other programs on the Mac OSX/9. Such as application X was installed on a user's Mac sometime ago. I come with my application and I want to determin if that applicaiton X was already installed on the user's computer? Can this be done. In windows, I can look up the registry for that information, how can this be done on MacOSX/9? Thanks *




the mac won't do that.. well i don't think it does.


----------



## brianleahy (Aug 6, 2003)

As I had mentioned elsewhere, to my knowledge the only time a terminal window will open spontaneously is if you run a shell script that you've made clickable by adding the '.command' suffix.


----------



## stolmax (Aug 6, 2003)

Thank you all.


----------

