1

Topic: [QUESTION] about starting exe files with external programs

Hey guys,

I' m writing a program to set up servers, start teeworlds and write your own cfg.

(I know there are some of those things right in this forum but mine has got improved features)

So far so well. smile

But now I' ve got a problem:

If I want to start a .exe file from my teeworlds directory (teeworlds_srv.exe, teeworlds.exe).  It just starts up without loading any sources (what' s actually correct) but I need to know how to start the executables with loading their ressources.

Info: My program is written in C#

Code Snippet (for starting up .exe files):

private void fromSameDirectoryToolStripMenuItem1_Click(object sender, EventArgs e)
        {
            string currentDir = Environment.CurrentDirectory +"\\teeworlds_srv.exe";
            System.Diagnostics.Process.Start(currentDir);
        }

Thanks for your (hopefully contemporary) answers. You are asked to post ideas, you needn't post finished codes.


greets

^aka~ Destiny'

by `aka~ Destiny'
Teeworlds-Server: www.destinyhas.gotdns.com:8302

2

Re: [QUESTION] about starting exe files with external programs

To start the server with a config, use "teeworlds_srv.exe -f config.cfg"

I don't know if this is what you asked for, but I find it really hard to understand your post.

3 (edited by Lanta 2009-05-03 14:14:14)

Re: [QUESTION] about starting exe files with external programs

Ok... now i make some test & i'll tell you... XD I had the same problem months ago big_smile
While waiting... you can check Diagnostics's Methods

Support Staff - ESL.eu Teeworlds Admin

4

Re: [QUESTION] about starting exe files with external programs

first, thanks for your replies.

Sommerunce wrote:

I don't know if this is what you asked for

well, i know how to start a server with a config but my problem is to start it via a self-made program using the start up-command i posted. i don't know how to get things working.

i had a new idea yesterday evening and i'll test it in a while.

mrlantastic wrote:

you can check Diagnostics's Methods

i'll check this.

my idea: build a temporary .ink file with has a property called -f config.cfg, maybe that could work ?!

by `aka~ Destiny'
Teeworlds-Server: www.destinyhas.gotdns.com:8302

5

Re: [QUESTION] about starting exe files with external programs

Destiny wrote:

first, thanks for your replies.
my idea: build a temporary .ink file with has a property called -f config.cfg, maybe that could work ?!

OMG no...

here's your method

private void executeApplication(string appName, string args)
{
System.Diagnostics.Process.Start( appName, args);
}

in args put "-f config.cfg"

Support Staff - ESL.eu Teeworlds Admin

6

Re: [QUESTION] about starting exe files with external programs

mrlantastic wrote:

here's your method

sry but i had that command in my program before and it just didn't work sad(

if i want to start the server it just starts and shuts down after a second... hmm

here is my codesnippet:

        //start server from same directory
        private void fromSameDirectoryToolStripMenuItem1_Click(object sender, EventArgs e)
        {
            string srv_exe = "teeworlds_srv.exe";
            string args = " -f server1.cfg";
            string currentDir = Environment.CurrentDirectory +"\\"+ srv_exe;
            System.Diagnostics.Process.Start(currentDir,args);
        }
by `aka~ Destiny'
Teeworlds-Server: www.destinyhas.gotdns.com:8302

7

Re: [QUESTION] about starting exe files with external programs

Destiny wrote:
mrlantastic wrote:

here's your method

sry but i had that command in my program before and it just didn't work sad(

if i want to start the server it just starts and shuts down after a second... hmm

here is my codesnippet:

        //start server from same directory
        private void fromSameDirectoryToolStripMenuItem1_Click(object sender, EventArgs e)
        {
            string srv_exe = "teeworlds_srv.exe";
            string args = " -f server1.cfg";
            string currentDir = Environment.CurrentDirectory +"\\"+ srv_exe;
            System.Diagnostics.Process.Start(currentDir,args);
        }

for me it works O_O
what are you using... Visual Studio 2008 & .NET 3.5?

Support Staff - ESL.eu Teeworlds Admin

8

Re: [QUESTION] about starting exe files with external programs

sry for making stupid shitty problems guys :S

my pc sucks, windows sucks, everything sucks but c# xD

now i got it right:

my pc was too stupid to open a console -.-

--tried it on another pc and now works--

though thanks for your support mrlantastic

by `aka~ Destiny'
Teeworlds-Server: www.destinyhas.gotdns.com:8302

9

Re: [QUESTION] about starting exe files with external programs

got another problem -.-:

if i want to start teeworlds from the current directory (also from different ones) it only starts teeworlds without any "data" like particles, editor files, the whole .png files and so on...

any suggestions?

by `aka~ Destiny'
Teeworlds-Server: www.destinyhas.gotdns.com:8302

10

Re: [QUESTION] about starting exe files with external programs

yes... you must have the folder "data" in the directory of the exe
so... you have to copy it in the exe directory just before exec it big_smile
File.Copy must work

Support Staff - ESL.eu Teeworlds Admin

11

Re: [QUESTION] about starting exe files with external programs

you mean the .exe of my own program right?!

by `aka~ Destiny'
Teeworlds-Server: www.destinyhas.gotdns.com:8302