Re: Reload/restart php-gtk program
| From: | Bob Majdak Jr | Date: | Tue, 07 Aug 2007 23:42:24 +0000 |
| Subject: | Re: Reload/restart php-gtk program | ||
| Groups: | php.gtk.general | ||
| Request: | Send a blank email to php-gtk-general+get-8026@lists.php.net to get a copy of this message | ||
-------- Original Message --------
Subject: Re: [PHP-GTK] Reload/restart php-gtk program
Date: Tue, 07 Aug 2007 19:41:26 -0400
From: Bob Majdak Jr <bob@kateos.org>
Organization: KateOS
To: Peter Smith <smithpdo@gmail.com>
References: <12042083.post@talk.nabble.com>
I lack Windows command line structure knowledge, so if you need that perhaps someone can translate
this. But this is how I have been doing it in Linux, if the user does not have the required
permissions (admin) to run the program, just causing a 'restart' of the application.
<?php
//. this recompiles the exact command used for launch, flags options and all.
$argstr = implode(" ",$_SERVER['argv']);
$myMainWindow->hide();
$myMainWindow = null;
Gtk::main_quit();
//. all output must be silenced, and task must be
//. backgrounded, or else system will not return
//. and nothing happens to the main program.
system("{$argstr} &> /dev/null &");
exit(0);
//. bob
?>
Peter Smith wrote:
I would like to reload and restart a php-gtk program after the program has downloaded an updated version of itself. I visualise a dialog informing the user that an updated version has been installed and inviting him to click on a button to restart with the updated version of the program. How would you do this? I have a feeling the answer is painfully obvious but I can't see it. Peter.