test window package
authorjihye kim <jihye1128.kim@samsung.com>
Sun, 18 Mar 2012 12:08:52 +0000 (21:08 +0900)
committerjihye kim <jihye1128.kim@samsung.com>
Sun, 18 Mar 2012 12:08:52 +0000 (21:08 +0900)
emulator-manager.c [new file with mode: 0755]
package/build.windows

diff --git a/emulator-manager.c b/emulator-manager.c
new file mode 100755 (executable)
index 0000000..1cbb812
--- /dev/null
@@ -0,0 +1,52 @@
+#define MAX 1024\r
+#include <windows.h>\r
+#include <stdlib.h>\r
+#include <stdio.h>\r
+\r
+int main() {\r
+    FILE *propertyFile;\r
+    HKEY hKey;\r
+    char strPropertyFilePath[MAX];\r
+    char strLine[MAX];\r
+    char strCommand[MAX];\r
+    char* strInstalledPath;\r
+    char strLocalAppDataPath[MAX] = {0};\r
+\r
+    DWORD dwBufLen = MAX;\r
+    RegOpenKeyEx(HKEY_CURRENT_USER, \r
+    "Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Shell Folders",\r
+    0, KEY_QUERY_VALUE, &hKey);\r
+    RegQueryValueEx(hKey, "Local AppData", NULL, NULL, (LPBYTE)strLocalAppDataPath, &dwBufLen);\r
+    RegCloseKey(hKey);\r
+    printf("%s\n", strLocalAppDataPath);\r
+    // Get a "tizensdkpath" file path\r
+    //strLocalAppDataPath = getenv("LOCALAPPDATA");\r
+    strcpy(strPropertyFilePath, strLocalAppDataPath);\r
+    strcat(strPropertyFilePath, "\\.TizenSDK\\tizensdkpath");\r
+    printf("%s\n", strPropertyFilePath);\r
+    // get a line of installed path\r
+    if ((propertyFile = fopen(strPropertyFilePath, "rt")) == NULL) {\r
+      fputs("Cannot open input file...\n", stderr);\r
+      exit(1);\r
+    }\r
+\r
+    if (fgets(strLine, MAX, propertyFile) == NULL) {\r
+      fputs("Cannot read input file...\n", stderr);\r
+      exit(1);\r
+    }\r
+\r
+    fclose(propertyFile);\r
+\r
+    // tokenize property and get a SDK installed path\r
+    strtok(strLine, "=");\r
+    strInstalledPath = strtok(NULL, "=");\r
+\r
+    // make a command that start emulator-manager\r
+    strcpy(strCommand, "javaw -jar ");\r
+    strcat(strCommand, strInstalledPath);\r
+    strcat(strCommand, "\\Emulator\\bin\\emulator-manager.jar");\r
+\r
+    // execute emulator-manager\r
+    WinExec(strCommand, SW_SHOWNORMAL);\r
+    return 0;\r
+}\r
index fda5266..06201eb 100755 (executable)
@@ -14,16 +14,19 @@ build()
 {
        cd $SRCDIR
        ant -buildfile build.xml windows-jar
+       gcc emulator-manager.c -o emulator-manager.exe
 }
 
 # install
 install() 
 {
        BIN_DIR=$SRCDIR/package/emulator-manager.package.windows/data/Emulator
+       VTM_DIR=$BIN_DIR/Emulator/bin/emulator-manager.exe
        mkdir -p $BIN_DIR/bin
 
+       editbin.exe /SUBSYSTEM:WINDOWS $VTM_DIR
        cp emulator-manager.jar $BIN_DIR/bin
-       cp emulator-manager.bat $BIN_DIR/bin
+#      cp emulator-manager.bat $BIN_DIR/bin
 #      cp -r lib $BIN_DIR/bin/
 }