
Load A new Version of an Exe File From the same Exe file
Assuming you implement a "wait for available" to use in the batch file - it
won't wait unless you make it. However, that means when you launch the app,
it will run the old version the first time after you placed an update in the
updates directory...
Of course you can do the testing (for new version) in the application
itself, and if update found, launch a service app (or batch file with a
"wait" feature) and terminate. The service app then only copies the file
and relaunches the original app.
The reason you'd probably want to take the other approach is that you can
make it generic. You can use the same "bootstrap" updater for every
application you distribute - whether it is your own, another developers',
another department's, a third party app (well - depends if you have to run a
setup, but you could get fancy...), or whatever. No code changes are
required to take advantage of it.
Building the test into the app itself may result in a slightly faster
startup of the application (a single launch instead of first loading the
bootstrap app). If this is a consideration, you may want to architect a
solution that works both ways.
HTH,
Tore
Quote:
> Thanks For Your Answer
> Isn't it possible to lanch form the EXE itself a shell command that will
> wait for the EXE to close and then will do the Copy of the new version ?
Quote:
> > You would have to write a little "bootstrap" application which does the
> > checking, copies the EXE if there is an update, and then launches the
EXE.
> > You can use an INI file or a registry setting to determine where the
> > "updates" directory resides, as well as the name (or path) of the
> > application to be checked and launched.
> > It is impossible to do this in the EXE itself, because the file is open
> > while it is running. Wise InstallMaster includes a tool to do this (the
> > "bootstrap" part). I am not sure about other setup tools.
> > HTH,
> > Tore.
> > > Hi
> > > I need to copy a new version of app.exe from within the app.exe how
can
> I
> > do
> > > it ?
> > > App.Exe
> > > Sub Main()
> > > if there is new version of App.exe then
> > > load the new version
> > > and run the new version
> > > endif
> > > End Sub