got problem with my shelf made loader

ToF

Master Summoner
Joined
Jun 12, 2007
Messages
513
Reaction score
172
well i made a little game loader for my little server but when other ppl try to execute it they get a error..

it dont matter what the error says, i have read all around forums and i have seen many ppl have the same problem..

it also works perfect on my comp but if i move it to another it only comes a error..



win32 console application --->

#include
"stdafx.h"
#include <conio.h>
#include <process.h>
#include <iostream>
int main()
{
system(
"engine.exe /load /config debug");
return 0;
}

and i use visual studio 2008 pro

i dont think there is many ppl that know anything about c++ here but i take a chance....

anyone got "fix" for this?

 
Simply put, you're building it wrong. You're probably building it in debug mode (which will only run on a computer with visual studio installed).
 
Upvote 0
so how to make it in "NOT DEBUG" mode?

First of all go into your project settings. Near the top it should have "Configuration: <drop down box here with Debug>". Click it and select Release. Next go to Configuration Properties -> C/C++ -> Code Generation and change Runtime Library to Multi-threaded (/MT). Apply, then click Configuration Manager near the top right of the window, a new window opens. Under the configuration column, change it from Debug to Release. Close the window, click OK in the properties window and you're ready to build a release version.
 
Upvote 0
First of all go into your project settings. Near the top it should have "Configuration: <drop down box here with Debug>". Click it and select Release. Next go to Configuration Properties -> C/C++ -> Code Generation and change Runtime Library to Multi-threaded (/MT). Apply, then click Configuration Manager near the top right of the window, a new window opens. Under the configuration column, change it from Debug to Release. Close the window, click OK in the properties window and you're ready to build a release version.


i did not find the "project settings" but all seem to work anyways.. thanks
 
Upvote 0
hmm... now ppl can execute it but it dont launch the game they just see a black windows for 1 sec...



EDIT: i found out what my problem was, my friends was not able to execute becuse it was packed with yp... but i dont want it unpacked :S

maybe should try an other compressor..
 
Upvote 0
hmm... now ppl can execute it but it dont launch the game they just see a black windows for 1 sec...



EDIT: i found out what my problem was, my friends was not able to execute becuse it was packed with yp... but i dont want it unpacked :S

maybe should try an other compressor..

Code:
#define WIN32_LEAN_AND_MEAN
#include <windows.h>

int main()
{
	TCHAR cmndln[]  = {
		'/', 'l', 'o', 'a', 'd', ' ', 
		'/', 'c', 'o', 'n', 'f', 'i', 'g', ' ', 
		'd', 'e', 'b', 'u', 'g'
	};

	STARTUPINFO startinfo;
	PROCESS_INFORMATION procinfo;

	SecureZeroMemory(&startinfo, sizeof(startinfo));
	SecureZeroMemory(&procinfo, sizeof(procinfo));

	startinfo.cb = sizeof(startinfo);

	CreateProcess(TEXT("engine.exe"), cmndln, NULL, NULL, FALSE, 0, NULL, NULL, &startinfo, &procinfo);

	return 0;
}

Quite an ugly way to do it, but I guess it's easy and makes things ~less obvious.
 
Upvote 0
Code:
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
 
int main()
{
    TCHAR cmndln[]  = {
        '/', 'l', 'o', 'a', 'd', ' ', 
        '/', 'c', 'o', 'n', 'f', 'i', 'g', ' ', 
        'd', 'e', 'b', 'u', 'g'
    };
 
    STARTUPINFO startinfo;
    PROCESS_INFORMATION procinfo;
 
    SecureZeroMemory(&startinfo, sizeof(startinfo));
    SecureZeroMemory(&procinfo, sizeof(procinfo));
 
    startinfo.cb = sizeof(startinfo);
 
    CreateProcess(TEXT("engine.exe"), cmndln, NULL, NULL, FALSE, 0, NULL, NULL, &startinfo, &procinfo);
 
    return 0;
}

Quite an ugly way to do it, but I guess it's easy and makes things ~less obvious.


i get the message: "can't execute this program alone...." :P



does:

SecureZeroMemory(&startinfo, sizeof(startinfo));
SecureZeroMemory(&procinfo, sizeof(procinfo));

"secure, hide" memory parts?
 
Upvote 0
i get the message: "can't execute this program alone...." :P



does:

SecureZeroMemory(&startinfo, sizeof(startinfo));
SecureZeroMemory(&procinfo, sizeof(procinfo));

"secure, hide" memory parts?

I think you get that message because you didn't put in the correct command line. I assume you've changed things in your engine or so, so you have to edit the cmndln array to reflect those changes respectively. Currently it is:
/load /config debug

SecureZeroMemory simply makes sure the data is all set to zero.
 
Upvote 0
got it working..

your..

{
TCHAR cmndln[] = {
'/', 'l', 'o', 'a', 'd', ' ',
'/', 'c', 'o', 'n', 'f', 'i', 'g', ' ',
'd', 'e', 'b', 'u', 'g'
};

my :P
{
TCHAR cmndln[] = {
' ', '/', 'l', 'o', 'a', 'd', ' ',
'/', 'c', 'o', 'n', 'f', 'i', 'g', ' ',
'd', 'e', 'b', 'u', 'g'
};
 
Upvote 0
you maybe think that im strenuous now :P but i dont see any servers in the server list,

i changed debug to my "command" but dont work... i even tried alot of other "commands" but it still wont work...
 
Upvote 0
can i make like this:

Code:
	TCHAR cmndln[]  = {"/load /config debug"};

??

EDIT: well maybe not... it gives me a error:
Code:
error C2440: 'initializing' : cannot convert from 'const char [20]' to 'TCHAR'


maybe shuld try anything else than "TCHAR"??
 
Upvote 0
ok ive had another go at it and managed to make a loader.exe that loads config debug
it works on the int client but not on mine
on mine it fails to load debug , it loads the engine and config but no server name loads
where if i load it with the usual loader.bat i see no problem

any1 got any idea why?

.EDIT.

done it now...

= loader.exe - visualstudio project file

need to put..
Code:
;(country_type ENG)
;
;	Server List
;


(serverlist(name "svrname")(IP "127.0.0.1")( PORT "30000")(config "debug" "test2")(servernumber 1))
in xlate and...
Code:
#define WIN32_LEAN_AND_MEAN
#include <windows.h>

int main()
{
    TCHAR cmndln[]  = {
		' ', '/', 'l', 'o', 'a', 'd', ' ', 
		'/', 'c', 'o', 'n', 'f', 'i', 'g', ' ',
		'd', 'e', 'b', 'u', 'g', ' ', 't', 'e', 's', 't', '2'
	};
 
    STARTUPINFO startinfo;
    PROCESS_INFORMATION procinfo;
 
    SecureZeroMemory(&startinfo, sizeof(startinfo));
    SecureZeroMemory(&procinfo, sizeof(procinfo));
 
    startinfo.cb = sizeof(startinfo);
 
    CreateProcess(TEXT("engine.exe"), cmndln, NULL, NULL, FALSE, 0, NULL, NULL, &startinfo, &procinfo);
 
    return 0;
}
 
Upvote 0
Back