2015-05-25 06:48:18

Okay, so in this game I'm making, the updater for it is automatic. It updates the game on the fly, don't ask me how I did that, top secret!
This game and updater are coded in bgt.
The file is called update.exe, and it needs a /u command line to run right.
So, I download it, all is well.
But then it's supposed to run, I type this.
run("update.exe","/u",false,false);
wait(100);
exit();
And it doesn't run the file! Or if it does, the cmd line isn't getting passed because it isn't activating.
However, when I open a command prompt in that folder and type
update.exe /u
then it runs and works? So my updater isn't flawed, but why does bgt not cmd line a bgt executable? Is this a bug in the engine? Or did I miss something.

----------
An anomaly in the matrix. An error in existence. A being who cannot get inside the goddamn box! A.K.A. Me.

2015-05-25 16:27:22

I haven't seen this situation yet but it seems as though a BGT script or executable can't pass command line parameters directly to another BGT executable. Have you tried running this through the command line from the BGT game program itself? Another possibility that should certainly be feasible would be to implement the updater so that it wouldn't have to be run with the command line parameter.
Just to make sure we have excluded all the possible scenarios, have you double checked the way the updater executable checks its command line parameters?
Thanks,
Lukas

I won't be using this account any more or participating in the forum activity through other childish means like creating an alternate account. I've asked for the account to be removed but I'm not sure if that's actually technically possible here. Just writing this for people to know that I won't be replying, posting new topics or checking private messages until the account is potentially removed.

2015-05-25 18:12:21

I made it string_contains now. And I pass it with a space when doing it from the game. But the whole point is the thing updates itself, but I have to close it for that to happen, so it's only right that I use an external file.

----------
An anomaly in the matrix. An error in existence. A being who cannot get inside the goddamn box! A.K.A. Me.

2015-05-25 21:39:04

Sure you need to use an external file for that because the main game executable needs to be closed in order to be overwritten. I was just suggesting alternative possibilities. Since the updater is probably not supposed to be run manually in the first place, you could omit the parameters altogether. The game would run it without them and close so that it can do its job, then I suspect the updater probably starts the game up again when it's done? So again, this restart of the game could be done without parameters and the game would automatically try to delete the updater.exe from within the main function so that it doesn't get in the user's way at all.
Is that of any use?
Lukas

I won't be using this account any more or participating in the forum activity through other childish means like creating an alternate account. I've asked for the account to be removed but I'm not sure if that's actually technically possible here. Just writing this for people to know that I won't be replying, posting new topics or checking private messages until the account is potentially removed.

2015-05-25 23:37:46

I just felt like doing a /u for security purposes so the user couldn't run it from explorer, even though yes it does delete it. i don't know why the hell I did it. I also have to make sure it can't be multilaunched, because if it is, it could cause huge file conflicts and windows would probably corrupt the files.

----------
An anomaly in the matrix. An error in existence. A being who cannot get inside the goddamn box! A.K.A. Me.

2015-05-26 16:33:11

Hi,
Alternatively, you could do file_exists in the updater code. That way, if multiple instances are launched, and you only download what has changed, the updater can use file_exists to see if the new files exist already. If the newer instances detect that the file_exists function returns true, then the updater should inform the user.

"On two occasions I have been asked [by members of Parliament!]: 'Pray, Mr. Babbage, if you put into the machine wrong figures, will the right answers come out ?' I am not able rightly to apprehend the kind of confusion of ideas that could provoke such a question."    — Charles Babbage.
My Github

2015-05-26 23:46:18

Or why not use the instance object in BGT directly? That way, the newly launched instances could be terminated immediately.
Lukas

I won't be using this account any more or participating in the forum activity through other childish means like creating an alternate account. I've asked for the account to be removed but I'm not sure if that's actually technically possible here. Just writing this for people to know that I won't be replying, posting new topics or checking private messages until the account is potentially removed.