I want to know if when using RunProgram() does PB continue to execute the original program or is program execution halted at that command until the executed program has exited. If it's the later, is there a way to get around this. I'm attempting to create an update system which sometimes needs to update the currently running .exe. I've created a small app to handle the update process but it seems as tho PB isn't releasing the initial .exe file before the update process has started and as such my updated .exe is messed up (file size should have been about 270k and it ended up being 6.5k).. Any help would be greatly appreciated.
I am currently using PB 4.40 Beta 3 on Windows XP SP3..
Executing an .exe file from within another pb app.
Executing an .exe file from within another pb app.
Windows 7 Ultimate x64 / PureBasic 5.21 LTS / ProGUI Platinum / PureVision / http://www.linkedin.com/groups/PureBasi ... =&trk=tyah
-
- Addict
- Posts: 1027
- Joined: Sun May 15, 2005 5:15 am
- Location: Australia
- Contact:
Re: Executing an .exe file from within another pb app.
Did u read the manual?UUICEO wrote:does PB continue to execute the original program or is program execution halted at that command until the executed program has exited.
By default it starts it then continues it's own execution. It has a wait flag if needed.
Demonio Ardente
Currently managing Linux & OS X Tailbite
OS X TailBite now up to date with Windows!
Currently managing Linux & OS X Tailbite
OS X TailBite now up to date with Windows!
Re: Executing an .exe file from within another pb app.
yes I did read the manual and I know it has a wait flag. I don't want it to wait.
Windows 7 Ultimate x64 / PureBasic 5.21 LTS / ProGUI Platinum / PureVision / http://www.linkedin.com/groups/PureBasi ... =&trk=tyah
Re: Executing an .exe file from within another pb app.
I think that a program is locked while it's in use...
a possible workaround:
a possible workaround:
- program1 executes with update parameters
- program1 updates program2
- program1 executes program2 and ends
- program2 updates program1
- program2 executes program1 without update parameters and ends
- program1 performs new functions
there is no sig, only zuul (and the following disclaimer)
WARNING: may be talking out of his hat
WARNING: may be talking out of his hat
- John Puccio
- User
- Posts: 26
- Joined: Fri Jun 12, 2009 6:56 am
- Location: My Keyboard
Re: Executing an .exe file from within another pb app.
I've not actually tried this yet but, would running it from a batch file fix the problem?
JP
JP
Re: Executing an .exe file from within another pb app.
My problem is how to execute any file from within the .exe that I'm trying to update without messing it up. I guess I could just create a separate update app.. but that is only a last resort.
Windows 7 Ultimate x64 / PureBasic 5.21 LTS / ProGUI Platinum / PureVision / http://www.linkedin.com/groups/PureBasi ... =&trk=tyah
-
- Addict
- Posts: 1027
- Joined: Sun May 15, 2005 5:15 am
- Location: Australia
- Contact:
Re: Executing an .exe file from within another pb app.
that is the most common method as far as i know.UUICEO wrote: I guess I could just create a separate update app..
the other option, as mentioned, would be to use a batch file; save the updated exe as "ProgramName_update.exe" and in the batch delete "ProgramName.exe" and rename "ProgramName_update.exe"
or something along those lines.
because you can't edit a running exe without messing it up.
Demonio Ardente
Currently managing Linux & OS X Tailbite
OS X TailBite now up to date with Windows!
Currently managing Linux & OS X Tailbite
OS X TailBite now up to date with Windows!
Re: Executing an .exe file from within another pb app.
My stuff, when I use the RunProgram, starts up the program and the original lauching program continues once the RunProgram is executed. I don't know about the update thing for sure, maybe if you ran it in a seperate thread? I had to do it in a separate thread for some CD\DVD burning stuff i put together and it seemed to work OK then for updating the original launching app in terms of status. But as far as editing I don't know.
The advantage of a 64 bit operating system over a 32 bit operating system comes down to only being twice the headache.
Re: Executing an .exe file from within another pb app.
It was working correctly.. I neglected to reset a variable I was using which kinda messed everything up. I have it all worked out now. Thanks for the help.
Windows 7 Ultimate x64 / PureBasic 5.21 LTS / ProGUI Platinum / PureVision / http://www.linkedin.com/groups/PureBasi ... =&trk=tyah