Posted: 26th Jun 2007 20:58
hey....
i see that you can put files in the exe.
how would i start the files in the exe?

thanks in advance
Posted: 26th Jun 2007 23:32
...what do you mean start them??
Posted: 27th Jun 2007 9:51
like when person opens that one it comes up with updating options.
when its updated he clicks start.
and it opens that exe.
Posted: 27th Jun 2007 14:06
I am afraid I don't understand what you mean.
The files to be included in your exe should really be media files. You can include images, models, sounds, music etc. and they are accessible as files when the exe is run.
Posted: 27th Jun 2007 14:44
If you packaged media in the EXE it creates a huge EXE with all of the media attached. You could do a variety of things to create an auto-update feature for this.

1. You could replace the entire EXE
2. You could write a program that separates the original EXE into its base parts, modifies the EXE, then reassembles the files back into the same format that it was in.

I wouldn't do either of these personally. I'd use the DBP Enhancement pack to put all of my media in file blocks and keep the EXE all by itself. Then all you have to do is apply your patch to the EXE, or replace the EXE totally (easiest). Then the updates wouldn't be insanely huge.
Posted: 27th Jun 2007 15:26
Though an exe file cannot replace itself


Oh, yes they can. See attachted file.
Posted: 27th Jun 2007 16:55
Thank you Code Dragon.

@WindowsKiller -
That's the second time you've interjected when I'm giving advice, and the second time you've been wrong doing so. The other was in the Newcomer's Corner in the thread about the timer question. It would be to your benefit to research things before you post them. No harm, just observing.
Posted: 27th Jun 2007 16:59
Code Dragon

Your exe won't run - cannot find path at line 7 error.

In any case, if the exe is running then Windows locks it and prevents it from being altered - such as being deleted or renamed etc - not DB.

[Edit] Unless there's a way to unlock it from within your program. I'd like to see what your SelfDestruct program does...

TDK_Man
Posted: 27th Jun 2007 17:03
His EXE ran fine for me and did what it was designed to do - delete itself then exit.
Posted: 27th Jun 2007 17:23
Usually (in the Microsoft world) we would code (or simply "write out") a quick VBScript that - when executed - deletes the old .EXE file, renames the new .EXE file (from whatever it was called when it was transferred), then calls the new .EXE *(from the old filename, right?) and exists.

The .EXE's were all trained to look for that particular VBScript on startup and kill it if it existed, thus closing the possible security loophole that presented itself.

It's worked every time so far - a little kludgy-seeming, now that I think about it - but it's always worked. And it gets you around the "file in use" issue.

Just a thought.
Posted: 27th Jun 2007 17:55
how would i start the program/media thats in the exe
Posted: 27th Jun 2007 17:59
It will get extracted to the users temp folder. Knowing this path (through some API's I imagine), you would use 'Execute File'.
Posted: 27th Jun 2007 18:04
Or you could create the TEMP folder (gasp!) in the app's folder - no APIs!
Posted: 27th Jun 2007 18:05
so
Execute File "john.jpg"
Posted: 27th Jun 2007 18:06
Media is extracted by the DBP startup stub though, so you can't decide where it gets put.
Posted: 27th Jun 2007 18:15
ok ive put the file it.
how do i open it and run it?
Posted: 27th Jun 2007 19:30
DBP can access it just the same as if it were in the same folder. Why do you want to 'run it'? I'm sure there's a better way to accomplish what you want.
Posted: 27th Jun 2007 20:56
Your exe won't run - cannot find path at line 7 error.


You probably need to "mkdir C:\TEMP" if you got that error, I assumed the temp folder exists on everyone's computer.

[edit]
delete itself then exit


Techincally it exits then deletes itself...