Now from an my application I can download a exe
the exe is on a my website
the exe is the same exe of application but with another name
How I can make to close My application , renamed the exe downloaded and run this file ?
thanks
close and run the same appl
Re: close and run the same appl
Hello Silvio,
How to do it :
1. Create a small application : Restart.exe
2. Inside Your Application define a RESTART - Button
What the RESTART-Button must do :
Set a Var lRestart to .T. and close the application.
After closing the Main-Window, the RESTART.exe will start.
RESTART.exe after closing, will call Your application again ( Renamed or not Renamed ).
Define a RESTART-Button inside Your Application
Regards
Uwe
How to do it :
1. Create a small application : Restart.exe
2. Inside Your Application define a RESTART - Button
What the RESTART-Button must do :
Set a Var lRestart to .T. and close the application.
After closing the Main-Window, the RESTART.exe will start.
RESTART.exe after closing, will call Your application again ( Renamed or not Renamed ).
Define a RESTART-Button inside Your Application
Code: Select all | Expand
...
LOCAL lRestart := .F. // No restart after closing the application
....
....
// Your Restart-Button somewhere ( activate Restart )
// Action ( lRestart := .T., oWnd:End() )
....
....
ACTIVATE WINDOW oWnd MAXIMIZED
IF lRestart = .T. // Restart is activated
WINEXEC( "RESTART.exe" )
ENDIF
RETURN NIL
// ---- THE RESTART - Application ---------------------
#include "FiveWin.ch"
#define WID 350
#define HGT 200
FUNCTION Main()
local oDlg
DEFINE DIALOG oDlg SIZE 2*WID,2*HGT PIXEL
ACTIVATE DIALOG oDlg CENTER ON INIT ( oDlg:Resize(), RESTART(oDlg) )
WINEXEC( "Myfile.exe" )
RETURN NIL
// -------------------
FUNCTION RESTART(oDlg)
IF MsgYesNo( "Rename and Restart Application ?", " Restart Application " )
DELETE FILE "MyFile.exe"
FRENAME("MyNewFile.exe","Myfile.exe")
ENDIF
oDlg:End()
RETURN NIL
Regards
Uwe

Last edited by ukoenig on Tue Feb 24, 2009 1:57 pm, edited 1 time in total.
Since 1995 ( the first release of FW 1.9 )
i work with FW.
If you have any questions about special functions, maybe i can help.
i work with FW.
If you have any questions about special functions, maybe i can help.