final public class InstallPathConfig {
private static String sdkInstallPath;
- private final static String SDKSUFFIX = ".TizenSDK"+File.separatorChar+"tizensdkpath";
- private final static String EMULATOR_PATH = "Emulator";
- private final static String INSTALLER_PATH = "InstallManager";
+ private final static String SDKSUFFIX = ".TizenSDK" + File.separatorChar + "tizensdkpath";
// Registry Key
private static final String REGISTRY_PATH_OF_SHELL_FOLDER = "HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Shell Folders";
// Value Column
private static final String REG_SZ = "REG_SZ";
+ private static final String DIR_EMULATOR = "emulator";
+ private static final String DIR_INSTALLER = "install-manager";
+ private static final String DIR_TOOLS = "tools";
+
static {
// FIXME : don't need the following lines if using environment variable
String sdkPath;
}
}
- public static String getEmulatorPath(){
- return sdkInstallPath + File.separatorChar + EMULATOR_PATH;
- }
-
/**
* @deprecated Use {@link #getSDKPath()} instead.
*/
return sdkInstallPath;
}
+ private static String getToolsPath() {
+ return getSDKPath() + File.separator + DIR_TOOLS;
+ }
+
public static String getSDBPath() {
+ String toolsPath = getToolsPath();
if (OSChecker.isWindows())
- return getSDKPath() + File.separator + "SDK" + File.separator + "sdb" + File.separator + "sdb.exe";
+ return toolsPath + File.separator + "sdb.exe";
else
- return getSDKPath() + File.separator + "SDK" + File.separator + "sdb" + File.separator + "sdb";
+ return toolsPath + File.separator + "sdb";
}
public static String getSdbWinUsbApiPath() {
- return getSDKPath() + File.separator + "SDK" + File.separator + "sdb" + File.separator + "SdbWinUsbApi.dll";
+ return getToolsPath() + File.separator + "SdbWinUsbApi.dll";
}
public static String getInstallManagerPath() {
- return sdkInstallPath + File.separatorChar + INSTALLER_PATH;
+ return getSDKPath() + File.separator + DIR_INSTALLER;
+ }
+
+ public static String getEmulatorPath() {
+ return getToolsPath() + File.separator + DIR_EMULATOR;
}
private static void loadSdkPath(String sdkPath) {
+ boolean status = true;
if (HostUtil.exists(sdkPath)) {
String[] fileContent = HostUtil.getContents(sdkPath).split("=");
if (HostUtil.exists(fileContent[1]))
sdkInstallPath = fileContent[1];
else {
- DialogUtil.openMessageDialog("Tizen SDK is not installed properly.");
- System.exit(0);
+ status = false;
}
} else {
+ status = false;
+ }
+
+ if (!status) {
DialogUtil.openMessageDialog("Tizen SDK is not installed properly.");
System.exit(0);
}
br = new BufferedReader(new InputStreamReader(process.getInputStream(), encoding));
String line = null;
- while((line = br.readLine()) != null) {
+ while ((line = br.readLine()) != null) {
int index = line.indexOf(REG_SZ);
if (index >= 0) {
value = line.substring(index + REG_SZ.length()).trim();
}
}
} catch (IOException e) {
- // TODO Auto-generated catch block
e.printStackTrace();
} finally {
if (br != null) {
try {
br.close();
} catch (IOException e) {
- // TODO Auto-generated catch block
e.printStackTrace();
}
}