objarni's picture

OpenTK on Ubuntu - double-click to run program?

Hi there!

So I've almost finished setting up my new development environment Ubunt+VirtualBox+WinXp + WINE for legacy games (like HL2 - can't live without it!).

When developing inside VirtualBox with Visual Studio, I've set things up so that a post-build event copies the binary .NET-exe output file to a Ubuntu-shared folder so that I can do "mono Mygame.exe" from a terminal window in Ubuntu. Works!

But after awhile it does get a tid tad tedious to do it this way. So I wrote a script-file containing just "mono Mygame.exe", saved it as "run" and made it executable. Then I put a link to that script on the Ubuntu desktop.

1. [FIXED] First problem: the link does not change the "current directory" to the link target - quick fix just use absolute paths in script instead:

mono /home/olof/Skrivbord/shared/Core.exe

2. [FIXED] Second problem (or more like annoyance): Ubuntu keeps asking me whether I really want to run the script when I double-click the link. Duh! Of course I do. But how do I teach Ubuntu that? Or is there another way?

Update: I found solutions to both problems!


Comments

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
objarni's picture

Why is it always the case you solve problems once you express them..? :)

Here's the solution:

1. Don't make a drag-and-drop-link to the Ubuntu desktop.
2. Instead, right-click the desktop and pick "Create Launcher"
3. Browse to the script
4. Create the "Launcher" (with some slick hand-picked icon)
5. Double-clicking the launcher-icon runs the script without any popup!

Sorry for posting such a nonsense thread!

Hope 2009 treats you well,

Mincus's picture

If you just want the exe to run on a double-click you could try following the instructions on Registering .exe as non-native binaries (Linux only) on the page http://www.mono-project.com/Guide:Running_Mono_Applications

Not tried it myself though so can't comment on how well it works.