On 07/15/2011 01:40 PM, zachsmith...@gmail.com wrote:
>
> Does anyone know how to automatically close and restart a running gambas
> program?
>
> For example, if I have a program update available, I'd like to click a
> button in my program ("Install/Run update") that would start an
> intermediate program that would stop my program, then the intermediate
> program would overwrite the main program with an upgraded version, then
> it would start the upgraded program, and then the intermediate program
> would quit.  The problem is that by using the shell or exec commands a
> child process is created and the parent app. never quits.
>
> The thing I'm looking for would be somewhat similar to what happens when
> you run xfrun4 in Xfce.  There, you press Alt+F2 to bring up a command
> entry box, it then starts the program you have typed in and then xfrun4
> quits.  There are no remaining parent/child issues.

If there's not a native way to do it, you could have a "loader" program 
start the main program. When the main program terminates, control would 
be returned to the loader program, which would check an update directory 
for an update. If it finds one it would overwrite the main program with 
the update, delete the update, then re-run the main program. If not it 
would just exit normally. I'm going to need to do this myself at some 
point with my application.

-- 
Kevin Fishburne
Eight Virtues
www: http://sales.eightvirtues.com
e-mail: sa...@eightvirtues.com
phone: (770) 853-6271


------------------------------------------------------------------------------
AppSumo Presents a FREE Video for the SourceForge Community by Eric 
Ries, the creator of the Lean Startup Methodology on "Lean Startup 
Secrets Revealed." This video shows you how to validate your ideas, 
optimize your ideas and identify your business strategy.
http://p.sf.net/sfu/appsumosfdev2dev
_______________________________________________
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user

Reply via email to