init tizen_2.2.1 tizen_2.2 2.2.1_release
authorSehong Na <sehong.na@samsung.com>
Thu, 14 Nov 2013 05:47:47 +0000 (14:47 +0900)
committerSehong Na <sehong.na@samsung.com>
Thu, 14 Nov 2013 05:47:47 +0000 (14:47 +0900)
39 files changed:
InstallManager_java/installmanager.conf
InstallManager_java/src/org/tizen/installmanager/cli/CliInstall.java
InstallManager_java/src/org/tizen/installmanager/cli/CliUninstall.java
InstallManager_java/src/org/tizen/installmanager/cli/InstallManagerNoUI.java
InstallManager_java/src/org/tizen/installmanager/core/Config.java
InstallManager_java/src/org/tizen/installmanager/core/InstallManager.java
InstallManager_java/src/org/tizen/installmanager/core/InstallManagerConstants.java
InstallManager_java/src/org/tizen/installmanager/core/Installer.java
InstallManager_java/src/org/tizen/installmanager/core/OptionConstant.java
InstallManager_java/src/org/tizen/installmanager/core/Options.java
InstallManager_java/src/org/tizen/installmanager/core/Performance.java
InstallManager_java/src/org/tizen/installmanager/lib/ErrorController.java
InstallManager_java/src/org/tizen/installmanager/lib/Registry.java
InstallManager_java/src/org/tizen/installmanager/lib/linux/LinuxSDKPackageFormat.java
InstallManager_java/src/org/tizen/installmanager/lib/mac/CocoaUtil.java [new file with mode: 0644]
InstallManager_java/src/org/tizen/installmanager/lib/win/WindowsSDKPackageFormat.java
InstallManager_java/src/org/tizen/installmanager/pkg/lib/PackageManager.java
InstallManager_java/src/org/tizen/installmanager/pkg/model/InstConfig.java
InstallManager_java/src/org/tizen/installmanager/pkg/model/Package.java
InstallManager_java/src/org/tizen/installmanager/pkg/model/Version.java
InstallManager_java/src/org/tizen/installmanager/ui/InstallManagerWindow.java
InstallManager_java/src/org/tizen/installmanager/ui/model/Item.java
InstallManager_java/src/org/tizen/installmanager/ui/page/PackageListPage.java
InstallManager_java/src/org/tizen/installmanager/ui/page/UninstallingPage.java
InstallManager_java/src/org/tizen/installmanager/ui/page/ViewController.java
InstallManager_java/src/res/COPYING
os_stubs/linux/install-manager-test.sh [new file with mode: 0755]
os_stubs/linux/installer_stub
os_stubs/macos/installer_stub
os_stubs/windows/InstallManager-64.nsi
os_stubs/windows/InstallManager.nsi
os_stubs/windows/install-manager-test.bat [new file with mode: 0644]
os_stubs/windows/javacheck-32.exe [deleted file]
os_stubs/windows/javacheck-64.exe [deleted file]
package/build.linux
package/build.macos
package/build.windows
package/changelog
package/pkginfo.manifest

index 30c55f2..34e52b1 100644 (file)
@@ -4,6 +4,6 @@ Type:
 Package-Server: 
 Server-Type: snapshot
 InstallManager-Version: 2.3.0
-Distribution: tizen_2.2
+Distribution: develop
 Release-note: https://developer.tizen.org
 
index 989fce2..9356ead 100644 (file)
@@ -43,6 +43,7 @@ import org.tizen.installmanager.core.IMFatalException;
 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;
@@ -89,12 +90,14 @@ public class CliInstall {
                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;
@@ -106,13 +109,14 @@ public class CliInstall {
                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 {
@@ -326,11 +330,13 @@ public class CliInstall {
         * @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.");
@@ -403,7 +409,7 @@ public class CliInstall {
                
                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 {
index 724f031..a59f123 100644 (file)
@@ -34,6 +34,7 @@ import java.util.List;
 
 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;
@@ -60,6 +61,7 @@ public class CliUninstall {
                System.out.println("******* Start SDK uninstallation *******");
                System.out.println("****************************************");
                
+               Performance.setRemovalStartTime();
                ViewController controller = new ViewController();
                controller.init();
                
@@ -87,11 +89,13 @@ public class CliUninstall {
                        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 {
index 3c43aea..bec35c7 100644 (file)
@@ -51,6 +51,13 @@ public class InstallManagerNoUI {
        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 {
index 630a226..a62333d 100644 (file)
@@ -222,6 +222,7 @@ public class Config {
        private ConfigFile mConfigFile = null;
        private ConfigFile currentConfigFile = null;
        private String mTargetDir = "";
+       private String mSdkDataDir = "";
 
        private static Config config = null;
 
@@ -351,6 +352,15 @@ public class Config {
        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
@@ -562,6 +572,13 @@ public class Config {
        public String getTargetDir() {
                return mTargetDir;
        }
+       
+       /**
+        * @return path of target directory
+        */
+       public String getSdkDataDir() {
+               return mSdkDataDir;
+       }
 
        /**
         * @return <code>true</code> if proxy server is specified
index 68e9565..09f925a 100644 (file)
@@ -127,6 +127,7 @@ public class InstallManager {
                        if (!Registry.getInstalledPath().isEmpty()) {
                                mConfig.setTargetDir(Registry.getInstalledPath());
                        }
+                       mConfig.setSdkDatatDir(Registry.getSdkDataPath());
                }
        }
        
@@ -441,7 +442,7 @@ public class InstallManager {
         */
        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
@@ -707,10 +708,13 @@ public class InstallManager {
         * @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);
@@ -718,6 +722,9 @@ public class InstallManager {
                }
                
                mConfig.setTargetDir(targetDir);
+               mConfig.setSdkDatatDir(Registry.sdkDataPath);
+               
+               Performance.setDownloadStartTime();
                
                // download packages from repository
                if (downloadPackages(installablePackages, monitor)) {
@@ -740,7 +747,10 @@ public class InstallManager {
                                }
                        }
                }
+               
+               Performance.setDownloadEndTime();
 
+               Performance.setInstallationStartTime();
                // save target directory
                initializeTargetDir(targetDir);
                
@@ -841,6 +851,8 @@ public class InstallManager {
                        ErrorController.setInfoCode(InfoCode.RESTART_THE_COMPUTER);
                }
                
+               Performance.setInstallationEndTime();
+               
                return true;
        }
        
@@ -1048,6 +1060,7 @@ public class InstallManager {
 
                // Keep target path for later use
                mConfig.setTargetDir(targetDir);
+               mConfig.setSdkDatatDir(Registry.sdkDataPath);
 
                // Make .info directory
                if (!mConfig.makeInfoDirectory()) {
index abda8c4..49cf1f8 100644 (file)
@@ -26,11 +26,17 @@ public class InstallManagerConstants {
        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()) {
@@ -44,6 +50,24 @@ public class InstallManagerConstants {
                }
        }
        
+       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";
index 1f9a19b..aa301f5 100644 (file)
@@ -120,7 +120,8 @@ public class Installer {
 
                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)) {
@@ -164,34 +165,34 @@ public class Installer {
                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
@@ -266,8 +267,8 @@ public class Installer {
                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());
@@ -304,7 +305,7 @@ public class Installer {
                String installedFileListPath = getInstalledFileListPath(pkg);
 
                format.setFileOutput(installedFileListPath);
-
+                               
                return format.unZip(filePath, tempDir, monitor);
        }
 
@@ -313,12 +314,6 @@ public class Installer {
                                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(
@@ -470,16 +465,6 @@ public class Installer {
                        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) {
@@ -498,8 +483,8 @@ public class Installer {
                                        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");
@@ -529,7 +514,8 @@ public class Installer {
                                }
                        } 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.
@@ -556,10 +542,7 @@ public class Installer {
                // 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) {
@@ -570,7 +553,8 @@ public class Installer {
                        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)");
                }
        }
 }
index f1668f0..5c5a7b2 100644 (file)
@@ -3,6 +3,8 @@ package org.tizen.installmanager.core;
 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.";
index 27d0dc6..aec428e 100644 (file)
@@ -50,17 +50,6 @@ public class Options {
        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;
@@ -117,13 +106,26 @@ public class Options {
        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;
@@ -137,6 +139,8 @@ public class Options {
        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.
         */
@@ -199,6 +203,8 @@ public class Options {
                                        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;
@@ -435,6 +441,18 @@ public class Options {
                        }
                }
                
+               // 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")) {
@@ -501,6 +519,16 @@ public class Options {
                        }
                }
                
+               // 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")) {
@@ -509,9 +537,7 @@ public class Options {
                                        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();
@@ -522,6 +548,9 @@ public class Options {
                                                                }
                                                        }
                                                }
+                                               if (suPass == "") {
+                                                       throw new IMFatalException(ErrorCode.WRONG_OPTION);
+                                               }
                                        } else if (Platform.isWindows()) {
                                                interactive = true;
                                        } else if (Platform.isMacOS()) {
index a8ce9de..7d001cc 100644 (file)
@@ -1,15 +1,41 @@
 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();
        }
@@ -18,6 +44,22 @@ public class Performance {
                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();
        }
@@ -26,13 +68,21 @@ public class Performance {
                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"
@@ -42,12 +92,165 @@ public class Performance {
                }
        }
        
-       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;
+               }
+       }
 }
index b0670d9..b97d790 100644 (file)
@@ -78,7 +78,7 @@ public class ErrorController {
                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."),
@@ -101,7 +101,7 @@ public class ErrorController {
                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
index 48903d7..484ed99 100644 (file)
@@ -74,7 +74,8 @@ public class Registry {
        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();
 
        /**
@@ -206,6 +207,15 @@ public class Registry {
                }
        }
        
+       /**
+        * @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);
        }
@@ -238,11 +248,12 @@ public class Registry {
        /**
         * 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 {
@@ -451,7 +462,7 @@ public class Registry {
         */
        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);
@@ -459,7 +470,7 @@ public class Registry {
 
                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 {
index f70184a..62e707c 100644 (file)
@@ -78,7 +78,7 @@ public class LinuxSDKPackageFormat extends SDKPackageFormat{
         
        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) {
diff --git a/InstallManager_java/src/org/tizen/installmanager/lib/mac/CocoaUtil.java b/InstallManager_java/src/org/tizen/installmanager/lib/mac/CocoaUtil.java
new file mode 100644 (file)
index 0000000..0471f4f
--- /dev/null
@@ -0,0 +1,77 @@
+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();
+               }
+       }
+}
+
index 80da4f4..8efb885 100644 (file)
@@ -36,6 +36,7 @@ import java.util.zip.ZipEntry;
 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;
@@ -84,10 +85,10 @@ public class WindowsSDKPackageFormat extends 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) {
@@ -145,21 +146,11 @@ public class WindowsSDKPackageFormat extends SDKPackageFormat{
 
                                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();
                                }
@@ -176,14 +167,15 @@ public class WindowsSDKPackageFormat extends SDKPackageFormat{
                        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) {
index 458c6e2..4bfbaf1 100644 (file)
@@ -67,7 +67,6 @@ import org.tizen.installmanager.pkg.model.Property;
 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;
 
 
@@ -270,7 +269,10 @@ public abstract class PackageManager {
        
        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() {
@@ -287,6 +289,7 @@ public abstract class PackageManager {
                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);
@@ -406,7 +409,12 @@ public abstract class PackageManager {
         */
        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);
+               }
        }
        
        /**
@@ -414,19 +422,19 @@ public abstract class PackageManager {
         * @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")) {
@@ -439,6 +447,8 @@ public abstract class PackageManager {
                                        }
                        }
                }
+               
+               return true;
        }
        
        /**
@@ -499,6 +509,7 @@ public abstract class PackageManager {
                        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 {
@@ -1074,8 +1085,14 @@ public abstract class PackageManager {
        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;
index b3e9d65..5d6a2b7 100644 (file)
@@ -58,7 +58,6 @@ public class InstConfig {
                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");
                }
index 91f5980..e71942e 100644 (file)
@@ -92,10 +92,11 @@ public class Package {
        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 = "[";
        
@@ -126,12 +127,25 @@ public class Package {
                        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));                            
        }
        
        /**
@@ -345,14 +359,14 @@ public class Package {
                        }
                }
                
-               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;
@@ -428,6 +442,19 @@ public class Package {
        }
        
        /**
+        * @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() {
index bd62c06..d81141b 100644 (file)
@@ -29,6 +29,7 @@
 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;
 
@@ -52,18 +53,11 @@ public class Version {
      * @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) {
@@ -105,11 +99,34 @@ public class Version {
        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;
                        }
@@ -137,6 +154,20 @@ public class Version {
        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
index 55ce20e..8ed78dd 100644 (file)
@@ -72,6 +72,7 @@ import org.tizen.installmanager.lib.Platform;
 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;
@@ -94,6 +95,7 @@ import org.tizen.installmanager.ui.page.WelcomePage;
 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;
 
 
 /**
@@ -322,6 +324,10 @@ public class InstallManagerWindow extends ApplicationWindow {
                                        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);
@@ -463,7 +469,7 @@ public class InstallManagerWindow extends ApplicationWindow {
                                        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);
                                        
@@ -811,7 +817,9 @@ public class InstallManagerWindow extends ApplicationWindow {
         * @param args
         */
        public static void main(String args[]) {
+               //performance measurement
                Performance.setIMStartTime();
+               
                InstallManager.deleteTempFile();
                
                Log.open();
@@ -843,6 +851,12 @@ public class InstallManagerWindow extends ApplicationWindow {
                                        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)) {
@@ -852,6 +866,12 @@ public class InstallManagerWindow extends ApplicationWindow {
                                        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();
@@ -861,6 +881,20 @@ public class InstallManagerWindow extends ApplicationWindow {
                                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);
                        
@@ -918,9 +952,14 @@ public class InstallManagerWindow extends ApplicationWindow {
                                ProgramController.createProgramController().removeSDKTempDir();
                        }
                        
+                       //performance measurement
                        Performance.setIMEndTime();
                        Performance.printToLogFile();
                        
+                       if (Options.doTest) {
+                               Performance.printTestResultXmlFormat();
+                       }
+                       
                        Log.LogTitle("Installmanager finish");
                        Log.close();
                        
@@ -1022,6 +1061,35 @@ public class InstallManagerWindow extends ApplicationWindow {
        }
        
        /**
+        * 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.
         */
index 704e097..0198ace 100644 (file)
@@ -42,7 +42,7 @@ import org.tizen.installmanager.pkg.model.PackageSet;
 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;
@@ -326,6 +326,7 @@ public class Item implements Comparable<Item> {
         * @param CHECKED is true, this package is selected by tree view.
         */
        public void setCheckState(CheckState state) {
+               
                this.checkState = state;
        }
        
@@ -374,15 +375,13 @@ public class Item implements Comparable<Item> {
         */
        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()) {
@@ -392,23 +391,11 @@ public class Item implements Comparable<Item> {
                        } 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);
                        }
                }
        }
@@ -440,24 +427,6 @@ public class Item implements Comparable<Item> {
                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 "";
@@ -486,16 +455,16 @@ public class Item implements Comparable<Item> {
         * @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;
                }
        }
 
@@ -579,7 +548,19 @@ public class Item implements Comparable<Item> {
        }
        
        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
index 29abc84..8e36756 100644 (file)
@@ -199,6 +199,7 @@ public abstract class PackageListPage extends PageTemplate {
                                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());
@@ -380,16 +381,45 @@ public abstract class PackageListPage extends PageTemplate {
                        }
                }
        }
+       
+       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);
                }
@@ -398,13 +428,21 @@ public abstract class PackageListPage extends PageTemplate {
        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);
+                               }
+                       }
                }
        }
        
@@ -455,7 +493,6 @@ public abstract class PackageListPage extends PageTemplate {
                if (parentItem == null) {
                        return;
                }
-               
                setCheckStateByChildren(parentItem);
                
                if (parentItem.getParent() != null) {
@@ -593,10 +630,12 @@ public abstract class PackageListPage extends PageTemplate {
 
        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);
        }
 
@@ -606,7 +645,7 @@ public abstract class PackageListPage extends PageTemplate {
                }
        }
 
-       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();
                
@@ -614,10 +653,18 @@ public abstract class PackageListPage extends PageTemplate {
                        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);
+                                       }
                                }
                        }
                }
index 79404d2..df410c2 100644 (file)
@@ -246,7 +246,8 @@ public class UninstallingPage extends PageTemplate {
                                                }
                                        } 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());
                                        }
                                }
                        });
index 0432e97..00b6c79 100644 (file)
 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;
@@ -85,9 +80,6 @@ public class ViewController {
        private InstallManager installManager;
        private PackageManager packageManager;
        private SDKExtensionInfo sdkExtensionInfo;
-       
-       private FileLock lock = null;
-       private FileChannel channel = null;
 
        /**
         * Initialize objects which need to install.
@@ -296,9 +288,7 @@ public class ViewController {
         * @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);
@@ -339,7 +329,6 @@ public class ViewController {
                        PathUtil.remove(Config.getInstance().getDownloadDirPath());
                }
                
-               Performance.setInstallationEndTime();
                return bResult;
        }
        
@@ -367,29 +356,10 @@ public class ViewController {
                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
@@ -398,25 +368,36 @@ public class ViewController {
         * @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;
                }
        }
@@ -453,6 +434,10 @@ public class ViewController {
                return packageManager.getInstalledPackageByName(pkgName);
        }
        
+       public PackageSet getInstalledPackages() {
+               return packageManager.getInstalledPackages();
+       }
+       
        /**
         * Get items of tree
         * @return
@@ -606,7 +591,7 @@ public class ViewController {
                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 {
@@ -782,6 +767,7 @@ public class ViewController {
                
                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;
@@ -864,7 +850,7 @@ public class ViewController {
                if (size > 0) {
                        return true;
                } else {
-                       return false;
+                       throw new IMFatalException(ErrorCode.CANNOT_UNPACK_PACKAGE);
                }
        }
        
index 2fe6c04..b75dba8 100644 (file)
@@ -7,6 +7,6 @@ The licenses governing the Software("Licenses") are available at: https://develo
  
 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
diff --git a/os_stubs/linux/install-manager-test.sh b/os_stubs/linux/install-manager-test.sh
new file mode 100755 (executable)
index 0000000..1e56bb6
--- /dev/null
@@ -0,0 +1,23 @@
+#!/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"
index ff93227..cf810df 100755 (executable)
@@ -39,7 +39,7 @@ OUT_PATH="/tmp/tizensdk_${MYTIMESTAMP}"
 
 # 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
@@ -125,7 +125,7 @@ if [ "ubuntu" = "${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
index e35b8c7..ba96a82 100755 (executable)
@@ -19,9 +19,13 @@ MYTIMESTAMP=`date +"%Y%m%d%H%M%S"`
 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}
index 78d2629..6a7ea80 100644 (file)
@@ -8,9 +8,75 @@ Icon "SDK_icon.ico"
 \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
@@ -67,56 +133,98 @@ FunctionEnd
 !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
index f7de70c..4027edf 100644 (file)
@@ -11,6 +11,72 @@ Icon "SDK_icon.ico"
 !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
@@ -67,55 +133,95 @@ FunctionEnd
 !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
diff --git a/os_stubs/windows/install-manager-test.bat b/os_stubs/windows/install-manager-test.bat
new file mode 100644 (file)
index 0000000..6bc15ea
--- /dev/null
@@ -0,0 +1,21 @@
+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%
+
diff --git a/os_stubs/windows/javacheck-32.exe b/os_stubs/windows/javacheck-32.exe
deleted file mode 100644 (file)
index 4276b1f..0000000
Binary files a/os_stubs/windows/javacheck-32.exe and /dev/null differ
diff --git a/os_stubs/windows/javacheck-64.exe b/os_stubs/windows/javacheck-64.exe
deleted file mode 100644 (file)
index b08ca86..0000000
Binary files a/os_stubs/windows/javacheck-64.exe and /dev/null differ
index 7455ee8..cb839bb 100755 (executable)
@@ -1,6 +1,7 @@
 #!/bin/bash -ex
 buildDir="${SRCDIR}/build"
 targetBinary="inst-manager"
+testBinary="install-manager-test.sh"
 
 ##make config file
 buildConfigFile() {
@@ -90,4 +91,13 @@ install()
        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
 }
index 10e9997..88aa7bd 100755 (executable)
@@ -1,6 +1,7 @@
 #!/bin/bash -ex
 buildDir="${SRCDIR}/build"
 targetBinary="inst-manager"
+testBinary="install-manager-test.sh"
 
 ##make config file
 buildConfigFile() {
@@ -101,4 +102,13 @@ install()
        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
 }
index 3010568..18de018 100755 (executable)
@@ -1,6 +1,7 @@
 #!/bin/bash -ex
 buildDir="${SRCDIR}/build"
 targetBinary="inst-manager"
+testBinary="install-manager-test.bat"
 
 ##make config file
 buildConfigFile() {
@@ -38,17 +39,11 @@ makeExecutable() {
        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!"
@@ -99,4 +94,13 @@ install()
        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
 }
index c69b6b6..4cf008b 100644 (file)
@@ -1,3 +1,71 @@
+*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.
index 657a519..18a6b11 100644 (file)
@@ -1,5 +1,5 @@
 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
@@ -51,3 +51,68 @@ Package: install-manager-standalone
 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