[Mono-osx] How to hide mono and windows form in Mac Dock

d_v dan.vandermolen at figpsoft.com
Wed Feb 4 16:16:11 EST 2009


Hi there,

I figure I can not run my C# 2.0 .NET Windows Service on mono, so I am
running the equivalent Windows Form (application) on mono.

However the script editor, mono, and sometiimes the form (windows state is
set to minimized) are all visible in the Dock.  I use a script to launch
mono and the .exe.

What do you advise is the best way to hide these programs from the Dock?
I am hoping for a manual way to do this and maybe a way to do it in setup/or
code so I do not have to bother the user with setting this up.

Currently my program setup steps are quite difficult for the user.  To bad
there is not setup program for them, like the Windows Service installer.

This is my current long list to setup the program. Any ideas would be very
welcome. :)

(I realise I can do Step 7a) and 7b)ahead of time and create the script for
the user - just shown here)

How to install the program:
---------------------------

1.	Login as root if you do not have permissions to install or start/stop
Windows Services
2.	If the program was previously installed please remove it.
3.	Create a directory for the program: /Program Files/MyCompany/MyService
4.	Copy all the files to the program directory
5.	Modify the password in the file: /Program
Files/MyCompany/MyService/MyProgram.exe.config
6.	Setup network directories to connect automatically on boot-up: In order
to copy files over the network we require automatic access to the directory
upon rebooting the PC.  If you don't have this automatic access (if it
prompts for password this will not work for the service).  Here are
instructions to mount a network directory automatically upon boot-up.  This
was tested for smb/cifs shares:
a)	How to Unmount: If you need to unmount: Select top menu item: Go, then
click  Computer, Right click the mounted drive and select "eject".  You may
also be able to unmount by clicking File, then "Eject <directory name>"
b)	How to connect to share/directory (Mount): Click on top menu: Go |
Connect to Server | type in format: E.g.: "smb://address/share" or E.g.:
"smb://192.168.0.250".  It may prompt for user and password, and it may ask
which volumes to mount (folders/files) from the smb/Windows network.  Chose
the correct one and if possible save the password into your keychain for
automatic login.
c)	How to Mount automatically on boot-up:  Click the Apple icon | System
Preferences | Accounts | select correct account name | choose the "Login
Items" tab | then add an application (Volume) by clicking the "plus" sign. 
In the list shown, select the shared directory and any subfolder(s) and
click the "add" button.  The real path will be under "/Volumes/" on the Mac
–visible in Terminal but not in normal view in Finder.  When you restart it
will prompt for root password to mount the drive, but select, remember in my
keychain to avoid future prompts.  (/Utilities/Keychain Access)

7.	Setup program to run automatically at boot-up:
a)	Create an apple script to start the program:  Open ScriptEditor (Go |
Applications | AppleScript | Script Editor) and create a new script.  (No
spaces in path) and save as type: script. and type: 
   do shell script "mono --debug /Program
Files/MyCompany/MyService/MyProgram.exe &> /Program
Files/MyCompany/MyService/debugApp.log
b)	Save the apple script as an application: Save this script (File | Save
As) as File Format: Application and uncheck "Startup Screen" and name it:
MyService
c)	Run the application automatically on boot-up: Click the Apple icon |
System Preferences | Accounts | select correct account name | choose the
"Login Items" tab | then add an application (Volume) by clicking the "plus"
sign.  In the list shown, select the apple application you just created
(ClientUploaderService) and click the "add" button.  Also check the "hide"
application checkbox so this program will run in the background. 

8.	Now install the mono 2.2 framework:
a)	Download the framework from website:
http://www.mono-project.com/Downloads
b)	Run the mono setup file
9.	Now run command in Terminal to import security certificates for mono: Run
this command at the Terminal on the Mac. It will prompt for root  word.  

yes yes|sudo mozroots --import --machine 
10.	Now reboot the computer to test and to save any passwords required to
key chain


-- 
View this message in context: http://www.nabble.com/How-to-hide-mono-and-windows-form-in-Mac-Dock-tp21839765p21839765.html
Sent from the Mono - OSX mailing list archive at Nabble.com.



More information about the Mono-osx mailing list