PackageManager pm = PackageManager.getInstance();
String targetDir = getTargetDir();
- Registry.sdkWorkSpacePath = getSDKDataPath();
+ Registry.sdkDataPath = getSDKDataPath();
Config.USER_CONFIG_HOME_PATH = getSDKDataPath();
PackageSet skipPackages = pm.getPackagesByNames(Options.skipPackages);
*/
private void setCurrentSDKEnvironment(String targetPath) {
Log.log("Set new SDK environment from old SDK.");
- Registry.sdkWorkSpacePath = Config.getConfigHome();
+ Registry.sdkDataPath = Config.getConfigHome();
if (targetPath == null || targetPath.isEmpty()) {
Log.err("Install path is invalid: " + targetPath
+/*
+* InstallManager
+*
+* Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+*
+* Contact:
+* Donghee Yang <donghee.yang@samsung.com>
+* Shihyun Kim <shihyun.kim@samsung.com>
+* Yongsung kim <yongsung1.kim@samsung.com>
+*
+ * Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*
+* Contributors:
+* - S-Core Co., Ltd
+*
+*/
+
package org.tizen.installmanager.core;
import org.tizen.installmanager.lib.ErrorController.ErrorCode;
import org.tizen.installmanager.lib.Platform;
+import org.tizen.installmanager.lib.Registry;
import org.tizen.installmanager.util.PathUtil;
public class InstallManagerConstants {
if (Platform.isLinux() || Platform.isMacOS()) {
return PathUtil.getFromHome(SDK_DATA_DIR_NAME);
} else if (Platform.isWindows()) {
- return PathUtil.getFromAppData(SDK_DATA_DIR_NAME);
+ if (Options.sdkDataPath.isEmpty() && Registry.sdkDataPath == "") {
+ return WINDOWS_DEFAULT_DATA_PATH;
+ } else if (!Options.sdkDataPath.isEmpty() && Registry.sdkDataPath == "") {
+ return Options.sdkDataPath;
+ } else if (Options.sdkDataPath.isEmpty() && Registry.sdkDataPath != "") {
+ return Registry.sdkDataPath;
+ } else {
+ throw new IMFatalException(ErrorCode.FILE_NOT_FOUND);
+ }
} else {
throw new IMFatalException(ErrorCode.UNSUPPORTED_PLATFORM);
}
HashMap<String, String> env = new HashMap<String, String>();
env.put("INSTALLED_PATH", Registry.getInstalledPath());
- env.put("SDK_DATA_PATH", Registry.sdkWorkSpacePath);
- env.put("USER_DATA_PATH", Registry.sdkWorkSpacePath);
+ env.put("SDK_DATA_PATH", Registry.sdkDataPath);
+ env.put("USER_DATA_PATH", Registry.sdkDataPath);
env.put("MAKESHORTCUT_PATH", InstallManager.getInstance().getMakeShortCutPath());
env.put("REMOVE_SHORTCUT", InstallManager.getInstance().getRemoveShortCutPath());
env.put("TSUDO", InstallManager.getInstance().getTSudoPath());
+/*
+* InstallManager
+*
+* Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+*
+* Contact:
+* Donghee Yang <donghee.yang@samsung.com>
+* Shihyun Kim <shihyun.kim@samsung.com>
+* Yongsung kim <yongsung1.kim@samsung.com>
+*
+ * Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*
+* Contributors:
+* - S-Core Co., Ltd
+*
+*/
+
package org.tizen.installmanager.core;
public class OptionConstant {
+/*
+* InstallManager
+*
+* Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+*
+* Contact:
+* Donghee Yang <donghee.yang@samsung.com>
+* Shihyun Kim <shihyun.kim@samsung.com>
+* Yongsung kim <yongsung1.kim@samsung.com>
+*
+ * Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*
+* Contributors:
+* - S-Core Co., Ltd
+*
+*/
+
package org.tizen.installmanager.core;
import java.io.BufferedWriter;
private static final String REGISTRY_SEPERATOR = "=";
public static String targetPath = "";
- public static String sdkWorkSpacePath = "";
+ public static String sdkDataPath = "";
private static ArrayList<String> sdkPathList = getSDKPath();
/**
public static void setSDKinfoBySDKPath(String sdkPath) {
File sdkInfoFile = new File(PathUtil.get(sdkPath, InstallManagerConstants.SDK_INFORMATION_FILE_NAME));
if (sdkInfoFile.exists()) {
- sdkWorkSpacePath = getPathFromRegistryKey(sdkInfoFile.getAbsolutePath(), SDK_DATA_PATH_KEY);
+ sdkDataPath = getPathFromRegistryKey(sdkInfoFile.getAbsolutePath(), SDK_DATA_PATH_KEY);
Log.log("sdk.info file exists. => " + sdkPath);
Log.log("InstallManager can set sdk environment.");
} else {
*/
public static void saveSDKInfo(String installPath) {
if (installPath == null || installPath.isEmpty() ||
- sdkWorkSpacePath == null || sdkWorkSpacePath.isEmpty()) {
+ sdkDataPath == null || sdkDataPath.isEmpty()) {
Log.err("Install path or workspace path is invalid: " + installPath
+ ". This might be a bug of IM");
throw new IMFatalException(ErrorCode.INVALID_INSTALL_PATH);
String sdkInfoPath = PathUtil.get(installPath, InstallManagerConstants.SDK_INFORMATION_FILE_NAME);
String target = INSTALLED_PATH_KEY + REGISTRY_SEPERATOR + installPath;
- String workSpace = SDK_DATA_PATH_KEY + REGISTRY_SEPERATOR + sdkWorkSpacePath;
+ String workSpace = SDK_DATA_PATH_KEY + REGISTRY_SEPERATOR + sdkDataPath;
File sdkInfoFile = null;
try {