[Title]modified for changed sdcard path
authorsungmin ha <sungmin82.ha@samsung.com>
Thu, 19 Jul 2012 12:12:42 +0000 (21:12 +0900)
committersungmin ha <sungmin82.ha@samsung.com>
Thu, 19 Jul 2012 12:12:42 +0000 (21:12 +0900)
[Type]Enhancement
[Module]qemu
[Priority]Major
[Jira#] // Jira Issue Number
[Redmine#]  // Redmine Isuue Number
[Problem]  // Problem Description
[Cause]  // Cause Description
[Solution] // Solution Description
[TestCase]  // Executed the test-target (How to)

package/pkginfo.manifest
tizen/src/guest_server.c

index 76759596e4c08154ce5a9abd5f74821e8087e88b..b552d9a444dde94b90b6c2e5e4cbe2ffb118ab2c 100644 (file)
@@ -1,5 +1,5 @@
 Package: emulator-qemu-x86
-Version: 1.3.0
+Version: 1.3.1
 OS: ubuntu-32
 Build-host-os: ubuntu-32
 Maintainer: Yeong-Kyoon Lee<yeongkyoon.lee@samsung.com>
@@ -9,7 +9,7 @@ Source: emulator
 Description: Tizen Emulator
 
 Package: emulator-qemu-x86
-Version: 1.3.0
+Version: 1.3.1
 OS: ubuntu-64
 Build-host-os: ubuntu-64
 Maintainer: Yeong-Kyoon Lee<yeongkyoon.lee@samsung.com>
@@ -19,7 +19,7 @@ Source: emulator
 Description: Tizen Emulator
 
 Package: emulator-qemu-x86
-Version: 1.3.0
+Version: 1.3.1
 OS: windows-32
 Build-host-os: windows-32
 Maintainer: Yeong-Kyoon Lee<yeongkyoon.lee@samsung.com>
index 634070653749b5ca4dc452983fb405982f4ee7ed..feabefdc340d896ad56a72eecc47df55537e3154 100644 (file)
@@ -76,26 +76,39 @@ pthread_t start_guest_server( int server_port ) {
 
 }
 
-/* get_tizen_vms_sdcard_path = "/home/{USER}/tizen_vms/sdcard" */
-char* get_tizen_vms_sdcard_path(void)
+/* get_emulator_vms_sdcard_path = "/home/{USER}/tizen-sdk-data/emulator-vms/sdcard" */
+char* get_emulator_vms_sdcard_path(void)
 {
-       char tizen_vms[] = "/tizen_vms/sdcard/";
+       char *emulator_vms_sdcard_path;
 #ifndef _WIN32
+       char emulator_vms[] = "/tizen-sdk-data/emulator-vms/sdcard/";
        char *homedir = (char*)g_getenv("HOME");
+
+        if(!homedir)
+                homedir = (char*)g_get_home_dir();
+
+        emulator_vms_sdcard_path = malloc(strlen(homedir) + sizeof emulator_vms + 1);
+        assert(emulator_vms_sdcard_path != NULL);
+        strcpy(emulator_vms_sdcard_path, homedir);
+        strcat(emulator_vms_sdcard_path, emulator_vms);
 #else
-       char *homedir = (char*)g_getenv("USERPROFILE");
+       char emulator_vms[] = "\\tizen-sdk-data\\emulator-vms\\sdcard\\";
+       HKEY hKey;
+       char strLocalAppDataPath[MAX] = {0};
+       DWORD dwBufLen = 1024;
+       RegOpenKeyEx(HKEY_CURRENT_USER,
+        "Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Shell Folders",
+        0, KEY_QUERY_VALUE, &hKey);
+
+       RegQueryValueEx(hKey, "Local AppData", NULL, NULL, (LPBYTE)strLocalAppDataPath, &dwBufLen);
+        RegCloseKey(hKey);
+
+       emulator_vms_sdcard_path = malloc(strlen(strLocalAppDataPath) + sizeof emulator_vms + 1);       
+       strcpy(emulator_vms_sdcard_path, strLocalAppDataPath);
+        strcat(emulator_vms_sdcard_path, emulator_vms);
 #endif
-       char *tizen_vms_path;
-       
-       if(!homedir)
-               homedir = (char*)g_get_home_dir();
-
-       tizen_vms_path = malloc(strlen(homedir) + sizeof tizen_vms + 1);
-       assert(tizen_vms_path != NULL);
-       strcpy(tizen_vms_path, homedir);
-       strcat(tizen_vms_path, tizen_vms);
 
-       return tizen_vms_path;
+       return emulator_vms_sdcard_path;
 }
 
 static void* run_guest_server( void* args ) {
@@ -184,12 +197,12 @@ static void* run_guest_server( void* args ) {
                } else if( atoi(ret) == 1 ) {
                        /* mount sdcard */
                        char sdcard_path[256];
-                       char* vms_path = get_tizen_vms_sdcard_path(); 
+                       char* vms_path = get_emulator_vms_sdcard_path(); 
                        memset(sdcard_path, '\0', sizeof(sdcard_path));
                        
                        strcpy(sdcard_path, vms_path);
                        
-                       /* tizen_vms_sdcard_path + sdcard img name */
+                       /* emulator_vms_sdcard_path + sdcard img name */
                        ret = strtok(NULL, token);
                        strcat(sdcard_path, ret);
                        INFO( "%s\n", sdcard_path);