Question

I have a Mono application that should not show on the dock, but will occasionally show a window. I want neither menu bar nor dock icon to show for this application. I have my application wrapped in an app bundle, and my info.plist file has the LSUIElement set to "1". This does not seem to be hiding my application from the Dock.

I have tried also calling osascript with the following info in a Process.Start: osascript -e 'tell application "System Events" to set visible of process "myapp" to false'

This returns a System Event error code: -10006. Thus far, I've had no luck finding out what that means.

I've also tried all the standard Hide() and Visibility = false stuff inside Mono.

Anyone found a workaround for this, or have an idea a direction I can look in? For the most part, working in Mono has been straightforward .Net coding, but this has me stumped.

Was it helpful?

Solution

Well, after a fair amount of work, I figured out a better way to do this. I am generating a Silverlight + mono application targeting OSX. I needed to get both launching from the same button press.

Solved it with a bash script command from within the bundle that the Silverlight OOB installation process creates, and simply distributed the created bundle, with some rsync commands.

The line that launches the server bit (created using Mono's macpack tool): open MyApp.app &

The line that then launches the Silverlight OOB app normally: ./Silverlight $@ &> /dev/null

The '$@' bit passes all the initial arguments into the Silverlight executable in the OOB app. Means you have to play with the Info.plist to make it launch your own launcher, so your 'Silverlight' executable doesn't get overwritten on a Silverlight update, but seems to work quite well.

OTHER TIPS

This is what you are looking for: http://uselessthingies.wordpress.com/2008/05/18/an-app-without-dock-icon-and-menu-bar/

tl;dr: Package your .app, and in your app's Info.plist add <key>LSUIElement</key><string>1</string>.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top