Package-Server:
Server-Type: snapshot
InstallManager-Version: 2.3.0
-Distribution: tizen_2.2
+Distribution: develop
Release-note: https://developer.tizen.org
import org.tizen.installmanager.core.InstallManager;
import org.tizen.installmanager.core.InstallManagerConstants;
import org.tizen.installmanager.core.Options;
+import org.tizen.installmanager.core.Performance;
import org.tizen.installmanager.lib.Downloader;
import org.tizen.installmanager.lib.ErrorController;
import org.tizen.installmanager.lib.IFileSystemInformation;
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);
+
if (packageNames.contains("all")) {
if (checkAvailableSize(getAllPackages(), targetDir)) {
- return installPackages(getAllPackages(), targetDir);
+ return installPackages(pm.diff(getAllPackages(), skipPackages), targetDir);
}
} else if (!validateInstallPkgs(pm, packageNames)) {
return false;
List<String> installableMetaNames = getInstallableMetas(pm, packageNames);
PackageSet installableMetas = pm.getPackagesByNames(installableMetaNames);
PackageSet installablePackages = pm.getDependsPackagesFromRepository(installableMetas);
- PackageSet skipPackages = pm.getPackagesByNames(Options.skipPackages);
-
+
if (!skipPackages.isEmpty()) {
Log.log("Installation skip packages : " + skipPackages);
installablePackages = pm.diff(installablePackages, skipPackages);
}
+ Registry.saveSDKInfo(targetDir);
+
if (checkAvailableSize(installablePackages, targetDir)) {
return installPackages(installablePackages, targetDir);
} else {
* @return
*/
private static boolean initInstallManager() {
+ Performance.setInitializeStartTime();
ErrorController.setInstallationSuccess(true);
controller = new ViewController();
if (controller.init()) {
+ Performance.setInitializeEndTime();
return true;
} else {
Log.err("InstallManager init fail.");
if (inputDataDir == null) {
if (Platform.isLinux() || Platform.isMacOS()) {
- dataDir = System.getProperty("user.home") + File.separator + Config.SDK_DIRECTORY;
+ dataDir = System.getProperty("user.home") + File.separator + Config.CONFIG_DIRECTORY_NAME;
} else if (Platform.isWindows()) {
dataDir = InstallManagerConstants.WINDOWS_DEFAULT_DATA_PATH;
} else {
import org.tizen.installmanager.core.Config;
import org.tizen.installmanager.core.IMExitException;
+import org.tizen.installmanager.core.Performance;
import org.tizen.installmanager.lib.Log;
import org.tizen.installmanager.lib.Platform;
import org.tizen.installmanager.pkg.lib.PackageManager;
System.out.println("******* Start SDK uninstallation *******");
System.out.println("****************************************");
+ Performance.setRemovalStartTime();
ViewController controller = new ViewController();
controller.init();
if (size == 1 && pkg.getPackageName().equals(ESSENTIAL_COMPONENT)) {
if (controller.uninstall(pm.getInstalledMetaNames(), null)) {
clearTargetDir();
+ Performance.setRemovalEndTime();
return true;
} else {
return false;
}
} else {
+ Performance.setRemovalEndTime();
return true;
}
} else {
private static final String SDK_IMAGE_ZIP_EXTENSION = ".zip";
public static boolean cliInstall(List<String> packageNames) throws IMExitException {
+ if (!Options.isAgreeLicense) {
+ System.out.println("You must agree the licenses of Tizen SDK components before installing SDK.");
+ System.out.println("If you agree them, use '-accept_license' option.");
+ Log.err("Cannot find '-accept_license' option.");
+ return false;
+ }
+
if (Options.isNetwork) {
return cliNetworkInstall(packageNames);
} else {
private ConfigFile mConfigFile = null;
private ConfigFile currentConfigFile = null;
private String mTargetDir = "";
+ private String mSdkDataDir = "";
private static Config config = null;
public void setTargetDir(String targetDir) {
mTargetDir = targetDir;
}
+
+ /**
+ * Set target directory to member variable.
+ *
+ * @param targetDir
+ */
+ public void setSdkDatatDir(String dataDir) {
+ mSdkDataDir = dataDir;
+ }
/**
* Get ConfigFile Class instance
public String getTargetDir() {
return mTargetDir;
}
+
+ /**
+ * @return path of target directory
+ */
+ public String getSdkDataDir() {
+ return mSdkDataDir;
+ }
/**
* @return <code>true</code> if proxy server is specified
if (!Registry.getInstalledPath().isEmpty()) {
mConfig.setTargetDir(Registry.getInstalledPath());
}
+ mConfig.setSdkDatatDir(Registry.getSdkDataPath());
}
}
*/
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
* @return
* @throws IMExitException
*/
- public boolean install(PackageSet installablePackages, String targetDir,
+ public boolean install(PackageSet installablePackages, final String targetDir,
InstallProgressMonitor monitor) throws IMExitException, IMNetworkException{
Log.log("InstallManager.install() installable packages : " + installablePackages);
+ //performance measurement
+ Performance.sdkPackageSize = packageManager.getTotalSizeOfInstallablePackages(installablePackages, true);
+
if (installablePackages == null || targetDir == null || targetDir.isEmpty()) {
Log.err("packaegs => " + installablePackages + ", targetDir => "
+ targetDir);
}
mConfig.setTargetDir(targetDir);
+ mConfig.setSdkDatatDir(Registry.sdkDataPath);
+
+ Performance.setDownloadStartTime();
// download packages from repository
if (downloadPackages(installablePackages, monitor)) {
}
}
}
+
+ Performance.setDownloadEndTime();
+ Performance.setInstallationStartTime();
// save target directory
initializeTargetDir(targetDir);
ErrorController.setInfoCode(InfoCode.RESTART_THE_COMPUTER);
}
+ Performance.setInstallationEndTime();
+
return true;
}
// Keep target path for later use
mConfig.setTargetDir(targetDir);
+ mConfig.setSdkDatatDir(Registry.sdkDataPath);
// Make .info directory
if (!mConfig.makeInfoDirectory()) {
final static public String WINDOWS_DEFAULT_DATA_PATH = "C:\\tizen-sdk-data";
//sdk configuration file
+ final static public String SDK_DATA_DIR_NAME = "tizen-sdk-data";
+// final static private String SDK_DATA_PATH = getSDKDataPath();
final static public String SDK_CONFIGURATION_DIR = ".info";
final static public String SDK_INFORMATION_FILE_NAME = "sdk.info";
final static public String SDK_INSTALLED_PACKAGE_LIST_FILE = "installedpackage.list";
final static public String SDK_INSTALLED_PACKAGE_LIST_PATH = PathUtil.get(SDK_CONFIGURATION_DIR, SDK_INSTALLED_PACKAGE_LIST_FILE);
+ //test file
+ final static public String SDK_TEST_DIR_NAME = "test";
+// final static public String SDK_INSTALLMANAGER_TEST_RESULT_DIR_PATH = PathUtil.get(SDK_DATA_PATH, SDK_TEST_DIR_NAME, INSTALLMANAGER_DIRECTORY_NAME);
+
static String getInstallManagerBinaryName() {
if (Platform.isLinux()) {
}
}
+ static String getInstallManagerTestResultPath() {
+ return PathUtil.get(getSDKDataPath(), SDK_TEST_DIR_NAME, INSTALLMANAGER_DIRECTORY_NAME);
+ }
+
+ static String getSDKDataPath() {
+ if (Config.getInstance().getSdkDataDir() == "") {
+ if (Platform.isLinux() || Platform.isMacOS()) {
+ return PathUtil.getFromHome(SDK_DATA_DIR_NAME);
+ } else if (Platform.isWindows()) {
+ return WINDOWS_DEFAULT_DATA_PATH;
+ } else {
+ throw new IMFatalException(ErrorCode.UNSUPPORTED_PLATFORM);
+ }
+ } else {
+ return Config.getInstance().getSdkDataDir();
+ }
+ }
+
static String getIntallManagerShortcutImageName() {
if (Platform.isLinux()) {
return "tizen-sdk-installmanager.png";
if (!executeInstallScript(pack, monitor, tempDir)) {
Log.err("Fail to execute install script.");
- throw new IMFatalException(ErrorCode.INSTALL_SCRIPT_FATAL_ERROR);
+ throw new IMFatalException(ErrorController.getMessage(ErrorCode.INSTALL_SCRIPT_FATAL_ERROR)
+ + " (" + pack + " package)");
}
if (!moveRemoveScript(tempDir, pack)) {
return true;
}
- private boolean moveInstallScript(String tempDir, Package pack) {
- // move removeScript file to special Directory
- File installScriptFrom = new File(tempDir + File.separator
- + pack.getInstallScript());
-
- if ((pack.getInstallScript() != null)
- && !(pack.getInstallScript().equals(""))
- && (installScriptFrom.exists())) {
- File installScriptTo = new File(getInstallScriptLocalPath(pack));
- if (!createInstallScriptDir(installScriptTo)) {
- Log.err("Cannot create install script directory in Info directory => "
- + pack.getPackageName());
- return false;
- } else {
- if (installScriptTo.exists()) {
- if (!installScriptTo.delete()) {
- Log.err("Fail to delete file ==> " + installScriptTo);
- }
- }
- if (!PathUtil.moveFile(installScriptFrom, installScriptTo)) {
- Log.err("Cannot move install Script to targetDir => "
- + pack.getPackageName());
- return false;
- }
- }
- }
- return true;
- }
+// private boolean moveInstallScript(String tempDir, Package pack) {
+// // move removeScript file to special Directory
+// File installScriptFrom = new File(tempDir + File.separator
+// + pack.getInstallScript());
+//
+// if ((pack.getInstallScript() != null)
+// && !(pack.getInstallScript().equals(""))
+// && (installScriptFrom.exists())) {
+// File installScriptTo = new File(getInstallScriptLocalPath(pack));
+// if (!createInstallScriptDir(installScriptTo)) {
+// Log.err("Cannot create install script directory in Info directory => "
+// + pack.getPackageName());
+// return false;
+// } else {
+// if (installScriptTo.exists()) {
+// if (!installScriptTo.delete()) {
+// Log.err("Fail to delete file ==> " + installScriptTo);
+// }
+// }
+// if (!PathUtil.moveFile(installScriptFrom, installScriptTo)) {
+// Log.err("Cannot move install Script to targetDir => "
+// + pack.getPackageName());
+// return false;
+// }
+// }
+// }
+// return true;
+// }
/**
* @param pack
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());
String installedFileListPath = getInstalledFileListPath(pkg);
format.setFileOutput(installedFileListPath);
-
+
return format.unZip(filePath, tempDir, monitor);
}
PathUtil.getFromInstalledPath(Config.INFO_DIRECTORY),
pkg.getPackageName(), pkg.getRemoveScript());
}
-
- private String getInstallScriptLocalPath(Package pkg) {
- return PathUtil.get(
- PathUtil.getFromInstalledPath(Config.INFO_DIRECTORY),
- pkg.getPackageName(), pkg.getInstallScript());
- }
private String getInstalledFileListPath(Package pkg) {
return PathUtil.get(
return true;
}
}
-
- private boolean createInstallScriptDir(File installScript) {
- File parentDir = installScript.getParentFile();
-
- if (!parentDir.exists()) {
- return parentDir.mkdirs();
- } else {
- return true;
- }
- }
private boolean executeInstallScript(Package pack,
IIMProgressMonitor monitor, String tempDir) {
return executeScript(scriptFile);
} catch (IMShellCommandFail e) {
Log.ExceptionLog(e);
- throw new IMFatalException(
- ErrorCode.INSTALL_SCRIPT_FATAL_ERROR);
+ throw new IMFatalException(ErrorController.getMessage(ErrorCode.INSTALL_SCRIPT_FATAL_ERROR)
+ + " (" + pack + " package)");
}
} else {
Log.log(pack.getPackageName() + " does not have install script");
}
} catch (IMShellCommandFail e) {
Log.ExceptionLog(e);
- throw new IMFatalException(ErrorCode.REMOVE_SCRIPT_FATAL_ERROR);
+ throw new IMFatalException(ErrorController.getMessage(ErrorCode.REMOVE_SCRIPT_FATAL_ERROR)
+ + " (" + pkg + " package)");
}
}
return 2; // package does not need remove script.
// check exit code
if (exitCode == 0) {
return true;
- } else if (exitCode == 1) {
- Log.err("Exit code => " + Integer.toString(exitCode));
- return false;
- } else if (exitCode == 2) {
+ } else if (exitCode == 1 || exitCode == 2) {
Log.err("Exit code => " + Integer.toString(exitCode));
return false;
} else if (exitCode == 99) {
Log.err("Installer.executeScript() install script error => "
+ scriptFile.getAbsolutePath());
Log.err("Exit code => " + Integer.toString(exitCode));
- throw new IMFatalException(ErrorCode.SCRIPT_FATAL_ERROR);
+ throw new IMFatalException(ErrorController.getMessage(ErrorCode.SCRIPT_FATAL_ERROR)
+ + " (" + scriptFile.getParentFile().getName() + " package)");
}
}
}
public class OptionConstant {
//Option naming
public final static String OPTION_DISTRIBUTION = "-distribution";
+ public final static String OPTION_INIT_TEST = "-initTest";
+ public final static String OPTION_TEST = "-test";
//Option error message
public final static String MSG_DISTRIBUTION_NOT_PROVIDED = "Distribution setting is missing. Use the '-distribution <distribution>' option.";
public static boolean doPackageValidation = true;
/**
- * Do auto install without GUI
- */
- public static boolean doInstallNoUI = false;
- public static boolean doRemoveNoUI = false;
- public static boolean doUpdateNoUI = false;
- public static boolean doShowDistListNoUI = false;
- public static boolean doShowPackageListNoUI = false;
- public static boolean doShowSDKInstallStatus = false;
- public static boolean doShowHelp = false;
-
- /**
* Do download package file.
*/
public static boolean onlyDownload = false;
public static boolean printDepGraph = false;
/**
+ * start installmanager test
+ */
+ public static boolean doTest = false;
+
+ /**
* Use Snapshot file.
*/
public static boolean snapshot = false;
/**
- * Use cli mode
- */
+ * Do auto install or uninstall without GUI
+ */
+ public static boolean doInstallNoUI = false;
+ public static boolean doRemoveNoUI = false;
+ public static boolean doUpdateNoUI = false;
+ public static boolean doShowDistListNoUI = false;
+ public static boolean doShowPackageListNoUI = false;
+ public static boolean doShowSDKInstallStatus = false;
+ public static boolean doShowHelp = false;
+
public static String repository = null;
public static String imageFilePath = null;
public static String snapshotPath = null;
public static List<String> packages = new ArrayList<String>();
public static List<String> skipPackages = new ArrayList<String>();
+ public static boolean isAgreeLicense = false;
+
/**
* Use only download for making SDK image.
*/
executablePath = iter.next();
Log.log("executable path : " + executablePath);
}
+ } else if (arg.equals(OptionConstant.OPTION_TEST)) {
+ doTest = true;
} else if (arg.equals("-install")) {
if (iter.hasNext()) {
doInstallNoUI = true;
}
}
+ // set license agreement
+ if (doInstallNoUI) {
+ argIter = argArray.iterator();
+ while (argIter.hasNext()) {
+ if (argIter.next().equalsIgnoreCase("-accept_license")) {
+ argIter.remove();
+ isAgreeLicense = true;
+ }
+ }
+ }
+
+ // set sdk data directory
argIter = argArray.iterator();
while (argIter.hasNext()) {
if (argIter.next().equalsIgnoreCase("-w")) {
}
}
+ // set test
+ argIter = argArray.iterator();
+ while (argIter.hasNext()) {
+ if (argIter.next().equalsIgnoreCase("-test")) {
+ argIter.remove();
+ Options.doTest = true;
+ Log.log("Set to test working performance.");
+ }
+ }
+
argIter = argArray.iterator();
while (argIter.hasNext()) {
if (argIter.next().equalsIgnoreCase("-ni")) {
if (Platform.isLinux()) {
argIter = argArray.iterator();
while (argIter.hasNext()) {
- if (!argIter.next().equalsIgnoreCase("-passwd")) {
- throw new IMFatalException(ErrorCode.WRONG_OPTION);
- } else {
+ if (argIter.next().equalsIgnoreCase("-passwd")) {
argIter.remove();
if (argIter.hasNext()) {
suPass = argIter.next();
}
}
}
+ if (suPass == "") {
+ throw new IMFatalException(ErrorCode.WRONG_OPTION);
+ }
} else if (Platform.isWindows()) {
interactive = true;
} else if (Platform.isMacOS()) {
package org.tizen.installmanager.core;
+import java.io.BufferedWriter;
+import java.io.File;
+import java.io.FileWriter;
+import java.io.IOException;
+import java.text.SimpleDateFormat;
import java.util.Date;
import org.tizen.installmanager.lib.Log;
+import org.tizen.installmanager.util.PathUtil;
public class Performance {
+ //total time
private static Date imStartTime = null;
private static Date imEndTime = null;
+
+ //initialize time
+ private static Date initializeStartTime = null;
+ private static Date initializeEndTime = null;
+
+ //download time
+ private static Date downloadStartTime = null;
+ private static Date downloadEndTime = null;
+
+
+ //installation time
private static Date installationStartTime = null;
private static Date installationEndTime = null;
+ //removal time
+ private static Date removalStartTime = null;
+ private static Date removalEndTime = null;
+
+ //information
+ public static long sdkPackageSize = 0;
+
+
public static void setIMStartTime() {
imStartTime = new Date();
}
imEndTime = new Date();
}
+ public static void setInitializeStartTime() {
+ initializeStartTime = new Date();
+ }
+
+ public static void setInitializeEndTime() {
+ initializeEndTime = new Date();
+ }
+
+ public static void setDownloadStartTime() {
+ downloadStartTime = new Date();
+ }
+
+ public static void setDownloadEndTime() {
+ downloadEndTime = new Date();
+ }
+
public static void setInstallationStartTime() {
installationStartTime = new Date();
}
installationEndTime = new Date();
}
+ public static void setRemovalStartTime() {
+ removalStartTime = new Date();
+ }
+
+ public static void setRemovalEndTime() {
+ removalEndTime = new Date();
+ }
+
public static void printToLogFile() {
Log.log("The installmanager start time : " + imStartTime);
Log.log("The installmanager end time : " + imEndTime);
Log.log("The installation start time : " + installationStartTime);
Log.log("The installation end time : " + installationEndTime);
- long progressSecond = getProgressTimeOfInstallation()/1000;
+ long progressSecond = getInstallationTime()/1000;
if (progressSecond >= 0) {
Log.log("The progress time of the installation : About " + progressSecond/60 + " minutes"
}
}
- private static long getProgressTimeOfInstallation() {
+ public static void printTestResult() {
+ //get file name of test result
+ SimpleDateFormat formatter = new SimpleDateFormat("yyyyMMddHHmmss");
+ String testFileName = formatter.format(imStartTime) + ".txt";
+
+ String testResultFilePath = PathUtil.get(InstallManagerConstants.getInstallManagerTestResultPath(), testFileName);
+ File testResultFile = new File(testResultFilePath);
+
+ if (!testResultFile.getParentFile().exists()) {
+ testResultFile.getParentFile().mkdirs();
+ }
+
+ BufferedWriter out = null;
+ try {
+ out = new BufferedWriter(new FileWriter(testResultFile));
+
+ out.write("*** InstallManager performance test ***");
+ out.newLine();
+ out.write("Sdk package size\t: " + sdkPackageSize);
+ out.newLine();
+ out.write("The initialization time\t: " + getInitializeTime() + "sec");
+ out.write("(" + getBitPerSecond(sdkPackageSize, getInitializeTime())+ "b/s)");
+ out.newLine();
+ out.write("The download time\t: " + getDownloadTime() + "sec");
+ out.write("(" + getBitPerSecond(sdkPackageSize, getDownloadTime())+ "b/s)");
+ out.newLine();
+ out.write("The installation time\t: " + getInstallationTime() + "sec");
+ out.write("(" + getBitPerSecond(sdkPackageSize, getInstallationTime())+ "b/s)");
+ out.newLine();
+ out.write("The removal time\t: " + getRemovalTime() + "sec");
+ out.write("(" + getBitPerSecond(sdkPackageSize, getRemovalTime())+ "b/s)");
+ out.newLine();
+ out.write("The install-manager start time\t: " + imStartTime);
+ out.newLine();
+ out.write("The install-manager end time\t: " + imEndTime);
+ out.newLine();
+ out.newLine();
+
+ long progressSecond = getTotalTime();
+
+ if (progressSecond >= 0) {
+ out.write("* Total time to install : About " + progressSecond/60 + " minutes"
+ +"(" + progressSecond + " seconds)");
+ out.newLine();
+ } else {
+ out.write("* Total time to install : Installation fail");
+ out.newLine();
+ }
+
+ } catch (IOException e) {
+ Log.ExceptionLog(e);
+ } finally {
+ if (out != null) {
+ try {
+ out.close();
+ } catch (IOException e) {
+ Log.ExceptionLog(e);
+ }
+ }
+ }
+ }
+
+ public static void printTestResultXmlFormat() {
+ //get file name of test result
+ SimpleDateFormat formatter = new SimpleDateFormat("yyyyMMddHHmmss");
+ String testFileName = formatter.format(imStartTime) + ".xml";
+
+ String testResultFilePath = PathUtil.get(InstallManagerConstants.getInstallManagerTestResultPath(), testFileName);
+ File testResultFile = new File(testResultFilePath);
+
+ if (!testResultFile.getParentFile().exists()) {
+ testResultFile.getParentFile().mkdirs();
+ }
+
+ BufferedWriter out = null;
+ try {
+ out = new BufferedWriter(new FileWriter(testResultFile));
+ out.write(getTestSuiteXml("InstallManager performance test", 4, getTotalTime()));
+ out.newLine();
+ out.write(getTestCaseXml("InitTest", "The initialization time", getInitializeTime()));
+ out.newLine();
+ out.write(getTestCaseXml("DownloadTest", "The download time", getDownloadTime()));
+ out.newLine();
+ out.write(getTestCaseXml("InstallTest", "The installation time", getInstallationTime()));
+ out.newLine();
+ out.write(getTestCaseXml("RemoveTest", "The removal time", getRemovalTime()));
+ out.newLine();
+ out.write("</testsuite>");
+ } catch (IOException e) {
+ Log.ExceptionLog(e);
+ } finally {
+ if (out != null) {
+ try {
+ out.close();
+ } catch (IOException e) {
+ Log.ExceptionLog(e);
+ }
+ }
+ }
+ }
+
+ private static String getTestSuiteXml(String testName, int testNum, long time) {
+ return "<testsuite errors=\"\" failures=\"\" name=\"" + testName + "\" skips=\"\" tests=\"" + testNum +"\" time=\""+ time +"\">";
+ }
+
+ private static String getTestCaseXml(String testClass, String testName, long time) {
+ return "<testcase classname=\"" + testClass + "\" name=\"" + testName + "\" time=\"" + time +"\"/>";
+ }
+
+ private static long getInitializeTime() {
+ if (initializeStartTime == null || initializeEndTime == null) {
+ return 0;
+ }
+
+ long interval = (initializeEndTime.getTime() - initializeStartTime.getTime())/1000;
+ return interval;
+ }
+
+ private static long getDownloadTime() {
+ if (downloadStartTime == null || downloadEndTime == null) {
+ return 0;
+ }
+
+ long interval = (downloadEndTime.getTime() - downloadStartTime.getTime())/1000;
+ return interval;
+ }
+
+ private static long getTotalTime() {
+ if (imStartTime == null || imEndTime == null) {
+ return 0;
+ }
+
+ long interval = (imEndTime.getTime() - imStartTime.getTime())/1000;
+ return interval;
+ }
+
+ private static long getInstallationTime() {
if (installationStartTime == null || installationEndTime == null) {
- return -1;
+ return 0;
+ }
+
+ long interval = (installationEndTime.getTime() - installationStartTime.getTime())/1000;
+ return interval;
+ }
+
+ private static long getRemovalTime() {
+ if (removalStartTime == null || removalEndTime == null) {
+ return 0;
}
- long interval = installationEndTime.getTime() - installationStartTime.getTime();
+ long interval = (removalEndTime.getTime() - removalStartTime.getTime())/1000;
return interval;
}
+
+ private static long getBitPerSecond(long size, long seconds) {
+ if (seconds == 0) {
+ return 0;
+ } else {
+ return size/seconds;
+ }
+ }
}
OLD_TIZEN_SDK_EXISTS("Old Tizen SDK is installed. Remove the old SDK and run the Tizen SDK Install Manager again."),
UNSUPPORTED_PLATFORM("Platform not supported."),
REMOVE_SCRIPT_NOT_EXISTS("Removal script not found."),
- REMOVE_SCRIPT_FATAL_ERROR("Fatal error occurred while uninstalling the Tizen SDK."),
+ REMOVE_SCRIPT_FATAL_ERROR("Fatal error occurred while executing remove script."),
INSTALLATION_FAIL("Installation failed."),
INSTALL_CANCELED("Installation canceled."),
INSTALLED_VERSION_IS_HIGH("Installation progress failed due to high installed package version."),
PACKAGE_WRONG_CHECKSUM("Package file checksum error."),
PACKAGE_NOT_EXIST_TO_INSTALL_OR_UNINSTALL("Install or uninstall package not found."),
INSTALL_SCRIPT_NOT_EXISTS("Install script files not found."),
- INSTALL_SCRIPT_FATAL_ERROR("Fatal error occurred while installing the Tizen SDK."),
+ INSTALL_SCRIPT_FATAL_ERROR("Fatal error occurred while executing install script."),
SCRIPT_FATAL_ERROR("Fatal error occurred while executing post script."),
// Network error
private static final String REGISTRY_SEPERATOR = "=";
public static String targetPath = "";
- public static String sdkWorkSpacePath = "";
+ public static String sdkDataPath = "";
+// public static String sdkDataPath = getSDKinfoBySDKPath(Config.getInstance().getTargetDir());
private static ArrayList<String> sdkPathList = getSDKPath();
/**
}
}
+ /**
+ * @return path in which SDK is installed. empty string if not found.
+ */
+ public static String getSdkDataPath() {
+ return getPathFromRegistryKey(PathUtil.get(Registry.getInstalledPath(),
+ InstallManagerConstants.SDK_INFORMATION_FILE_NAME)
+ , SDK_DATA_PATH_KEY);
+ }
+
public static String getOldInstalledPath() {
return getPathFromRegistryKey(OLD_REGISTRY_FILE_PATH, INSTALLED_PATH_KEY);
}
/**
* When installmanager updates SDK, installmanager have to know sdk information from sdk.info file.
* @param sdkPath
+ * @return
*/
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 {
try {
if (checkExtension == PackageType.ZIP) {
- exitValue = sendCommand( "unzip -ao "+ fileFullPath.getAbsolutePath() + " -d " + targetDir.getAbsolutePath(),
+ exitValue = sendCommand( "unzip -o "+ fileFullPath.getAbsolutePath() + " -d " + targetDir.getAbsolutePath(),
fileFullPath.getAbsolutePath(), PackageType.ZIP, monitor);
unzipReturnValue(exitValue);
} else if (checkExtension == PackageType.TAR_GZ) {
--- /dev/null
+package org.tizen.installmanager.lib.mac;
+
+import java.lang.reflect.InvocationTargetException;
+
+public class CocoaUtil {
+ private static final long aboutMenuValue = 0;
+ private static final long prefMenuValue = 2;
+ public static final String NSApplication_CLASS = "org.eclipse.swt.internal.cocoa.NSApplication";
+ public static final String NSMenu_CLASS = "org.eclipse.swt.internal.cocoa.NSMenu";
+ public static final String NSMenuItem_CLASS = "org.eclipse.swt.internal.cocoa.NSMenuItem";
+
+ public static Object invokeMethod(Class<?> clazz, Object object, String method, Object[] args)
+ throws IllegalArgumentException, IllegalAccessException, InvocationTargetException,
+ SecurityException, NoSuchMethodException {
+ Class<?>[] signature = new Class[args.length];
+ for (int i = 0; i < args.length; i++) {
+ Class<?> thisClass = args[i].getClass();
+ if (thisClass == Integer.class) {
+ signature[i] = int.class;
+ } else if (thisClass == Long.class) {
+ signature[i] = long.class;
+ }else if (thisClass == Byte.class) {
+ signature[i] = byte.class;
+ } else if ( thisClass == Boolean.class ){
+ signature[i] = boolean.class;
+ } else {
+ signature[i] = thisClass;
+ }
+ }
+ return clazz.getDeclaredMethod(method, signature).invoke(object, args);
+ }
+
+ // remove about and preference menu item
+ public void removeTopMenuItems() {
+ try {
+ Class<?> nsmenuClass = Class.forName(NSMenu_CLASS);
+ Class<?> nsmenuitemClass = Class.forName(NSMenuItem_CLASS);
+ Class<?> nsapplicationClass = Class.forName(NSApplication_CLASS);
+
+ Object sharedApplication = nsapplicationClass.getDeclaredMethod(
+ "sharedApplication", (Class<?>[]) null).invoke(null, (Object[]) null);
+ Object mainMenu = sharedApplication.getClass()
+ .getDeclaredMethod("mainMenu", (Class<?>[]) null)
+ .invoke(sharedApplication, (Object[]) null);
+
+ Object mainMenuItem = invokeMethod(nsmenuClass, mainMenu,
+ "itemAtIndex", new Object[] { new Long(0) });
+ Object appMenu = mainMenuItem.getClass()
+ .getDeclaredMethod("submenu", (Class<?>[]) null)
+ .invoke(mainMenuItem, (Object[]) null);
+
+ Object aboutMenuItem = invokeMethod(nsmenuClass, appMenu,
+ "itemAtIndex", new Object[] { new Long(aboutMenuValue) });
+ Object prefMenuItem = invokeMethod(nsmenuClass, appMenu,
+ "itemAtIndex", new Object[] { new Long(prefMenuValue) });
+ //set hidden
+ invokeMethod(nsmenuitemClass, aboutMenuItem, "setHidden",
+ new Object[] { new Boolean(true) });
+ invokeMethod(nsmenuitemClass, prefMenuItem, "setHidden",
+ new Object[] { new Boolean(true) });
+
+ } catch (ClassNotFoundException e) {
+ e.printStackTrace();
+ } catch (IllegalArgumentException e) {
+ e.printStackTrace();
+ } catch (SecurityException e) {
+ e.printStackTrace();
+ } catch (IllegalAccessException e) {
+ e.printStackTrace();
+ } catch (InvocationTargetException e) {
+ e.printStackTrace();
+ } catch (NoSuchMethodException e) {
+ e.printStackTrace();
+ }
+ }
+}
+
import java.util.zip.ZipInputStream;
import org.tizen.installmanager.core.IMFatalException;
+import org.tizen.installmanager.lib.ErrorController;
import org.tizen.installmanager.lib.IIMProgressMonitor;
import org.tizen.installmanager.lib.Log;
import org.tizen.installmanager.lib.SDKPackageFormat;
}
}
- unZipPackage(fileFullPath, targetDir, monitor);
+ long ret = unZipPackage(fileFullPath, targetDir, monitor);
closeFileOutput();
- return SUCCESS;
+ return ret;
}
private long unZipPackage(File fileFullPath, File targetDir, IIMProgressMonitor monitor) {
while ((readByte = zipInStream.read(zipBuf)) >= 0) {
zipOutput.write(zipBuf, 0, readByte);
- zipOutput.flush();
totalUnZipSize += readByte;
}
writeFileList(zipEntry.getName());
-// File outFile = new File(targetPath);
-//
-// if (outFile.isFile()
-// && (PathUtil.getFileExtension(outFile.getName())
-// .equals("") || PathUtil.getFileExtension(
-// outFile.getName()).equals("sh"))) {
-// outFile.setExecutable(true);
-// }
-
if (zipOutput != null) {
zipOutput.close();
}
if (zipEntry != null) {
Log.err("Fail to unpack " + zipEntry.getName());
}
-
- throw new IMFatalException(ErrorCode.CANNOT_UNPACK_PACKAGE);
+
+ return ERROR;
} catch (Throwable e) {
Log.ExceptionLog(e);
- throw new IMFatalException(e.getMessage());
+ return ERROR;
} finally {
try {
if (zipOutput != null) {
+ zipOutput.flush();
zipOutput.close();
}
} catch (IOException e) {
import org.tizen.installmanager.pkg.model.PropertySection;
import org.tizen.installmanager.pkg.model.Snapshot;
import org.tizen.installmanager.pkg.model.Version;
-import org.tizen.installmanager.ui.page.ViewController;
import org.tizen.installmanager.util.PathUtil;
private void setExtensionPackages(HashMap<String,List<PropertySection>> repoToSectionsMap) {
extensionPackages = new PackageSet();
- setPackages(extensionPackages, repoToSectionsMap, true);
+ boolean result = setPackages(extensionPackages, repoToSectionsMap, true);
+ if (!result) {
+ Log.err("Cannot find extension repository.");
+ }
}
private void addExtraMetaPackage() {
props.add(new Property(Package.FIELD_PACKAGE, "EXTRAS"));
props.add(new Property(Package.FIELD_LABEL, "Extras"));
props.add(new Property(Package.FIELD_ATTRIBUTE, "root"));
+ props.add(new Property(Package.FIELD_PACKAGE_SIZE, "0"));
props.add(new Property(Package.FIELD_UNCOMPRESSED_SIZE, "0"));
Package extraPackage = new Package(props);
*/
protected void setRepoPackages( Map<String,List<PropertySection>> repoToSectionsMap) {
repoPackages = new PackageSet();
- setPackages(repoPackages, repoToSectionsMap, false);
+ boolean result = setPackages(repoPackages, repoToSectionsMap, false);
+
+ if (!result) {
+ Log.err("Cannot find repository. Please check your repository.");
+ ErrorController.setError(ErrorCode.CANNOT_FIND_REPOSITORY);
+ }
}
/**
* @param destPackages It is set of packages.
* @param repoToSectionsMap It is added to <code>destPackages</code>
*/
- private void setPackages(PackageSet destPackages, Map<String,List<PropertySection>> repoToSectionsMap, boolean isExtensionPackage) {
+ private boolean setPackages(PackageSet destPackages, Map<String,List<PropertySection>> repoToSectionsMap, boolean isExtensionPackage) {
if (destPackages == null) {
destPackages = new PackageSet();
}
if (repoToSectionsMap == null || repoToSectionsMap.isEmpty()) {
- ErrorController.setError(ErrorCode.CANNOT_FIND_REPOSITORY);
- return;
+ return false;
}
for(String repoBaseUrl : repoToSectionsMap.keySet()) {
for(PropertySection sect : repoToSectionsMap.get(repoBaseUrl)) {
Package pkg = new Package(sect.getProperties(), repoBaseUrl);
+ Log.log("Check valid package version. => " + pkg);
pkg.getVersion(); // Vaild version check.
if (isExtensionPackage) {
if (pkg.getAttribute().equalsIgnoreCase("extra")) {
}
}
}
+
+ return true;
}
/**
for(Package ip : installedPackages) {
if(repoPackages != null && repoPackages.contains(ip)) {
Package rp = repoPackages.getPackage(ip);
+ Log.log("Repo packages : " + repoPackages);
if(ip.getVersion().compareTo(rp.getVersion()) > 0) {
recentPackages.add(ip);
} else {
private PackageSet rootMeta(PackageSet pset) {
PackageSet metas = new PackageSet();
for(Package p : pset) {
- if(p.isRootMeta() || p.isPartnerMeta() || p.isExtraMeta() || p.isPublicMeta()) {
- metas.add(p);
+ if (!Options.doTest) {
+ if(p.isRootMeta() || p.isExtraMeta() || p.isPublicMeta()) {
+ metas.add(p);
+ }
+ } else {
+ if(p.isRootMeta() || p.isExtraMeta() || p.isPublicMeta() || p.isTestMeta()) {
+ metas.add(p);
+ }
}
}
return metas;
mProperties = new Properties();
if (!loadConfigFile()) {
Log.err("Fail to load installmanager.cfg file");
- ErrorController.setError(ErrorCode.CANNOT_FIND_CONFIG_FILE);
} else {
Log.log("Success to load installmanager.cfg file");
}
private static final String ATTRIBUTE_ROOT_META = "root";
private static final String ATTRIBUTE_EXTRA_META = "extra";
private static final String ATTRIBUTE_INSTALL_META = "install";
+ private static final String ATTRIBUTE_TEST_META = "test";
private static final String ATTRIBUTE_MANDATORY = "mandatory";
private static final String ATTRIBUTE_PARTNER = "partner";
private static final String ATTRIBUTE_PUBLIC = "public";
-
+
//dependency information
private static final String START_OF_OS_DEPENDENCY = "[";
throw new IMFatalException(ErrorCode.WRONG_PACKAGE_URL);
}
}
+
+ public void setProperties(List<Property> properties) {
+ mProperties = properties;
+ }
/**
- * @return version of this package
+ * @return version of this package. If package does not have version, set version to 0.0.0
*/
public Version getVersion() {
- return new Version(getValue(FIELD_VERSION));
+ String version = getValue(FIELD_VERSION);
+ if (version == null || version.isEmpty()) {
+ List<Property> props = this.getProperties();
+ for (Property p : props) {
+ if (p.getName().equalsIgnoreCase(Package.FIELD_VERSION)) {
+ p.setValue("0.0.0");
+ }
+ }
+ }
+ return new Version(getValue(FIELD_VERSION));
}
/**
}
}
- if (!Options.partnerSdk) { // public download case
- if (isRootMeta() || isInstallMeta() || isExtraMeta() || isMandatory() || isPublicMeta()) {
+ if (Options.doTest) { // include test packages for SDK testing
+ if (isRootMeta() || isInstallMeta() || isExtraMeta() || isMandatory() || isPublicMeta() || isTestMeta()) {
return true;
} else {
return false;
}
- } else { // partner download case
- if (isRootMeta() || isInstallMeta() || isExtraMeta() || isMandatory() || isPartnerMeta()) {
+ } else { // except test packages for normal SDK.
+ if (isRootMeta() || isInstallMeta() || isExtraMeta() || isMandatory() || isPublicMeta()) {
return true;
} else {
return false;
}
/**
+ * @return <code>true</code> if this meta package is a install meta package.
+ */
+ public boolean isTestMeta() {
+ String attributeValue = getAttribute().trim();
+
+ if (attributeValue.equalsIgnoreCase(ATTRIBUTE_TEST_META)) {
+ return true;
+ } else {
+ return false;
+ }
+ }
+
+ /**
* @return <code>true</code>, if this package is a mandatory package. This package must install.
*/
public boolean isMandatory() {
package org.tizen.installmanager.pkg.model;
import org.tizen.installmanager.core.IMFatalException;
+import org.tizen.installmanager.core.Options;
import org.tizen.installmanager.lib.Log;
import org.tizen.installmanager.lib.ErrorController.ErrorCode;
* @param version string representation of version
*/
public Version(String version) {
- checkValidVersion(version);
- dividedVersion = version.split("\\.");
- }
-
- public static void checkValidVersion(String version) {
- if (version == null || version.isEmpty()) {
- Log.err("Package version not found. ==> ");
- throw new IMFatalException(ErrorCode.CANNOT_FIND_PACKAGE_VERSION);
- } else if (version.endsWith(".")){
- Log.err("Invalid package version : " + version);
- throw new IMFatalException(ErrorCode.INVALID_PACKAGE_VERSION);
+ if (version.endsWith(".")){
+ Log.err("Invalid package version format : " + version);
}
+
+ dividedVersion = version.split("\\.");
}
public static Version create(String aVersion) {
String[] fixedVersion = null;
if (v1Length != v2Length) {// Just in case, both version1's frame and version2's frame are different.
+ Log.log("Version lengths are different.");
+ versionLogging(v1, "Version 1 : ");
+ versionLogging(v2, "Version 2 : ");
+
if (v1Length > v2Length) {
fixedVersion = setVersionFrame(v2, v1Length);
repeat = v1Length;
for (int i = 0; i < repeat; i++) {
- result = compareVersionComponent(Integer.parseInt(v1[i]), Integer.parseInt(fixedVersion[i]));
+ int v1ToInt = -1;
+ int fixedVersionToInt = -1;
+ try {
+ v1ToInt = Integer.parseInt(v1[i]);
+ } catch (NumberFormatException e) {
+ versionLogging(v1, "Cannot convert to integer(Version 1) : ");
+ Log.ExceptionLog(e);
+ }
+
+ try {
+ fixedVersionToInt = Integer.parseInt(fixedVersion[i]);
+ } catch (NumberFormatException e) {
+ versionLogging(v2, "Cannot convert to integer(fixedVersion) : ");
+ if (Options.isNetwork || Options.doInstallNoUI) {
+ Log.ExceptionLog(e);
+ }
+ }
+
+ result = compareVersionComponent(v1ToInt, fixedVersionToInt);
+
if (result != Version.EQ) {
break;
}
return result;
}
+ private static void versionLogging(String[] version, String comment) {
+ String tmp = "";
+ int length = version.length;
+ for (int i = 0; i < length; i++) {
+ if (i == length - 1) {
+ tmp += version[i];
+ } else {
+ tmp += version[i] + ".";
+ }
+ }
+
+ Log.log(comment + tmp);
+ }
+
/**
* When versions' frame are different, each frames must be same.
* @param version
import org.tizen.installmanager.lib.ProgramController;
import org.tizen.installmanager.lib.Registry;
import org.tizen.installmanager.lib.exception.IMNetworkException;
+import org.tizen.installmanager.lib.mac.CocoaUtil;
import org.tizen.installmanager.pkg.lib.PackageManager;
import org.tizen.installmanager.pkg.model.ConfigFile;
import org.tizen.installmanager.pkg.model.PackageSet;
import org.tizen.installmanager.ui.page.InstallingPage.InstallProgressMonitor;
import org.tizen.installmanager.ui.page.WelcomePage.RADIO_ACTION;
import org.tizen.installmanager.util.PathUtil;
+import org.tizen.installmanager.pkg.model.Package;
/**
addExtraButton.setVisible(false);
btnSettings.setVisible(false);
if (compositeWelcomePage.getSelectedRadioButton() == RADIO_ACTION.INSTALL) {
+ if (!checkVaildPkgVersion()) {
+ btnSettings.setVisible(true);
+ return;
+ }
btnNext.setEnabled(compositeLicensePage.getAcceptButton().getSelection());
if (Config.isSupportMultiSDK()) {
showComposite(compositeLicensePage);
boolean installable = compositeSetInstallDirectoryPage.isInstallablePath();
Config.USER_CONFIG_HOME_PATH = compositeSetInstallDirectoryPage.getSDKWorkSpacePath();
- Registry.sdkWorkSpacePath = controller.getSDKWorkSpacePath();
+ Registry.sdkDataPath = controller.getSDKWorkSpacePath();
Registry.targetPath = controller.getInstallPath();
Registry.saveSDKInfo(Registry.targetPath);
* @param args
*/
public static void main(String args[]) {
+ //performance measurement
Performance.setIMStartTime();
+
InstallManager.deleteTempFile();
Log.open();
Log.log("Fail to command line install.");
System.out.println("Fail to console install.");
}
+
+ Performance.setIMEndTime();
+ if (Options.doTest) {
+ Performance.printTestResultXmlFormat();
+ }
+
System.exit(0);
} else if (Options.doRemoveNoUI) {
if (InstallManagerNoUI.cliUninstall(Options.packages)) {
Log.log("Fail to command line remove.");
System.out.println("Fail to remove.");
}
+
+ Performance.setIMEndTime();
+ if (Options.doTest) {
+ Performance.printTestResult();
+ }
+
System.exit(0);
} else if (Options.showVersion) {
showInstallManagerVersion();
System.exit(0);
}
+ if (Platform.isMacOS()) {
+ System.setProperty("apple.laf.useScreenMenuBar", "true");
+ System.setProperty(
+ "com.apple.mrj.application.apple.menu.about.name",
+ "Emulator Manager");
+ Display display = Display.getDefault();
+ display.syncExec(new Runnable() {
+ @Override
+ public void run() {
+ new CocoaUtil().removeTopMenuItems();
+ }
+ });
+ }
+
window = new InstallManagerWindow();
window.setBlockOnOpen(true);
ProgramController.createProgramController().removeSDKTempDir();
}
+ //performance measurement
Performance.setIMEndTime();
Performance.printToLogFile();
+ if (Options.doTest) {
+ Performance.printTestResultXmlFormat();
+ }
+
Log.LogTitle("Installmanager finish");
Log.close();
}
/**
+ * Installed packages do not have package version, installmanager will show warning dialog.
+ * @return
+ */
+ private boolean checkVaildPkgVersion() {
+ PackageSet installedPkgs = controller.getInstalledPackages();
+ if (!installedPkgs.isEmpty()) {
+ for (Package pkg : installedPkgs) {
+ String vs = pkg.getVersion().toString();
+ if (vs != "" && vs.equals("0.0.0")) {
+ Log.err("Package version not found. ==> " + pkg.getPackageName());
+ int confirm = MessageBoxDlg.showDlg(getShell(),
+ "WARNING",
+ "'" + pkg.getPackageName() + "'" + " package version is not found.\n" +
+ "If you keep installing Tizen SDK, some unexpected may occur.\n" +
+ "Do you want to continue?",
+ DialogType.WARNING, false);
+ if (confirm == MessageBoxDlg.YES) {
+ return true;
+ } else {
+ return false;
+ }
+ }
+ }
+ }
+
+ return true;
+ }
+
+ /**
* Get install manager window object.
* @return install manager window object.
*/
public class Item implements Comparable<Item> {
private Package latestPackage;
private Package installedPackage;
- private Item parent;
+ private Item parent = null;
private ArrayList<Item> children;
private CheckState checkState= CheckState.UNCHECKED;
private InstallState installState = InstallState.INSTALL;
* @param CHECKED is true, this package is selected by tree view.
*/
public void setCheckState(CheckState state) {
+
this.checkState = state;
}
*/
public void setStateByChildren() {
setCheckStateByChildren(this);
- setInstallStateByChildren(this);
+// setInstallStateByChildren(this);
}
private void setCheckStateByChildren(Item parentItem) {
- if (!parentItem.hasChildren()) {
- return;
- } else {
- for (Item item : parentItem.getChildren()) {
- setCheckStateByChildren(item);
+ if (parentItem.hasChildren()) {
+ for (Item childItem : parentItem.getChildren()) {
+ setCheckStateByChildren(childItem);
}
if (parentItem.isChildrenAllChecked()) {
} else {
parentItem.setCheckState(CheckState.GRAYED);
}
- }
- }
-
- private void setInstallStateByChildren(Item parentItem) {
- if (!parentItem.hasChildren()) {
- return;
} else {
- for (Item item : parentItem.getChildren()) {
- setInstallStateByChildren(item);
- }
-
- if (parentItem.isChildrenAllUpdate()) {
- parentItem.setInstallState(InstallState.UPDATE);
- } else if (parentItem.isChildrenAllUninstall()) {
- parentItem.setInstallState(InstallState.UNINSTALL);
+ if (parentItem.getInstallState() != InstallState.INSTALL) {
+ parentItem.setCheckState(true);
} else {
- parentItem.setInstallState(InstallState.INSTALL);
+ parentItem.setCheckState(false);
}
}
}
return true;
}
- private boolean isChildrenAllUpdate() {
- for (Item item : getChildren()) {
- if (item.getInstallState() != InstallState.UPDATE) {
- return false;
- }
- }
- return true;
- }
-
- private boolean isChildrenAllUninstall() {
- for (Item item : getChildren()) {
- if (item.getInstallState() != InstallState.UNINSTALL) {
- return false;
- }
- }
- return true;
- }
-
public String getInstallStateMessage() {
if (hasChildren() || getParent() == null) {
return "";
* @param checked is true, checking in box on tree view. false is the opposite.
*/
public void getTerminalPackages(List<String> installList, boolean checked) {
- if (hasChildren()) {
+ if (getCheckState() == CheckState.CHECKED) {
+ if (!getPackageName().equalsIgnoreCase("EXTRAS")) {
+ installList.add(getPackageName());
+ }
+ } else if (getCheckState() == CheckState.GRAYED) {
for (Item childItem : getChildren()) {
childItem.getTerminalPackages(installList, checked);
}
- }
-
- if (getChildren().size() <= 0) {
- if (getCheckState() == CheckState.CHECKED) {
- installList.add(getPackageName());
- }
+ } else {
+ return;
}
}
}
public String toString() {
- return getPackageName();
+ if (getParent() == null) {
+ return getPackageName();
+ } else {
+ return getParent() + "/" + getPackageName();
+ }
+ }
+
+ public int hashCode() {
+ if (getParent() == null) {
+ return getPackageName().hashCode();
+ } else {
+ return (getParent() + "/" + getPackageName()).hashCode();
+ }
}
@Override
if (e.getElement() instanceof Item) {
Item item = (Item) e.getElement();
+
if (item.getPackageName().equals(Config.SDK_NAME)) {
checkboxTreeViewer.setSubtreeChecked(item, !e.getChecked());
setCheckbox(item, e.getChecked());
}
}
}
+
+ protected List<Item> getLeafItemsToCheck(Item item) {
+ List<Item> leafItemsToCheck = new ArrayList<Item>();
+
+ if (item.hasChildren()) {
+ for (Item childItem : item.getChildren()) {
+ leafItemsToCheck.addAll(getLeafItemsToCheck(childItem));
+ }
+ } else {
+ for (Item i : getItems()) {
+ if (item.getPackageName().equals(i.getPackageName())) {
+ leafItemsToCheck.add(i);
+ }
+ }
+ }
+
+ return leafItemsToCheck;
+ }
protected void setCheckbox(Item item, boolean checked) {
if (item == null) {
return;
} else {
- setChildCheckbox(checkboxTreeViewer, item, checked);
+ List<Item> leafItemsToCheck = getLeafItemsToCheck(item);
- if (item.getParent() != null) {
- setParentCheckbox(item.getParent());
+ for (Item i : leafItemsToCheck) {
+ setCheckState(i, checked);
+ setParentCheckbox(i.getParent());
}
+
+// setChildCheckbox(checkboxTreeViewer, item, checked);
+//
+// if (item.getParent() != null) {
+// for (Item i : getItems()) {
+// if (i.getPackageName().equalsIgnoreCase(item.getPackageName())) {
+// setParentCheckbox(i.getParent());
+// }
+// }
+// }
changeCheckboxStatus(items);
}
private void setChildCheckbox(CheckboxTreeViewer checkboxTreeViewer,
Item selectedItem, boolean checked) {
if (!selectedItem.hasChildren()) {
- setCheckState(selectedItem, checked);
+ for (Item i : getItems()) {
+ if (i.getPackageName().equalsIgnoreCase(selectedItem.getPackageName())) {
+ setCheckState(i, checked);
+ }
+ }
} else {
for (Item item : selectedItem.getChildren()) {
setChildCheckbox(checkboxTreeViewer, item, checked);
}
- setCheckStateByChildren(selectedItem);
+ for (Item i : getItems()) {
+ if (i.getPackageName().equalsIgnoreCase(selectedItem.getPackageName())) {
+ setCheckStateByChildren(i);
+ }
+ }
}
}
if (parentItem == null) {
return;
}
-
setCheckStateByChildren(parentItem);
if (parentItem.getParent() != null) {
private void makeRelation(List<Item> treeItems) {
// set relation of items.
+ List<Item> addedItems = new ArrayList<Item>();
for (Item item : treeItems) {
- setRelationOfItem(item, treeItems);
+ setRelationOfItem(item, treeItems, addedItems);
}
-
+ treeItems.addAll(addedItems);
+
Collections.sort(treeItems);
}
}
}
- private void setRelationOfItem(Item parentItem, List<Item> compareList) {
+ private void setRelationOfItem(Item parentItem, List<Item> compareList, List<Item> addedList) {
Package packageOfParentItem = parentItem.getPackage();
Collection<String> theChildPackage = packageOfParentItem.getDependentPackageNames();
for (Item treeItem : compareList) {
String packageNameOfTreeItem = treeItem.getPackageName();
- if (packageNameOfTreeItem.equalsIgnoreCase(childPackage)) {
- parentItem.addChildItem(treeItem);
- treeItem.setParent(parentItem);
- break;
+ if (packageNameOfTreeItem.equalsIgnoreCase(childPackage)) {
+ if (treeItem.getParent() != null) {
+ Item childItem = new Item(treeItem.getLatestPackage(), treeItem.getInstalledPackage(), treeItem.getInstallState());
+
+ parentItem.addChildItem(childItem);
+ childItem.setParent(parentItem);
+
+ addedList.add(childItem);
+ } else {
+ parentItem.addChildItem(treeItem);
+ treeItem.setParent(parentItem);
+ }
}
}
}
}
} else {
completePage.setTitle("Uninstallation Failed!");
- completePage.setCustomErrorMessage("Sorry, Uninstallation was not success. Please try uninstall again.");
+ completePage.setCustomErrorMessage("Sorry, Uninstallation was not success. Please try uninstall again.\n"
+ + "Datail : " + ErrorController.getErrorMessage());
}
}
});
package org.tizen.installmanager.ui.page;
import java.io.File;
-import java.io.FileNotFoundException;
import java.io.IOException;
-import java.io.RandomAccessFile;
-import java.nio.channels.FileChannel;
-import java.nio.channels.FileLock;
-import java.nio.channels.OverlappingFileLockException;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
private InstallManager installManager;
private PackageManager packageManager;
private SDKExtensionInfo sdkExtensionInfo;
-
- private FileLock lock = null;
- private FileChannel channel = null;
/**
* Initialize objects which need to install.
* @throws IMExitException
*/
public boolean install(Collection<String> installList, String targetPath,
- InstallProgressMonitor monitor) throws IMExitException {
- Performance.setInstallationStartTime();
-
+ InstallProgressMonitor monitor) throws IMExitException {
Log.log("======== Start Installing ========");
Log.log("Selected package list => " + installList);
Log.log("target path => " + targetPath);
PathUtil.remove(Config.getInstance().getDownloadDirPath());
}
- Performance.setInstallationEndTime();
return bResult;
}
PackageSet selectedMetas = packageManager.getPackagesByNames(installList);
//add mandatory packages, madatory packages always reinstall.
- selectedMetas.addAll(
- packageManager.getMandatoryPackages());
-
- //get set of packages by purpose.
- selectedMetas = getMetaPackagesByPurpose(selectedMetas);
+ selectedMetas.addAll(packageManager.getMandatoryPackages());
return packageManager.getInstallablePackages(selectedMetas);
}
-
- private PackageSet getMetaPackagesByPurpose(PackageSet metaPackages) {
- String userAttribute = Options.purposeOfInstalling;
- for (Package pkg : metaPackages) {
- String attribute = pkg.getAttribute();
-
- if (!pkg.isRootMeta() && !pkg.isExtraMeta() && !pkg.isMandatory()) {
- if (!attribute.equalsIgnoreCase(userAttribute)) {
- metaPackages.remove(pkg);
- }
- }
- }
-
- return metaPackages;
- }
/**
* Start to uninstall
* @return If uninstallation is succeed, return true. if not return false.
* @see ViewController#uninstallPackages(PackageSet, IIMProgressMonitor)
*/
- public boolean uninstall(List<String> uninstallList, IIMProgressMonitor monitor) {
- Performance.setInstallationStartTime();
-
+ public boolean uninstall(List<String> uninstallList, IIMProgressMonitor monitor) {
Log.log("ViewController Uninstall Start => " + uninstallList);
+
+ //performance measurement
+ Performance.setRemovalStartTime();
if (packageManager == null || uninstallList.size() == 0) {
Log.err("ViewController.uninstall() uninstalllist does not exist. => " + uninstallList);
ErrorController.setError(ErrorCode.UNKNOWN_ERROR);
+
+ Performance.setRemovalEndTime();
return false;
}
if (Options.doRemoveOldSDK || (uninstallList.size() == 1 && uninstallList.get(0).equals(Config.SDK_NAME))) {
uninstallAll(monitor);
- Performance.setInstallationEndTime();
+
+ //performance measurement
+ Performance.setRemovalEndTime();
+
return true;
} else {
PackageSet removablePackages = packageManager.getInstalledPackagesByName(uninstallList);
+ //performance measurement
+ Performance.sdkPackageSize = packageManager.getTotalSizeOfRemovablePackages(removablePackages);
+
boolean result = uninstallPackages(removablePackages, monitor);
- Performance.setInstallationEndTime();
+
+ //performance measurement
+ Performance.setRemovalEndTime();
return result;
}
}
return packageManager.getInstalledPackageByName(pkgName);
}
+ public PackageSet getInstalledPackages() {
+ return packageManager.getInstalledPackages();
+ }
+
/**
* Get items of tree
* @return
PackageSet rmPkgs = getRemovablePackageList();
PackageSet insPkgs = getInstallableOrUpdatableMetaPackages();
- if (rmPkgs != null || insPkgs != null) {
+ if (!rmPkgs.isEmpty() || !insPkgs.isEmpty()) {
Log.log("existInstallableOrRemovablePackages() is true.");
return (getRemovablePackageList().size() > 0 || getInstallableOrUpdatableMetaPackages().size() > 0);
} else {
Log.log("Update version => " + pkg.getVersion().toString());
if (Version.compareTo(new Version(version), pkg.getVersion()) < 0) {
+ Log.log("Update version is higher than current version. So, installmanager will be updated.");
return true;
} else {
return false;
if (size > 0) {
return true;
} else {
- return false;
+ throw new IMFatalException(ErrorCode.CANNOT_UNPACK_PACKAGE);
}
}
The licenses("Other Licenses") of software which are not listed at the above URL will be either displayed as part of their respective installers or accessed inside installation package archive of each component.
-You may access and download Tizen SDK Open Source Software at: http://developer.tizen.org/download/tizenopensdk.tar.gz
+You may access and download the Software at: https://review.tizen.org/git/
BY CLICKING THE "I AGREE" BUTTON OR BY USING ANY PART OF TIZEN SDK, YOU AGREE (ON BEHALF OF YOURSELF AND/OR YOUR COMPANY) TO THE TERMS IN Licenses, AND THE TERMS IN Other Licenses. If you do not agree with the terms in Licenses or the terms in Other Licenses you may not download or use Tizen SDK.
\ No newline at end of file
--- /dev/null
+#!/bin/sh -ex
+
+testDir="${HOME}/tizen-sdk-data/test/install-manager"
+testScript="${testDir}/install-manager-test.sh"
+
+imBinaryFile="${PWD}/../inst-manager.bin"
+
+mkdir -p ${testDir}
+if [ -e ${testScript} ]; then
+ rm ${testScript}
+fi
+
+cp ${imBinaryFile} ${testDir}
+
+cd ${testDir}
+echo "#!/bin/sh -ex" >> ${testScript}
+echo "./inst-manager.bin -test -remove -p all" >> ${testScript}
+echo "./inst-manager.bin -test -install -p all -r http://172.21.17.55/packages -d develop" >> ${testScript}
+
+chmod +x ${testScript}
+${testScript}
+
+rm "inst-manager.bin"
# list for pre installation check. Write including 'space'
if [ "ubuntu" = "${OS_NAME}" ] ; then
- INSTALLATION_CHECK="procps gettext libdbus-1-3 libcurl3 expect grep zip make libgnome2-0 libudev-dev libpng12-0"
+ INSTALLATION_CHECK="procps gettext libdbus-1-3 libcurl3 expect grep zip make libgnome2-0 libudev-dev libpng12-0 libpython2.7 libpixman-1-0 libpng12-0"
elif [ "fedora" = "${OS_NAME}" ]; then
INSTALLATION_CHECK="procps-ng gettext dbus-libs libcurl expect gtk2 grep zip make libgnome qemu-user webkitgtk libpng12"
elif [ "tizen" = "${OS_NAME}" ] ; then
fi
## check the GUI Enviroment ##
-if [ "-install" = "$1" ] || [ "-remove" = "$1" ] || [ "-status" = "$1" ] || [ "-help" = "$1" ] ; then
+if [ "-install" = "$1" ] || [ "-remove" = "$1" ] || [ "-status" = "$1" ] || [ "-help" = "$1" ] || [ "-repoinfo" = "$1" ] || [ "-packageinfo" = "$1" ] ; then
echo "$CE CLI mode, installer does not need GUI Environment. $CN"
else
if [ -z "$DISPLAY" ]; then
OUT_PATH="/tmp/tizensdk_${MYTIMESTAMP}"
## check the GUI Enviroment ##
-if [ -z "${DISPLAY_MODE}" ]; then
- echo "$CE If you want to install TIZEN-SDK, you must execute installer in GUI Environment. $CN"
- exit 1
+if [ "-install" = "$1" ] || [ "-remove" = "$1" ] || [ "-status" = "$1" ] || [ "-help" = "$1" ] || [ "-repoinfo" = "$1" ] || [ "-packageinfo" = "$1" ] ; then
+ echo "$CE CLI mode, installer does not need GUI Environment. $CN"
+else
+ if [ -z "$DISPLAY" ]; then
+ echo "$CE If you want to install TIZEN-SDK, you must execute installer in GUI Environment. $CN"
+ exit 1
+ fi
fi
mkdir -p ${OUT_PATH}
\r
!include FileFunc.nsh\r
!include LogicLib.nsh\r
+!include x64.nsh\r
!insertmacro GetParameters\r
!insertmacro GetOptions\r
\r
+### StrStr\r
+!define StrStr "!insertmacro StrStr"\r
+ \r
+!macro StrStr ResultVar String SubString\r
+ Push `${String}`\r
+ Push `${SubString}`\r
+ Call StrStr\r
+ Pop `${ResultVar}`\r
+!macroend\r
+ \r
+Function StrStr\r
+/*After this point:\r
+ ------------------------------------------\r
+ $R0 = SubString (input)\r
+ $R1 = String (input)\r
+ $R2 = SubStringLen (temp)\r
+ $R3 = StrLen (temp)\r
+ $R4 = StartCharPos (temp)\r
+ $R5 = TempStr (temp)*/\r
+\r
+ ;Get input from user\r
+ Exch $R0\r
+ Exch\r
+ Exch $R1\r
+ Push $R2\r
+ Push $R3\r
+ Push $R4\r
+ Push $R5\r
+\r
+ ;Get "String" and "SubString" length\r
+ StrLen $R2 $R0\r
+ StrLen $R3 $R1\r
+ ;Start "StartCharPos" counter\r
+ StrCpy $R4 0\r
+\r
+ ;Loop until "SubString" is found or "String" reaches its end\r
+ ${Do}\r
+ ;Remove everything before and after the searched part ("TempStr")\r
+ StrCpy $R5 $R1 $R2 $R4\r
+\r
+ ;Compare "TempStr" with "SubString"\r
+ ${IfThen} $R5 == $R0 ${|} ${ExitDo} ${|}\r
+ ;If not "SubString", this could be "String"'s end\r
+ ${IfThen} $R4 >= $R3 ${|} ${ExitDo} ${|}\r
+ ;If not, continue the loop\r
+ IntOp $R4 $R4 + 1\r
+ ${Loop}\r
+ \r
+/*After this point:\r
+ ------------------------------------------\r
+ $R0 = ResultVar (output)*/\r
+\r
+ ;Remove part before "SubString" on "String" (if there has one)\r
+ StrCpy $R0 $R1 `` $R4\r
+\r
+ ;Return output to user\r
+ Pop $R5\r
+ Pop $R4\r
+ Pop $R3\r
+ Pop $R2\r
+ Pop $R1\r
+ Exch $R0\r
+FunctionEnd\r
+############\r
+\r
### TimeStamp\r
!ifndef TimeStamp\r
!define TimeStamp "!insertmacro _TimeStamp" \r
!endif\r
###########\r
\r
+Var ConsoleHandle ; to save console handle\r
+\r
section\r
- ${GetParameters} $R0\r
- ${GetExePath} $R1\r
- ${TimeStamp} $0\r
- SetRegView 64\r
-\r
- StrCpy $1 "SOFTWARE\JavaSoft\Java Runtime Environment"\r
- StrCpy $2 0\r
- ReadRegStr $2 HKLM "$1" "CurrentVersion"\r
- StrCmp $2 "" DetectTry2\r
- ReadRegStr $5 HKLM "$1\$2" "JavaHome"\r
- StrCmp $5 "" DetectTry2\r
- goto done\r
-\r
- DetectTry2:\r
- ReadRegStr $2 HKLM "SOFTWARE\JavaSoft\Java Development Kit" "CurrentVersion"\r
- StrCmp $2 "" NoJava\r
- ReadRegStr $5 HKLM "SOFTWARE\JavaSoft\Java Development Kit\$2" "JavaHome"\r
- StrCmp $5 "" NoJava done\r
-\r
- done:\r
- StrCpy $2 '-path "$R1"'\r
- StrCpy $INSTDIR "$TEMP\tizensdk_$0"\r
- RMDir /r $INSTDIR\r
- SetOutPath $INSTDIR\r
- SetOverwrite on\r
- File /r "img\*.exe"\r
- File /r "img\*.conf"\r
- File /r "img\*.jar"\r
- DetailPrint "install manager will be executed"\r
- ExecWait '"$INSTDIR\javacheck.exe"' $1\r
- ${If} $1 != 0\r
- goto NoEnv\r
- ${EndIf}\r
- ${If} $R0 == ""\r
- Exec "$INSTDIR\InstManager.exe $2"\r
- ${Else}\r
- StrCpy $3 "$2 $R0"\r
- Exec "$INSTDIR\InstManagerC.exe $3"\r
- ${EndIf}\r
- SetAutoClose true\r
- return\r
-\r
- NoEnv:\r
- MessageBox MB_ICONEXCLAMATION "Cannot execute Java even if it was installed. Check environment variables or Java version(over 1.6) please." \r
- SetAutoClose true\r
- return\r
-\r
- NoJava:\r
- MessageBox MB_ICONEXCLAMATION "You must have either a Java Runtime Environment (JRE) or a Java Development Kit (JDK) in version 6 installed on your computer."\r
- SetAutoClose true\r
- return\r
+ ${GetParameters} $R0\r
+ ${GetExePath} $R1\r
+ ${TimeStamp} $0\r
+ SetRegView 64\r
+\r
+ StrCpy $1 "SOFTWARE\JavaSoft\Java Runtime Environment"\r
+ StrCpy $2 0\r
+ ReadRegStr $2 HKLM "$1" "CurrentVersion"\r
+ StrCmp $2 "" DetectTry2\r
+ ReadRegStr $5 HKLM "$1\$2" "JavaHome"\r
+ StrCmp $5 "" DetectTry2\r
+ goto done\r
+\r
+DetectTry2:\r
+ ReadRegStr $2 HKLM "SOFTWARE\JavaSoft\Java Development Kit" "CurrentVersion"\r
+ StrCmp $2 "" NoJava\r
+ ReadRegStr $5 HKLM "SOFTWARE\JavaSoft\Java Development Kit\$2" "JavaHome"\r
+ StrCmp $5 "" NoJava done\r
+\r
+done:\r
+ StrCpy $2 '-path "$R1"'\r
+ StrCpy $INSTDIR "$TEMP\tizensdk_$0"\r
+ RMDir /r $INSTDIR\r
+ SetOutPath $INSTDIR\r
+ SetOverwrite on\r
+ File /r "img\*.conf"\r
+ File /r "img\*.jar"\r
+ DetailPrint "install manager will be executed"\r
+\r
+ ## Check java version and java execution.\r
+ ExpandEnvStrings $3 %COMSPEC%\r
+\r
+ ${DisableX64FSRedirection} ; execute cmd command for windows7 64bit\r
+ nsExec::ExecToStack '"$3" /C ""java.exe" "-version""'\r
+ Pop $0\r
+ Pop $6\r
+ ${EnableX64FSRedirection} ; execute cmd command for windows7 64bit\r
+\r
+ ## check java 1.6\r
+ Push $6\r
+ Push "1.6"\r
+ Call StrStr\r
+ Pop $1\r
+ ${If} $1 == "" ; if not java version 1.6, it will check java version 1.7.\r
+ Push $6\r
+ Push "1.7"\r
+ Call StrStr\r
+ Pop $1\r
+ ${If} $1 == "" ; if not java version 1.7, it will check java version using java home.\r
+ ## Execute java.exe in java home\r
+ nsExec::ExecToStack '"$3" /C ""$5\bin\java.exe" "-version""'\r
+ Pop $0\r
+ Pop $6\r
+\r
+ Push $6\r
+ Push "1.6"\r
+ Call StrStr\r
+ Pop $1\r
+ ${If} $1 == "" ; if not java version 1.6, it will check java version 1.7.\r
+ Push $6\r
+ Push "1.7"\r
+ Call StrStr\r
+ Pop $1\r
+ ${If} $1 == "" ; if not java version 1.7, system does not support java.\r
+ goto NoEnv\r
+ ${EndIf}\r
+ ${EndIf}\r
+ ${EndIf}\r
+ ${EndIf}\r
+\r
+ ${If} $R0 == ""\r
+ Exec "javaw -jar $INSTDIR\InstallManager.jar $2"\r
+ ${Else}\r
+ StrCpy $3 "$2 $R0"\r
+ System::Call 'kernel32::GetStdHandle(i -11)i.r0' ;try to get stdout\r
+ System::Call 'kernel32::AttachConsole(i -1)i.r1' ;attach to parent console\r
+ Exec "java -jar $INSTDIR\InstallManager.jar $3"\r
+ ${EndIf}\r
+SetAutoClose true\r
+return\r
+\r
+NoEnv:\r
+ MessageBox MB_ICONEXCLAMATION "Cannot execute Java even if it was installed. Check environment variables or Java version(over 1.6) please." \r
+SetAutoClose true\r
+return\r
+\r
+NoJava:\r
+ MessageBox MB_ICONEXCLAMATION "You must have either a Java Runtime Environment (JRE) or a Java Development Kit (JDK) in version 6 installed on your computer."\r
+SetAutoClose true\r
+return\r
+\r
sectionEnd\r
!insertmacro GetParameters\r
!insertmacro GetOptions\r
\r
+### StrStr\r
+!define StrStr "!insertmacro StrStr"\r
+ \r
+!macro StrStr ResultVar String SubString\r
+ Push `${String}`\r
+ Push `${SubString}`\r
+ Call StrStr\r
+ Pop `${ResultVar}`\r
+!macroend\r
+ \r
+Function StrStr\r
+/*After this point:\r
+ ------------------------------------------\r
+ $R0 = SubString (input)\r
+ $R1 = String (input)\r
+ $R2 = SubStringLen (temp)\r
+ $R3 = StrLen (temp)\r
+ $R4 = StartCharPos (temp)\r
+ $R5 = TempStr (temp)*/\r
+\r
+ ;Get input from user\r
+ Exch $R0\r
+ Exch\r
+ Exch $R1\r
+ Push $R2\r
+ Push $R3\r
+ Push $R4\r
+ Push $R5\r
+\r
+ ;Get "String" and "SubString" length\r
+ StrLen $R2 $R0\r
+ StrLen $R3 $R1\r
+ ;Start "StartCharPos" counter\r
+ StrCpy $R4 0\r
+\r
+ ;Loop until "SubString" is found or "String" reaches its end\r
+ ${Do}\r
+ ;Remove everything before and after the searched part ("TempStr")\r
+ StrCpy $R5 $R1 $R2 $R4\r
+\r
+ ;Compare "TempStr" with "SubString"\r
+ ${IfThen} $R5 == $R0 ${|} ${ExitDo} ${|}\r
+ ;If not "SubString", this could be "String"'s end\r
+ ${IfThen} $R4 >= $R3 ${|} ${ExitDo} ${|}\r
+ ;If not, continue the loop\r
+ IntOp $R4 $R4 + 1\r
+ ${Loop}\r
+ \r
+/*After this point:\r
+ ------------------------------------------\r
+ $R0 = ResultVar (output)*/\r
+\r
+ ;Remove part before "SubString" on "String" (if there has one)\r
+ StrCpy $R0 $R1 `` $R4\r
+\r
+ ;Return output to user\r
+ Pop $R5\r
+ Pop $R4\r
+ Pop $R3\r
+ Pop $R2\r
+ Pop $R1\r
+ Exch $R0\r
+FunctionEnd\r
+############\r
+\r
+\r
### TimeStamp\r
!ifndef TimeStamp\r
!define TimeStamp "!insertmacro _TimeStamp" \r
!endif\r
###########\r
\r
+Var ConsoleHandle ; to save console handle\r
+\r
section\r
- ${GetParameters} $R0\r
- ${GetExePath} $R1\r
- ${TimeStamp} $0\r
-\r
- StrCpy $1 "SOFTWARE\JavaSoft\Java Runtime Environment"\r
- StrCpy $2 0\r
- ReadRegStr $2 HKLM "$1" "CurrentVersion"\r
- StrCmp $2 "" DetectTry2\r
- ReadRegStr $5 HKLM "$1\$2" "JavaHome"\r
- StrCmp $5 "" DetectTry2\r
- goto done\r
-\r
- DetectTry2:\r
- ReadRegStr $2 HKLM "SOFTWARE\JavaSoft\Java Development Kit" "CurrentVersion"\r
- StrCmp $2 "" NoJava\r
- ReadRegStr $5 HKLM "SOFTWARE\JavaSoft\Java Development Kit\$2" "JavaHome"\r
- StrCmp $5 "" NoJava done\r
-\r
- done:\r
- StrCpy $2 '-path "$R1"'\r
- StrCpy $INSTDIR "$TEMP\tizensdk_$0"\r
- RMDir /r $INSTDIR\r
- SetOutPath $INSTDIR\r
- SetOverwrite on\r
- File /r "img\*.exe"\r
- File /r "img\*.conf"\r
- File /r "img\*.jar"\r
- DetailPrint "install manager will be executed"\r
- ExecWait '"$INSTDIR\javacheck.exe"' $1\r
- ${If} $1 != 0\r
- goto NoEnv\r
- ${EndIf}\r
- ${If} $R0 == ""\r
- Exec "$INSTDIR\InstManager.exe $2"\r
- ${Else}\r
- StrCpy $3 "$2 $R0"\r
- Exec "$INSTDIR\InstManagerC.exe $3"\r
- ${EndIf}\r
- SetAutoClose true\r
- return\r
-\r
- NoEnv:\r
- MessageBox MB_ICONEXCLAMATION "Cannot execute Java even if it was installed. Check environment variables or Java version(over 1.6) please." \r
- SetAutoClose true\r
- return\r
-\r
- NoJava:\r
- MessageBox MB_ICONEXCLAMATION "You must have either a Java Runtime Environment (JRE) or a Java Development Kit (JDK) in version 6 installed on your computer."\r
- SetAutoClose true\r
- return\r
+ ${GetParameters} $R0\r
+ ${GetExePath} $R1\r
+ ${TimeStamp} $0\r
+\r
+ StrCpy $1 "SOFTWARE\JavaSoft\Java Runtime Environment"\r
+ StrCpy $2 0\r
+ ReadRegStr $2 HKLM "$1" "CurrentVersion"\r
+ StrCmp $2 "" DetectTry2\r
+ ReadRegStr $5 HKLM "$1\$2" "JavaHome"\r
+ StrCmp $5 "" DetectTry2\r
+ goto done\r
+\r
+DetectTry2:\r
+ ReadRegStr $2 HKLM "SOFTWARE\JavaSoft\Java Development Kit" "CurrentVersion"\r
+ StrCmp $2 "" NoJava\r
+ ReadRegStr $5 HKLM "SOFTWARE\JavaSoft\Java Development Kit\$2" "JavaHome"\r
+ StrCmp $5 "" NoJava done\r
+\r
+done:\r
+ StrCpy $2 '-path "$R1"'\r
+ StrCpy $INSTDIR "$TEMP\tizensdk_$0"\r
+ RMDir /r $INSTDIR\r
+ SetOutPath $INSTDIR\r
+ SetOverwrite on\r
+ File /r "img\*.conf"\r
+ File /r "img\*.jar"\r
+ DetailPrint "install manager will be executed"\r
+\r
+ ## Check java version and java execution.\r
+ ExpandEnvStrings $3 %COMSPEC%\r
+ \r
+ nsExec::ExecToStack '"$3" /C ""java.exe" "-version""'\r
+ Pop $0\r
+ Pop $6\r
+ ## check java 1.6\r
+ Push $6\r
+ Push "1.6"\r
+ Call StrStr\r
+ Pop $1\r
+ ${If} $1 == "" ; if not java version 1.6, it will check java version 1.7.\r
+ Push $6\r
+ Push "1.7"\r
+ Call StrStr\r
+ Pop $1\r
+ ${If} $1 == "" ; if not java version 1.7, it will check java version using java home.\r
+ ## Execute java.exe in java home\r
+ nsExec::ExecToStack '"$5" /C ""$4\bin\java.exe" "-version""'\r
+ Pop $0\r
+ Pop $6\r
+\r
+ ## check java 1.6\r
+ Push $6\r
+ Push "1.6"\r
+ Call StrStr\r
+ Pop $1\r
+ ${If} $1 == "" ; if not java version 1.6, it will check java version 1.7.\r
+ Push $6\r
+ Push "1.7"\r
+ Call StrStr\r
+ Pop $1\r
+ ${If} $1 == "" ; if not java version 1.7, system does not support java.\r
+ goto NoEnv\r
+ ${EndIf}\r
+ ${EndIf}\r
+ ${EndIf}\r
+ ${EndIf}\r
+\r
+ ${If} $R0 == ""\r
+ Exec "javaw -jar $INSTDIR\InstallManager.jar $2"\r
+ ${Else}\r
+ StrCpy $3 "$2 $R0"\r
+ System::Call 'kernel32::GetStdHandle(i -11)i.r0' ;try to get stdout\r
+ System::Call 'kernel32::AttachConsole(i -1)i.r1' ;attach to parent console\r
+ Exec "java -jar $INSTDIR\InstallManager.jar $3"\r
+ ${EndIf}\r
+SetAutoClose true\r
+return\r
+\r
+NoEnv:\r
+ MessageBox MB_ICONEXCLAMATION "Cannot execute Java even if it was installed. Check environment variables or Java version(over 1.6) please." \r
+SetAutoClose true\r
+return\r
+\r
+NoJava:\r
+ MessageBox MB_ICONEXCLAMATION "You must have either a Java Runtime Environment (JRE) or a Java Development Kit (JDK) in version 6 installed on your computer."\r
+SetAutoClose true\r
+return\r
+\r
sectionEnd\r
--- /dev/null
+set testDir="%localappdata%\tizen-sdk-data\test\install-manager"
+
+set testScript="%testDir%\install-manager-test.bat"
+
+set imBinaryFile="..\inst-manager.exe"
+
+if not exist %testDir% (
+ mkdir %testDir%
+)
+
+if exist %testScript% (
+ del %testScript%
+)
+
+copy %imBinaryFile% %testDir%
+echo inst-manager.exe -test -remove -p all >> %testScript%
+echo inst-manager.exe -test -install -p all -r http://172.21.17.55/packages -d develop >> %testScript%
+
+cd %testDir%
+start "install-manager-test" %testScript%
+
#!/bin/bash -ex
buildDir="${SRCDIR}/build"
targetBinary="inst-manager"
+testBinary="install-manager-test.sh"
##make config file
buildConfigFile() {
INSTALL_DIR="$SRCDIR/package/install-manager-standalone.package.$BUILD_TARGET_OS"
mkdir -p $INSTALL_DIR
cp -r ${buildDir}/${targetBinary}.bin ${INSTALL_DIR}/
+
+ # install-manager-test
+ INSTALL_DIR="$SRCDIR/package/install-manager-test.package.$BUILD_TARGET_OS/data/install-manager/test"
+ mkdir -p $INSTALL_DIR
+ cp -r ${SRCDIR}/os_stubs/linux/${testBinary} ${INSTALL_DIR}
+
+ # meta-install-manager-test
+ INSTALL_DIR="$SRCDIR/package/tizen-install-manager-test.package.$BUILD_TARGET_OS/data/"
+ mkdir -p $INSTALL_DIR
}
#!/bin/bash -ex
buildDir="${SRCDIR}/build"
targetBinary="inst-manager"
+testBinary="install-manager-test.sh"
##make config file
buildConfigFile() {
mkdir -p $INSTALL_DIR
cp -r ${buildDir}/${targetBinary}.dmg ${INSTALL_DIR}/
cp -r ${buildDir}/${targetBinary}.bin ${INSTALL_DIR}/
+
+ # install-manager-test
+ INSTALL_DIR="$SRCDIR/package/install-manager-test.package.$BUILD_TARGET_OS/data/install-manager/test"
+ mkdir -p $INSTALL_DIR
+ cp -r ${SRCDIR}/os_stubs/linux/${testBinary} ${INSTALL_DIR}
+
+ # meta-install-manager-test
+ INSTALL_DIR="$SRCDIR/package/tizen-install-manager-test.package.$BUILD_TARGET_OS/data/"
+ mkdir -p $INSTALL_DIR
}
#!/bin/bash -ex
buildDir="${SRCDIR}/build"
targetBinary="inst-manager"
+testBinary="install-manager-test.bat"
##make config file
buildConfigFile() {
case ${TARGET_OS} in
windows-32)
cp -rf $SRCDIR/InstallManager_java/dist/windows32/InstallManager.jar ${buildDir}/img
- cp -rf $SRCDIR/os_stubs/windows/32/InstManager.exe ${buildDir}/img/
- cp -rf $SRCDIR/os_stubs/windows/32/InstManagerC.exe ${buildDir}/img/
cp -rf $SRCDIR/os_stubs/windows/InstallManager.nsi ${buildDir}/
- cp -rf $SRCDIR/os_stubs/windows/javacheck-32.exe ${buildDir}/img/javacheck.exe
;;
windows-64)
cp -rf $SRCDIR/InstallManager_java/dist/windows64/InstallManager.jar ${buildDir}/img
- cp -rf $SRCDIR/os_stubs/windows/64/InstManager.exe ${buildDir}/img/
- cp -rf $SRCDIR/os_stubs/windows/64/InstManagerC.exe ${buildDir}/img/
cp -rf $SRCDIR/os_stubs/windows/InstallManager-64.nsi ${buildDir}/InstallManager.nsi
- cp -rf $SRCDIR/os_stubs/windows/javacheck-64.exe ${buildDir}/img/javacheck.exe
;;
*)
echo "The OS \"${TARGET_OS}\" is not supported yet!"
INSTALL_DIR="$SRCDIR/package/install-manager-standalone.package.$BUILD_TARGET_OS"
mkdir -p $INSTALL_DIR
cp -r ${buildDir}/${targetBinary}.exe ${INSTALL_DIR}/
+
+ # install-manager-test
+ INSTALL_DIR="$SRCDIR/package/install-manager-test.package.$BUILD_TARGET_OS/data/install-manager/test"
+ mkdir -p $INSTALL_DIR
+ cp -r ${SRCDIR}/os_stubs/windows/${testBinary} ${INSTALL_DIR}
+
+ # meta-install-manager-test
+ INSTALL_DIR="$SRCDIR/package/tizen-install-manager-test.package.$BUILD_TARGET_OS/data/"
+ mkdir -p $INSTALL_DIR
}
+*2.2.64
+- Modify license agreement.
+- Fix that installmanager(windows 32bit) has virus threats.
+- Add more log codes for version problem.
+== Yongsung Kim <yongsung1.kim@samsung.com> 2013-10-28
+*2.2.63
+- Modify to error message.
+- Modify unzip option on Ubuntu(unzip -ao -> unzip -o).
+- Check to exist '/etc/os-release' file with linux stub.
+== Yongsung Kim <yongsung1.kim@samsung.com> 2013-10-24
+*2.2.53
+- Add '-accept_license' option for cli installing.
+== Yongsung Kim <yongsung1.kim@samsung.com> 2013-09-05
+*2.2.52
+- Add test result file by xml format.
+== Shihyun Kim <shihyun.kim@samsung.com> 2013-09-03
+*2.2.51
+- remove a dialog shows java home for windows 32bit
+== Yongsung Kim <yongsung1.kim@samsung.com> 2013-08-30
+*2.2.50
+- InstallManager can install extra packages after SDK image installation.
+- InstallManager can manage invalid package version and version not found.
+- InstallManager show warning dialog when invaild package version and version not found.
+== Yongsung Kim <yongsung1.kim@samsung.com> 2013-08-30
+*2.2.49
+- Modify check routine of java version and java execution on cmd command for Windows
+- Removed javacheck.exe file.
+- Windows installmanager is not known fault as virus anymore.
+== Yongsung Kim <yongsung1.kim@samsung.com> 2013-08-23
+*2.2.48
+- Add pre-requisites on Ubuntu.(libpixman-1-0, libpng12-0, libpython2.7)
+== Yongsung Kim <yongsung1.kim@samsung.com> 2013-08-21
+*2.2.47
+- Change file path which is installmanager performance test result file path from applocal/tizen-sdk-data to c:\tizen-sdk-data by default on Windows.
+- Add meta packages to install.
+- fixed checkbox status in checkboxTreeViewer
+- Fix wrong test result path when cli installation on Ubuntu.
+== Yongsung Kim <yongsung1.kim@samsung.com> 2013-08-12
+*2.2.46
+- InstallManager display test packages on tree optionally.
+- tizen-install-manager-test package's attribute changed to test.
+== Yongsung Kim <yongsung1.kim@samsung.com> 2013-08-05
+*2.2.45
+- Fix bug that '-test' option for installmanager performance test does not work with '-ni' option.
+== Yongsung Kim <yongsung1.kim@samsung.com> 2013-08-05
+*2.2.44
+- -skip option works well when use -p all option.
+== Yongsung Kim <yongsung1.kim@samsung.com> 2013-08-02
+*2.2.38
+- Add test package for installmanager performance testing.
+*2.2.34
+- Add -test option for installmanager performance testing.
+- Add test package for installmanager.
+- Installmanager does not display useless cmd console when cli installation.
+== Yongsung Kim <yongsung1.kim@samsung.com> 2013-07-26
+*2.2.33
+- CLI installation works well on macos non-gui environment.
+- CLI installation works well on Ubuntu.
+- When installmanager works by cli mode, it does not pop up cmd console window.
+== Yongsung Kim <yongsung1.kim@samsung.com> 2013-07-24
+*2.2.32
+- Modify license
+== Yongsung Kim <yongsung1.kim@samsung.com> 2013-07-19
+*2.2.31
+- progressbar works well more than before.
+- Add performance information.
+- -skip options is added.
+== Yongsung Kim <yongsung1.kim@samsung.com> 2013-07-19
*2.2.30
- Fix bug of downloading UX
- InstallManager can manage that script return value is 2.
Source: install-manager
-Version: 2.2.30
+Version: 2.2.64
Maintainer: Shihyun Kim<shihyun.kim@samsung.com>, Yongsung Kim<yongsung1.kim@samsung.com>
Package: install-manager
OS: macos-64
Build-host-os: macos-64
Description: Standalone Install Manager Executable(s)
+
+Package: install-manager-test
+OS: ubuntu-32
+Build-host-os: ubuntu-32
+Description: Test for install-manager
+
+Package: install-manager-test
+OS: ubuntu-64
+Build-host-os: ubuntu-64
+Description: Test for install-manager
+
+Package: install-manager-test
+OS: windows-32
+Build-host-os: windows-32
+Description: Test for install-manager
+
+Package: install-manager-test
+OS: windows-64
+Build-host-os: windows-32
+Description: Test for install-manager
+
+Package: install-manager-test
+OS: macos-64
+Build-host-os: macos-64
+Description: Test for install-manager
+
+Package: tizen-install-manager-test
+Label: Installmanager Test
+Attribute: test
+OS: ubuntu-32
+Build-host-os: ubuntu-32
+Install-dependency: install-manager-test
+Description: Test for install-manager
+
+Package: tizen-install-manager-test
+Label: Installmanager Test
+Attribute: test
+OS: ubuntu-64
+Build-host-os: ubuntu-64
+Install-dependency: install-manager-test
+Description: Test for install-manager
+
+Package: tizen-install-manager-test
+Label: Installmanager Test
+Attribute: test
+OS: windows-32
+Build-host-os: windows-32
+Install-dependency: install-manager-test
+Description: Test for install-manager
+
+Package: tizen-install-manager-test
+Label: Installmanager Test
+Attribute: test
+OS: windows-64
+Build-host-os: windows-32
+Install-dependency: install-manager-test
+Description: Test for install-manager
+
+Package: tizen-install-manager-test
+Label: Installmanager Test
+Attribute: test
+OS: macos-64
+Build-host-os: macos-64
+Install-dependency: install-manager-test
+Description: Test for install-manager