Load A new Version of an Exe File From the same Exe file 
Author Message
 Load A new Version of an Exe File From the same Exe file

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



Sun, 01 Jun 2003 00:02:06 GMT  
 Load A new Version of an Exe File From the same Exe file
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.


Quote:
> 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



Sun, 01 Jun 2003 04:16:47 GMT  
 Load A new Version of an Exe File From the same Exe file
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



Sun, 01 Jun 2003 04:54:47 GMT  
 Load A new Version of an Exe File From the same Exe file

Consider using Dynamic Link Libraries (DLLs). That's what they exist for:
provide maintainability to your app.

Regarding to your problem of executing the most recent code, it seems to be
more a Network-Administrative task and Installing issue than a code problem.
Consider changing your approach.

HTH.



Quote:
> 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



Mon, 02 Jun 2003 00:01:05 GMT  
 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



Mon, 02 Jun 2003 13:38:41 GMT  
 Load A new Version of an Exe File From the same Exe file
DLL's have the same kinds of issues with distribution, and benefit from the
same solution(s).

The update issue goes beyond the Network Administration issue - we use this
approach to provide updates to our customers while they are live.  Some of
the systems are used by walk-in's - there is nobody who uses the PC
regularly and would take an interest in (or have permission to) install
application upgrades.

See other posts for more information.

Regards,
Tore.



Quote:
> Consider using Dynamic Link Libraries (DLLs). That's what they exist for:
> provide maintainability to your app.

> Regarding to your problem of executing the most recent code, it seems to
be
> more a Network-Administrative task and Installing issue than a code
problem.
> Consider changing your approach.

> HTH.



> > 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



Mon, 02 Jun 2003 13:44:29 GMT  
 
 [ 6 post ] 

 Relevant Pages 

1. Load A new Version of an Exe File From the same Exe file

2. HELP!! New user cannot load EXE file

3. Specify DLL version when using mc.exe, rc.exe and/or link.exe

4. File.EXE version number?

5. ..... .exe how do i make a file have a exe for qba

6. Help: VB3.0 Error-3041 Incompatible db version (EXE) File only

7. Getting .exe file version properties?

8. Stripping the exe file version

9. Creating an .EXE file from a VB .EXE ????

10. Find out exe file version

11. !! external exe file version !!

12. Adding Version numbers to EXE files

 

 
Powered by phpBB® Forum Software