Author: remi
Date: 2008-11-28 11:30:12 +0100 (Fri, 28 Nov 2008)
New Revision: 2897

Modified:
   
software_suite_v2/software/http_server_resources/chatter_tux/trunk/ChatterTuxStart/chattertux_start.dpr
Log:
* updated chattertux_start tool

Modified: 
software_suite_v2/software/http_server_resources/chatter_tux/trunk/ChatterTuxStart/chattertux_start.dpr
===================================================================
--- 
software_suite_v2/software/http_server_resources/chatter_tux/trunk/ChatterTuxStart/chattertux_start.dpr
     2008-11-28 10:23:49 UTC (rev 2896)
+++ 
software_suite_v2/software/http_server_resources/chatter_tux/trunk/ChatterTuxStart/chattertux_start.dpr
     2008-11-28 10:30:12 UTC (rev 2897)
@@ -6,8 +6,15 @@
   Windows,
   SysUtils,
   shellApi,
-  tlhelp32;
+  tlhelp32,
+  Registry;
 
+const
+  TUXDROID_REGISTRY_PATH = 'SOFTWARE\Tuxdroid\TuxdroidSetup';
+
+var
+  tuxdroid_path : string;
+
 {**
  *
  *}
@@ -45,8 +52,29 @@
   CloseHandle(FSnapshotHandle);
 end;
 
+function getChatterTuxPath : string;
 begin
+  result := '';
+  with TRegistry.Create do
+    try
+      RootKey := HKEY_LOCAL_MACHINE;
+
+      // From Tuxdroid setup
+      if OpenKey(TUXDROID_REGISTRY_PATH, False) then
+      begin
+        // Get tuxdroid installation path
+        result := ReadString('Install_Dir');
+        result := result + '\resources\tuxhttpserver\chatterTux' ;
+        CloseKey;
+      end;
+    finally
+      Free;
+    end;
+end;
+
+begin
+  tuxdroid_path := getChatterTuxPath;
   KillTask('ChatterTux.exe');
-  ShellExecute(0, nil, PChar('c:\tuxdroid\bin\ChatterTux\ChatterTux.exe'),
+  ShellExecute(0, nil, PChar(tuxdroid_path + '\ChatterTux.exe'),
     nil, nil, SW_HIDE);
 end.


-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Tux-droid-svn mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/tux-droid-svn

Reply via email to