[tuxdroid-svn] r5497 - software_suite_v3/smart-core/smart-server/trunk/delphi_launchers/restart
Status: Beta
Brought to you by:
ks156
|
From: remi <c2m...@c2...> - 2009-09-25 07:37:11
|
Author: remi
Date: 2009-09-25 09:36:56 +0200 (Fri, 25 Sep 2009)
New Revision: 5497
Modified:
software_suite_v3/smart-core/smart-server/trunk/delphi_launchers/restart/restart.pas
Log:
* Updated restart launcher with the "--restart" smart-server command.
Modified: software_suite_v3/smart-core/smart-server/trunk/delphi_launchers/restart/restart.pas
===================================================================
--- software_suite_v3/smart-core/smart-server/trunk/delphi_launchers/restart/restart.pas 2009-09-25 07:31:28 UTC (rev 5496)
+++ software_suite_v3/smart-core/smart-server/trunk/delphi_launchers/restart/restart.pas 2009-09-25 07:36:56 UTC (rev 5497)
@@ -27,7 +27,6 @@
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs,
shellApi,
- tlhelp32,
Registry;
const
@@ -52,33 +51,6 @@
{$R *.dfm}
-{**
- *
- *}
-function GetTask(ExeFileName: string): integer;
-const
- PROCESS_TERMINATE = $0001;
-var
- ContinueLoop: BOOL;
- FSnapshotHandle: THandle;
- FProcessEntry32: TProcessEntry32;
-begin
- Result := 0;
- FSnapshotHandle := CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, 0);
- FProcessEntry32.dwSize := SizeOf(FProcessEntry32);
- ContinueLoop := Process32First(FSnapshotHandle, FProcessEntry32);
- while Integer(ContinueLoop) <> 0 do
- begin
- if ((UpperCase(ExtractFileName(FProcessEntry32.szExeFile)) = UpperCase(ExeFileName)) or
- (UpperCase(FProcessEntry32.szExeFile) = UpperCase(ExeFileName))) then
- begin
- Result := FProcessEntry32.th32ProcessID;
- end;
- ContinueLoop := Process32Next(FSnapshotHandle, FProcessEntry32);
- end;
- CloseHandle(FSnapshotHandle);
-end;
-
{*
* \brief Get the Tuxdroid installation path from the registry.
* \return The Tuxdroid installation path.
@@ -112,27 +84,9 @@
HWND(nil),
nil,
PChar(tuxdroid_path + '\softwares\python2.4\pythonForTuxdroid.exe'),
- PChar(format('"%s" --stop', [serverFileName])),
+ PChar(format('"%s" --restart', [serverFileName])),
PChar(format('"%s"', [serverPath])),
SW_HIDE);
- for i := 0 to 15 do
- begin
- if GetTask('pythonForTuxdroid.exe') <> 0 then
- begin
- application.ProcessMessages;
- sleep(500);
- end else
- begin
- break;
- end;
- end;
- ShellExecute(
- HWND(nil),
- nil,
- PChar(tuxdroid_path + '\softwares\python2.4\pythonForTuxdroid.exe'),
- PChar(format('"%s" --start', [serverFileName])),
- PChar(format('"%s"', [serverPath])),
- SW_HIDE);
application.Terminate;
end.
\ No newline at end of file
|