From: donghee yang Date: Tue, 16 Jul 2013 08:39:04 +0000 (+0900) Subject: 2013-07-16 sources upload X-Git-Tag: 2.2.1_release~3 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=e24829ea63dd4d48615cfa6cc87a974cf03eb2ea;p=sdk%2Finstaller%2Finstall-manager.git 2013-07-16 sources upload Change-Id: Iaa8115dd1649fa2ced64e07196b5918d90e1185d --- diff --git a/ChangeLog b/ChangeLog deleted file mode 100644 index 7ad8c90..0000000 --- a/ChangeLog +++ /dev/null @@ -1,11 +0,0 @@ -Install Manager ChangeLog - -== Version 2.0.4 == -* 4-September-2012 - * [N] Add check box to select the latest snapshot. - -== Version 2.0.3 == -* 31-August-2012 - * [N] Shihyun kim / always enable to use connectable proxy configuration - - diff --git a/InstallManager_java/installmanager.conf b/InstallManager_java/installmanager.conf index 5b6a3ee..30c55f2 100644 --- a/InstallManager_java/installmanager.conf +++ b/InstallManager_java/installmanager.conf @@ -3,7 +3,7 @@ InstallManager-Repository: Type: Package-Server: Server-Type: snapshot -InstallManager-Version: 2.0.0 -Distribution: release +InstallManager-Version: 2.3.0 +Distribution: tizen_2.2 Release-note: https://developer.tizen.org diff --git a/InstallManager_java/src/org/tizen/installmanager/cli/CliInstall.java b/InstallManager_java/src/org/tizen/installmanager/cli/CliInstall.java index a105453..5b01810 100644 --- a/InstallManager_java/src/org/tizen/installmanager/cli/CliInstall.java +++ b/InstallManager_java/src/org/tizen/installmanager/cli/CliInstall.java @@ -41,6 +41,7 @@ import org.tizen.installmanager.core.DistributionController; import org.tizen.installmanager.core.IMExitException; 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.lib.Downloader; import org.tizen.installmanager.lib.ErrorController; @@ -49,6 +50,7 @@ import org.tizen.installmanager.lib.Log; import org.tizen.installmanager.lib.Platform; import org.tizen.installmanager.lib.ErrorController.ErrorCode; import org.tizen.installmanager.lib.NetworkProxy.ProxyType; +import org.tizen.installmanager.lib.Registry; import org.tizen.installmanager.lib.exception.IMNetworkException; import org.tizen.installmanager.lib.linux.LinuxFileSystemInfo; import org.tizen.installmanager.lib.win.WindowsFileSystemInfo; @@ -65,7 +67,6 @@ import org.tizen.installmanager.util.PathUtil; public class CliInstall { private static final String DISTRIBUTION_INFO = "distribution.info"; private static final String ESSENTIAL_COMPONENT = "ESSENTIAL-COMPONENT"; - private static final String WINDOWS_DEFAULT_TARGET_PATH = "C:\\tizen-sdk"; private static ViewController controller = null; @@ -87,7 +88,9 @@ public class CliInstall { PackageManager pm = PackageManager.getInstance(); - String targetDir = setTargetDir(); + String targetDir = getTargetDir(); + Registry.sdkWorkSpacePath = getSDKDataPath(); + Config.USER_CONFIG_HOME_PATH = getSDKDataPath(); if (packageNames.contains("all")) { if (checkAvailableSize(getAllPackages(), targetDir)) { @@ -358,7 +361,7 @@ public class CliInstall { * When cli installation, sets SDK target directory as user input. * @return SDK install directory. */ - private static String setTargetDir() { + private static String getTargetDir() { String inputTargetDir = Options.targetDir; String targetDir = null; @@ -367,7 +370,7 @@ public class CliInstall { if (Platform.isLinux() || Platform.isMacOS()) { targetDir = System.getProperty("user.home") + File.separator + Config.SDK_DIRECTORY; } else if (Platform.isWindows()) { - targetDir = WINDOWS_DEFAULT_TARGET_PATH; + targetDir = InstallManagerConstants.WINDOWS_DEFAULT_TARGET_PATH; } else { throw new IMFatalException(ErrorCode.UNSUPPORTED_PLATFORM); } @@ -387,6 +390,35 @@ public class CliInstall { return targetDir; } + private static String getSDKDataPath() { + String inputDataDir = Options.sdkDataPath; + + String dataDir = null; + + if (inputDataDir == null) { + if (Platform.isLinux() || Platform.isMacOS()) { + dataDir = System.getProperty("user.home") + File.separator + Config.SDK_DIRECTORY; + } else if (Platform.isWindows()) { + dataDir = InstallManagerConstants.WINDOWS_DEFAULT_DATA_PATH; + } else { + throw new IMFatalException(ErrorCode.UNSUPPORTED_PLATFORM); + } + } else if (inputDataDir.startsWith("~")) { + dataDir = inputDataDir.replaceFirst("~", System.getProperty("user.home")); + if (checkCorrectPath(dataDir)) { + return inputDataDir; + } else { + return null; + } + } else if (checkCorrectPath(inputDataDir)) { + dataDir = inputDataDir; + } else { + return null; + } + + return dataDir; + } + /** * Check path which is correct depend on platform. * @param targetPath diff --git a/InstallManager_java/src/org/tizen/installmanager/core/Config.java b/InstallManager_java/src/org/tizen/installmanager/core/Config.java index a0c66ef..630a226 100644 --- a/InstallManager_java/src/org/tizen/installmanager/core/Config.java +++ b/InstallManager_java/src/org/tizen/installmanager/core/Config.java @@ -506,6 +506,7 @@ public class Config { * @return */ public boolean makeConfigHome() { + Log.log("Create config home."); boolean bResult = true; File configHomeDirFile = null; @@ -540,7 +541,6 @@ public class Config { * @return true if success. */ public boolean makeInfoDirectory() { - boolean bResult = makeConfigHome(); if (bResult) { @@ -658,11 +658,25 @@ public class Config { } catch (UnsupportedEncodingException e) { Log.ExceptionLog(e); return encodeRepository; - } + } - String downloadPath = PathUtil.get(Config.INSTALL_MANAGER_TEMP_DIRECTORY, - INSTALL_MANAGER_DOWNLOAD_DIRECTORY_NAME, encodeRepository); - return downloadPath; + return PathUtil.get(getDownloadDirPath(), encodeRepository); + } + + /** + * get downloaded directory path + * @return + */ + public String getDownloadDirPath() { + if (mTargetDir == null || mTargetDir.isEmpty()) { + return PathUtil.get(Config.INSTALL_MANAGER_TEMP_DIRECTORY, + INSTALL_MANAGER_DOWNLOAD_DIRECTORY_NAME); + } else { + return PathUtil.get( + mTargetDir, + InstallManagerConstants.SDK_CONFIGURATION_DIR, + INSTALL_MANAGER_DOWNLOAD_DIRECTORY_NAME); + } } public static void setSelectedSDKPath(String path) { diff --git a/InstallManager_java/src/org/tizen/installmanager/core/InstallManager.java b/InstallManager_java/src/org/tizen/installmanager/core/InstallManager.java index a8ecc17..b2d1a54 100644 --- a/InstallManager_java/src/org/tizen/installmanager/core/InstallManager.java +++ b/InstallManager_java/src/org/tizen/installmanager/core/InstallManager.java @@ -123,7 +123,7 @@ public class InstallManager { Log.log("Loading config file failed"); throw new IMFatalException("Loading configuration file failed"); } - + if (!Registry.getInstalledPath().isEmpty()) { mConfig.setTargetDir(Registry.getInstalledPath()); } @@ -485,7 +485,7 @@ public class InstallManager { for (Package pkg : downloadPkgSet) { if (monitor != null) { - monitor.setProgressTitle(pkg.getPackageName()); + monitor.workedDownload(pkg.getPackageName()); } else { if (Options.doInstallNoUI) { System.out.println(pkg.getPackageName() + " is downloading..."); @@ -534,7 +534,7 @@ public class InstallManager { } // Check cache foler - if (existInCacheFolder(packageToDownload, fileDownloadTargetPath)) { + if (existInCacheFolder(packageToDownload, fileDownloadTargetPath, monitor)) { if (monitor != null) { if (monitor.isCanceled()) { throw new IMFatalException(ErrorCode.CANCEL); @@ -612,12 +612,16 @@ public class InstallManager { * @return true if the package is already downloaded to the * file path */ - private boolean existInCacheFolder(Package pkg, String filePath) { + private boolean existInCacheFolder(Package pkg, String filePath, IIMProgressMonitor monitor) { File file = new File(filePath); if (!file.exists()) { return false; } + + if (monitor != null) { + monitor.workedChecksum(pkg.getPackageName()); + } if (Options.doPackageValidation) { if (Checksum.getSHA256(filePath) != null) { @@ -667,7 +671,7 @@ public class InstallManager { Log.log("Install package '" + pkg + "'"); if (monitor != null) { - monitor.setProgressTitle(pkg.getPackageName()); + monitor.workedProcess(pkg.getPackageName()); } else { if (Options.doInstallNoUI) { System.out.println(pkg.getPackageName() + " is installing..."); @@ -704,12 +708,14 @@ public class InstallManager { InstallProgressMonitor monitor) throws IMExitException, IMNetworkException{ Log.log("InstallManager.install() installable packages : " + installablePackages); - if (installablePackages == null || targetDir == null) { + if (installablePackages == null || targetDir == null || targetDir.isEmpty()) { Log.err("packaegs => " + installablePackages + ", targetDir => " + targetDir); return false; } + mConfig.setTargetDir(targetDir); + // download packages from repository if (downloadPackages(installablePackages, monitor)) { Log.log("Success to download packages from repository."); @@ -783,7 +789,6 @@ public class InstallManager { if (!installInstallManagerFromLocal(targetDir)) { Log.err("Cannot install install-manager from local directory."); } - } int i = 0; @@ -820,8 +825,7 @@ public class InstallManager { // move InstallManager to target directory if (monitor != null) { - monitor.setFileName("Move to target directory..."); - monitor.workedFileName(); + monitor.workedSubTitle("Move to target directory..."); } if (Config.status == Config.Status.INSTALL) { @@ -941,7 +945,7 @@ public class InstallManager { Log.log("Remove missing packages => " + missingPackages); if (monitor != null) { - monitor.setProgressTitle("Remove Missing Packages"); + monitor.workedTitle("Remove Missing Packages"); } for (Package pkg : missingPackages) { @@ -958,9 +962,13 @@ public class InstallManager { PackageSet conflictPackages = packageManager .getConflictPackagesInUpdate(installableMetaPkgs); Log.log("Remove conflict packages => " + conflictPackages); + + if (conflictPackages.isEmpty()) { + return true; + } if (monitor != null) { - monitor.setProgressTitle("Remove Conflict Packages"); + monitor.workedTitle("Remove Conflict Packages"); } return remove(conflictPackages); @@ -970,11 +978,15 @@ public class InstallManager { IIMProgressMonitor monitor) { PackageSet updatablePackages = packageManager .getdifferentVersionFromInstalledPackages(installablePackages); + + if (updatablePackages.isEmpty()) { + return true; + } Log.log("Remove packages in snapshot => " + updatablePackages); if (monitor != null) { - monitor.setProgressTitle("Remove updatable Packages"); + monitor.workedTitle("Remove updatable Packages..."); } return remove(updatablePackages); @@ -983,11 +995,15 @@ public class InstallManager { IIMProgressMonitor monitor) { PackageSet updatablePackages = packageManager .getUpdatablePackagesInUpdate(installablePackages); + + if (updatablePackages.isEmpty()) { + return true; + } Log.log("Remove updatable packages => " + updatablePackages); if (monitor != null) { - monitor.setProgressTitle("Remove updatable Packages"); + monitor.workedTitle("Remove updatable Packages"); } return remove(updatablePackages); @@ -1252,7 +1268,7 @@ public class InstallManager { } if (monitor != null) { - monitor.setProgressTitle(pkg.getPackageName()); + monitor.workedTitle(pkg.getPackageName()); } if (Options.doRemoveNoUI || Options.doInstallNoUI) { @@ -1313,7 +1329,7 @@ public class InstallManager { if (!packageManager.existInstalledMetaPackages()) { Log.log("Installed meta packages do not exist"); if (monitor != null) { - monitor.setFileName("Remove target directory..."); + monitor.workedSubTitle("Remove target directory..."); monitor.worked(pkgsToRemove.size()); } @@ -1346,7 +1362,7 @@ public class InstallManager { Log.log("Remove all packages."); if (monitor != null) { - monitor.setProgressTitle(REMOVE_ALL_PACKAGES); + monitor.workedTitle(REMOVE_ALL_PACKAGES); } PackageSet removablePackages = packageManager.getInstalledPackages(); @@ -1365,7 +1381,7 @@ public class InstallManager { Log.log("InstallManager removeSDK start"); if (monitor != null) { - monitor.setProgressTitle(REMOVE_ALL_SDK_FILES); + monitor.workedTitle(REMOVE_ALL_SDK_FILES); } removeInstallManager(); diff --git a/InstallManager_java/src/org/tizen/installmanager/core/InstallManagerConstants.java b/InstallManager_java/src/org/tizen/installmanager/core/InstallManagerConstants.java index 38c454b..abda8c4 100644 --- a/InstallManager_java/src/org/tizen/installmanager/core/InstallManagerConstants.java +++ b/InstallManager_java/src/org/tizen/installmanager/core/InstallManagerConstants.java @@ -21,6 +21,17 @@ public class InstallManagerConstants { final static public String DESKTOP_SHORTCUT_IMAGE_NAME = getDesktopShortcutImageName(); final static public String DESKTOP_SHORTCUT_IMAGE_PATH = PathUtil.get("/res", "desktop_directory", DESKTOP_SHORTCUT_IMAGE_NAME); + //target directory path + final static public String WINDOWS_DEFAULT_TARGET_PATH = "C:\\tizen-sdk"; + final static public String WINDOWS_DEFAULT_DATA_PATH = "C:\\tizen-sdk-data"; + + //sdk configuration file + 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); + + static String getInstallManagerBinaryName() { if (Platform.isLinux()) { return INSTALLMANAGER_EXECUTALBE_FILE_NAME_FOR_LINUX; diff --git a/InstallManager_java/src/org/tizen/installmanager/core/Installer.java b/InstallManager_java/src/org/tizen/installmanager/core/Installer.java index de103aa..525b9a8 100644 --- a/InstallManager_java/src/org/tizen/installmanager/core/Installer.java +++ b/InstallManager_java/src/org/tizen/installmanager/core/Installer.java @@ -118,8 +118,24 @@ public class Installer { Log.log("All files moved properly."); } - executeInstallScript(pack, monitor, tempDir); + if (!executeInstallScript(pack, monitor, tempDir)) { + Log.err("Fail to execute install script."); + throw new IMFatalException(ErrorCode.INSTALL_SCRIPT_FATAL_ERROR); + } + if (!moveRemoveScript(tempDir, pack)) { + return false; + } + +// if (!moveInstallScript(tempDir, pack)) { +// return false; +// } + + PathUtil.remove(tempDir); + return true; + } + + private boolean moveRemoveScript(String tempDir, Package pack) { // move removeScript file to special Directory File removeScriptFrom = new File(tempDir + File.separator + pack.getRemoveScript()); @@ -145,7 +161,35 @@ public class Installer { } } } - PathUtil.remove(tempDir); + 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; } @@ -236,9 +280,9 @@ public class Installer { if (Options.interactive) { env.put("INTERACTIVE", "true"); - env.put("SUPASS", Options.suPass); } else { env.put("INTERACTIVE", "false"); + env.put("SUPASS", Options.suPass); } return env; @@ -269,6 +313,12 @@ 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( @@ -420,6 +470,16 @@ 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) { @@ -432,8 +492,7 @@ public class Installer { Log.log("Execute install script"); if (monitor != null) { - monitor.setFileName(scriptFile.getName()); - monitor.workedFileName(); + monitor.workedSubTitle(scriptFile.getName()); } try { return executeScript(scriptFile); @@ -459,8 +518,7 @@ public class Installer { if (scriptFile.exists()) { if (monitor != null) { - monitor.setFileName(scriptFile.getName()); - monitor.workedFileName(); + monitor.workedSubTitle(scriptFile.getName()); } try { @@ -496,18 +554,18 @@ public class Installer { // check exit code if (exitCode == 0) { return true; - } else if (exitCode > 0 && exitCode < 10) { + } else if (exitCode == 1) { Log.err("Exit code => " + Integer.toString(exitCode)); return false; } else if (exitCode == 99) { ErrorController.setInfoCode(InfoCode.RESTART_THE_COMPUTER); Log.log("Set restart message."); return true; - } else { + } else { Log.err("Installer.executeScript() install script error => " + scriptFile.getAbsolutePath()); Log.err("Exit code => " + Integer.toString(exitCode)); - throw new IMFatalException(ErrorCode.INSTALL_SCRIPT_FATAL_ERROR); + throw new IMFatalException(ErrorCode.SCRIPT_FATAL_ERROR); } } } diff --git a/InstallManager_java/src/org/tizen/installmanager/core/Options.java b/InstallManager_java/src/org/tizen/installmanager/core/Options.java index 855db8b..e76779c 100644 --- a/InstallManager_java/src/org/tizen/installmanager/core/Options.java +++ b/InstallManager_java/src/org/tizen/installmanager/core/Options.java @@ -28,7 +28,6 @@ package org.tizen.installmanager.core; -import java.io.File; import java.util.ArrayList; import java.util.Arrays; import java.util.Iterator; @@ -122,12 +121,16 @@ public class Options { */ public static boolean snapshot = false; + /** + * Use cli mode + */ public static String repository = null; public static String imageFilePath = null; public static String snapshotPath = null; public static ServerType serverType = null; public static String distribution = null; public static String targetDir = null; + public static String sdkDataPath = null; public static boolean isNetwork = true; @@ -374,6 +377,7 @@ public class Options { private static void workCliOptions(String[] args) { ArrayList argArray = new ArrayList(); + for (String t : args) { if (!t.equalsIgnoreCase("-install") && !t.equalsIgnoreCase("-remove")) { argArray.add(t); @@ -381,8 +385,16 @@ public class Options { } Iterator argIter = argArray.iterator(); - + while (argIter.hasNext()) { + if (argIter.next().equalsIgnoreCase("-path")) { + argIter.remove(); + argIter.next(); + argIter.remove(); + } + } + // set repository + argIter = argArray.iterator(); while (argIter.hasNext()) { if (argIter.next().equalsIgnoreCase("-r")) { argIter.remove(); @@ -421,6 +433,15 @@ public class Options { argIter.remove(); } } + + argIter = argArray.iterator(); + while (argIter.hasNext()) { + if (argIter.next().equalsIgnoreCase("-w")) { + argIter.remove(); + sdkDataPath = argIter.next(); + argIter.remove(); + } + } // set distribution argIter = argArray.iterator(); @@ -438,8 +459,13 @@ public class Options { if (argIter.next().equalsIgnoreCase("-p")) { argIter.remove(); while (argIter.hasNext()) { - packages.add(argIter.next()); - argIter.remove(); + String pkg = argIter.next(); + if (!pkg.startsWith("-")) { + packages.add(pkg); + argIter.remove(); + } else { + break; + } } } } @@ -468,6 +494,7 @@ public class Options { if (!argIter.next().equalsIgnoreCase("-passwd")) { throw new IMFatalException(ErrorCode.WRONG_OPTION); } else { + argIter.remove(); if (argIter.hasNext()) { suPass = argIter.next(); interactive = false; @@ -478,8 +505,12 @@ public class Options { } } } else if (Platform.isWindows()) { - interactive = false; - } + interactive = true; + } else if (Platform.isMacOS()) { + interactive = true; + } else { + throw new IMFatalException(ErrorCode.UNSUPPORTED_PLATFORM); + } } else { throw new IMFatalException(ErrorCode.WRONG_OPTION); } diff --git a/InstallManager_java/src/org/tizen/installmanager/lib/ErrorController.java b/InstallManager_java/src/org/tizen/installmanager/lib/ErrorController.java index ffb575e..b0670d9 100644 --- a/InstallManager_java/src/org/tizen/installmanager/lib/ErrorController.java +++ b/InstallManager_java/src/org/tizen/installmanager/lib/ErrorController.java @@ -102,6 +102,7 @@ public class ErrorController { 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."), + SCRIPT_FATAL_ERROR("Fatal error occurred while executing post script."), // Network error INTERNET_CONNECTION_ERROR("Server connection failed. Check the network status or set InstallManager settings."), diff --git a/InstallManager_java/src/org/tizen/installmanager/lib/IIMProgressMonitor.java b/InstallManager_java/src/org/tizen/installmanager/lib/IIMProgressMonitor.java index 75b87ec..b5a9f6f 100644 --- a/InstallManager_java/src/org/tizen/installmanager/lib/IIMProgressMonitor.java +++ b/InstallManager_java/src/org/tizen/installmanager/lib/IIMProgressMonitor.java @@ -37,20 +37,24 @@ import org.eclipse.core.runtime.IProgressMonitor; * */ public interface IIMProgressMonitor extends IProgressMonitor{ + /** - * set name of package. - * @param name + * Display title of progress bar. + * @param title */ - public void setProgressTitle(String name); + public void workedTitle(String title); + /** - * set file name while installing or uninstalling - * @param name + * Display title of progress bar. + * @param title */ - public void setFileName(String name); + public void workedChecksum(String title); + /** - * Display file name to UI. + * Display subtitle of progress bar. */ - public void workedFileName(); + public void workedSubTitle(String subTitle); + /** * Display download size to UI. * @param size @@ -78,4 +82,16 @@ public interface IIMProgressMonitor extends IProgressMonitor{ */ public void workedProgressbar(int percent); public void setError(int errorCode); + + /** + * Set progress package name to title. + * @param title + */ + void workedProcess(String title); + + /** + * Set file name to download. + * @param title + */ + void workedDownload(String title); } diff --git a/InstallManager_java/src/org/tizen/installmanager/lib/Registry.java b/InstallManager_java/src/org/tizen/installmanager/lib/Registry.java index 9a7e0a3..48903d7 100644 --- a/InstallManager_java/src/org/tizen/installmanager/lib/Registry.java +++ b/InstallManager_java/src/org/tizen/installmanager/lib/Registry.java @@ -40,6 +40,8 @@ import java.util.ArrayList; import org.tizen.installmanager.core.Config; import org.tizen.installmanager.core.IMFatalException; +import org.tizen.installmanager.core.InstallManagerConstants; +import org.tizen.installmanager.core.Options; import org.tizen.installmanager.lib.ErrorController.ErrorCode; import org.tizen.installmanager.util.PathUtil; @@ -53,12 +55,11 @@ public class Registry { //installed path. public static final String REGISTRY_FILE_NAME = "tizensdkpath"; public static final String MULTI_SDK_FILE_NAME = "multisdkpath"; - private static final String SDK_INFORMATION_FILE_NAME = "sdk.info"; - private static final String REGISTRY_FILE_PATH = PathUtil.get( + public static final String REGISTRY_FILE_PATH = PathUtil.get( Config.INSTALL_MANAGER_CONFIG, REGISTRY_FILE_NAME); private static final String OLD_REGISTRY_FILE_PATH = PathUtil.get( Config.getConfigHome(), REGISTRY_FILE_NAME); - private static final String MULTI_SDK_FILE_PATH = PathUtil.get( + public static final String MULTI_SDK_FILE_PATH = PathUtil.get( Config.INSTALL_MANAGER_CONFIG, MULTI_SDK_FILE_NAME); private static final String INSTALLED_PATH_KEY = "TIZEN_SDK_INSTALLED_PATH"; private static final String SDK_DATA_PATH_KEY = "TIZEN_SDK_DATA_PATH"; @@ -145,7 +146,7 @@ public class Registry { } File installedPathFile = new File(MULTI_SDK_FILE_PATH); - if (!installedPathFile.exists()) { + if (!installedPathFile.exists() || Options.doInstallNoUI || Options.doRemoveNoUI) { try { installedPathFile = PathUtil.makeNewFile(MULTI_SDK_FILE_PATH); } catch (IOException e) { @@ -221,7 +222,7 @@ public class Registry { String sdkInfoPath = ""; if (current != null) { - sdkInfoPath = PathUtil.get(current.getParent(), SDK_INFORMATION_FILE_NAME); + sdkInfoPath = PathUtil.get(current.getParent(), InstallManagerConstants.SDK_INFORMATION_FILE_NAME); } File sdkInfoFile = new File(sdkInfoPath); @@ -234,10 +235,25 @@ public class Registry { return currentInstalledSDKPath; } + /** + * When installmanager updates SDK, installmanager have to know sdk information from sdk.info file. + * @param sdkPath + */ + 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); + Log.log("sdk.info file exists. => " + sdkPath); + Log.log("InstallManager can set sdk environment."); + } else { + Log.log("sdk.info file does not exist. => " + sdkPath); + } + } + public static String getInstalledPathForUpdate() { return getPathFromRegistryKey(REGISTRY_FILE_PATH, INSTALLED_PATH_KEY); } - + private static String getPathFromRegistryKey(String path, String registryKey) { File file = new File(path); @@ -441,7 +457,7 @@ public class Registry { throw new IMFatalException(ErrorCode.INVALID_INSTALL_PATH); } - String sdkInfoPath = PathUtil.get(installPath, SDK_INFORMATION_FILE_NAME); + 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; diff --git a/InstallManager_java/src/org/tizen/installmanager/lib/linux/LinuxSDKPackageFormat.java b/InstallManager_java/src/org/tizen/installmanager/lib/linux/LinuxSDKPackageFormat.java index 0e434b5..f70184a 100644 --- a/InstallManager_java/src/org/tizen/installmanager/lib/linux/LinuxSDKPackageFormat.java +++ b/InstallManager_java/src/org/tizen/installmanager/lib/linux/LinuxSDKPackageFormat.java @@ -91,6 +91,10 @@ public class LinuxSDKPackageFormat extends SDKPackageFormat{ } catch (IMShellCommandFail e) { return ERROR; } + + if (monitor != null) { + monitor.workedSubTitle(""); + } return SUCCESS; } @@ -106,6 +110,7 @@ public class LinuxSDKPackageFormat extends SDKPackageFormat{ } int exitValue = ShellUtil.execute(command, null, null, parser); + return exitValue; } diff --git a/InstallManager_java/src/org/tizen/installmanager/lib/linux/LinuxShellInstalledListParser.java b/InstallManager_java/src/org/tizen/installmanager/lib/linux/LinuxShellInstalledListParser.java index 620949a..7140c7a 100644 --- a/InstallManager_java/src/org/tizen/installmanager/lib/linux/LinuxShellInstalledListParser.java +++ b/InstallManager_java/src/org/tizen/installmanager/lib/linux/LinuxShellInstalledListParser.java @@ -100,8 +100,7 @@ public class LinuxShellInstalledListParser extends ShellParser { private void setMonitorFile() { if (mMonitor != null) { - mMonitor.setFileName(fileName); - mMonitor.workedFileName(); + mMonitor.workedSubTitle(fileName); } } @@ -114,8 +113,7 @@ public class LinuxShellInstalledListParser extends ShellParser { if (mMonitor != null) { String name = PathUtil.getFileName(line); - mMonitor.setFileName(name); - mMonitor.workedFileName(); + mMonitor.workedSubTitle(name); } } diff --git a/InstallManager_java/src/org/tizen/installmanager/lib/win/WindowsSDKPackageFormat.java b/InstallManager_java/src/org/tizen/installmanager/lib/win/WindowsSDKPackageFormat.java index 423b561..80da4f4 100644 --- a/InstallManager_java/src/org/tizen/installmanager/lib/win/WindowsSDKPackageFormat.java +++ b/InstallManager_java/src/org/tizen/installmanager/lib/win/WindowsSDKPackageFormat.java @@ -103,8 +103,7 @@ public class WindowsSDKPackageFormat extends SDKPackageFormat{ while (zipEntry != null) { if (monitor != null) { String fileName = PathUtil.getFileName(zipEntry.getName()); - monitor.setFileName(fileName); - monitor.workedFileName(); + monitor.workedSubTitle(fileName); } String targetPath = targetDir.getAbsolutePath() + File.separator + zipEntry.getName(); diff --git a/InstallManager_java/src/org/tizen/installmanager/ui/InstallManagerWindow.java b/InstallManager_java/src/org/tizen/installmanager/ui/InstallManagerWindow.java index 04a46a7..8f7f32b 100644 --- a/InstallManager_java/src/org/tizen/installmanager/ui/InstallManagerWindow.java +++ b/InstallManager_java/src/org/tizen/installmanager/ui/InstallManagerWindow.java @@ -64,7 +64,6 @@ import org.tizen.installmanager.core.IMExitException; import org.tizen.installmanager.core.IMFatalException; import org.tizen.installmanager.core.InstallManager; import org.tizen.installmanager.core.Options; -import org.tizen.installmanager.lib.Documents; import org.tizen.installmanager.lib.ErrorController; import org.tizen.installmanager.lib.IMError; import org.tizen.installmanager.lib.Log; @@ -282,10 +281,12 @@ public class InstallManagerWindow extends ApplicationWindow { "Are you sure to quit Install Manager?\n\nIf you click \"Yes\", the uninstallation is stopped.", DialogType.WARNING, false); } else if (sl_composite.topControl == compositeCompletePage) { - btnClose.setText("close"); - if (Documents.isChecked()) { - Documents.showChangeLog(); // show the change log(history) + controller.showChangeLog(); + + if (!Options.doResumeDownloading) { + controller.cleanUpTargetDirectory(); } + result = MessageBoxDlg.YES; } else { result = MessageBoxDlg.showDlg(e.display.getActiveShell(), @@ -463,6 +464,7 @@ public class InstallManagerWindow extends ApplicationWindow { Config.USER_CONFIG_HOME_PATH = compositeSetInstallDirectoryPage.getSDKWorkSpacePath(); Registry.sdkWorkSpacePath = controller.getSDKWorkSpacePath(); Registry.targetPath = controller.getInstallPath(); + Registry.saveSDKInfo(Registry.targetPath); InstallManager.getInstance().initPackageList(); @@ -891,6 +893,13 @@ public class InstallManagerWindow extends ApplicationWindow { Log.err("Unexpected error occurred"); Log.ExceptionLog(e); + if (Options.doInstallNoUI || Options.doRemoveNoUI) { + PathUtil.remove(Registry.REGISTRY_FILE_PATH); + PathUtil.remove(Registry.MULTI_SDK_FILE_PATH); + System.out.println("Fatal error occurred."); + System.exit(0); + } + // show error message if (window != null) { window.open(); diff --git a/InstallManager_java/src/org/tizen/installmanager/ui/page/CompletePage.java b/InstallManager_java/src/org/tizen/installmanager/ui/page/CompletePage.java index ab358df..b718534 100644 --- a/InstallManager_java/src/org/tizen/installmanager/ui/page/CompletePage.java +++ b/InstallManager_java/src/org/tizen/installmanager/ui/page/CompletePage.java @@ -29,10 +29,7 @@ package org.tizen.installmanager.ui.page; import java.awt.Desktop; -import java.io.BufferedWriter; import java.io.File; -import java.io.FileWriter; -import java.io.IOException; import org.eclipse.swt.SWT; import org.eclipse.swt.custom.StyledText; @@ -43,10 +40,7 @@ import org.eclipse.swt.widgets.Composite; import org.eclipse.swt.widgets.Display; import org.eclipse.swt.widgets.Label; import org.tizen.installmanager.core.Config; -import org.tizen.installmanager.core.IMFatalException; -import org.tizen.installmanager.lib.Log; import org.tizen.installmanager.lib.Platform; -import org.tizen.installmanager.lib.ErrorController.ErrorCode; import org.tizen.installmanager.ui.InstallManagerWindow; import org.tizen.installmanager.ui.dialog.MessageBoxDlg; import org.tizen.installmanager.ui.dialog.MessageBoxDlg.DialogType; diff --git a/InstallManager_java/src/org/tizen/installmanager/ui/page/InstallingPage.java b/InstallManager_java/src/org/tizen/installmanager/ui/page/InstallingPage.java index 3f01187..5c1202e 100644 --- a/InstallManager_java/src/org/tizen/installmanager/ui/page/InstallingPage.java +++ b/InstallManager_java/src/org/tizen/installmanager/ui/page/InstallingPage.java @@ -52,7 +52,6 @@ import org.tizen.installmanager.lib.ErrorController.ErrorCode; import org.tizen.installmanager.ui.InstallManagerWindow; import org.tizen.installmanager.ui.dialog.MessageBoxDlg; import org.tizen.installmanager.ui.dialog.MessageBoxDlg.DialogType; -import org.tizen.installmanager.ui.page.WelcomePage.RADIO_ACTION; /** * @author Taeyoung Son @@ -398,21 +397,6 @@ public class InstallingPage extends PageTemplate { // Do nothing. } - @Override - public void setProgressTitle(String name) { - mProgressTitle = name; - } - - @Override - public void setFileName(String name) { - if (name.length() > MAX_LENGTH) { - mSubTitle = name.substring(0, MAX_LENGTH - 2); - mSubTitle = mSubTitle + STRING_ETC; - } else { - mSubTitle = name; - } - } - /** * set working package name to show during installing */ @@ -432,16 +416,44 @@ public class InstallingPage extends PageTemplate { } }); } + + /** + * set working file name to show during installing + */ + @Override + public void workedTitle(String title) { + mProgressTitle = title; + + if (display == null || display.isDisposed()) { + setCanceled(true); + return; + } + + display.syncExec(new Runnable() { + @Override + public void run() { + statusLabel.setText(mProgressTitle); + } + }); + } /** * set working file name to show during installing */ @Override - public void workedFileName() { + public void workedSubTitle(String subTitle) { + if (subTitle.length() > MAX_LENGTH) { + mSubTitle = subTitle.substring(0, MAX_LENGTH - 2); + mSubTitle = mSubTitle + STRING_ETC; + } else { + mSubTitle = subTitle; + } + if (display == null || display.isDisposed()) { setCanceled(true); return; } + display.syncExec(new Runnable() { @Override public void run() { @@ -449,6 +461,36 @@ public class InstallingPage extends PageTemplate { } }); } + + @Override + public void workedProcess(String title) { + if (title == null || title.isEmpty()) { + return; + } + + String processTitle = "Processing : package \"" + title + "\""; + workedTitle(processTitle); + } + + @Override + public void workedDownload(String title) { + if (title == null || title.isEmpty()) { + return; + } + + String processTitle = "Downloading : " + title; + workedTitle(processTitle); + } + + @Override + public void workedChecksum(String title) { + if (title == null || title.isEmpty()) { + return; + } + + String processTitle = "File checking : " + title; + workedTitle(processTitle); + } /** * check validation of download diff --git a/InstallManager_java/src/org/tizen/installmanager/ui/page/SetInstallDirectoryPage.java b/InstallManager_java/src/org/tizen/installmanager/ui/page/SetInstallDirectoryPage.java index 264c1cf..57eb78f 100644 --- a/InstallManager_java/src/org/tizen/installmanager/ui/page/SetInstallDirectoryPage.java +++ b/InstallManager_java/src/org/tizen/installmanager/ui/page/SetInstallDirectoryPage.java @@ -47,6 +47,7 @@ import org.eclipse.swt.widgets.Label; import org.eclipse.swt.widgets.Text; import org.tizen.installmanager.core.Config; import org.tizen.installmanager.core.IMFatalException; +import org.tizen.installmanager.core.InstallManagerConstants; import org.tizen.installmanager.lib.IFileSystemInformation; import org.tizen.installmanager.lib.Log; import org.tizen.installmanager.lib.Platform; @@ -69,8 +70,6 @@ public class SetInstallDirectoryPage extends PageTemplate { private static final String RSC_PATH_IMAGE = RESOURCE_PATH + "/install_manager_graphicmotif_002.png"; private static final String STRING_TITLE = "Location"; private static final String STRING_SUBTITLE = "Select the installation location."; - private static final String WINDOWS_DEFAULT_TARGET_PATH = "C:\\tizen-sdk"; - private static final String WINDOWS_DEFAULT_DATA_PATH = "C:\\tizen-sdk-data"; private Text installDirectoryText; private Label installDirectoryLabel; @@ -90,6 +89,11 @@ public class SetInstallDirectoryPage extends PageTemplate { boolean availableInstallPath = false; boolean availableWorkSpacePath = false; boolean isWorkSpaceDuplicate = false; + + private enum SDKLABEL { + TARGET, + DATAPATH + } /** * @param parent @@ -107,7 +111,7 @@ public class SetInstallDirectoryPage extends PageTemplate { if (Platform.isLinux() || Platform.isMacOS()) { installDirectoryText.setText(System.getProperty("user.home") + File.separator + Config.SDK_DIRECTORY); } else if (Platform.isWindows()) { - installDirectoryText.setText(WINDOWS_DEFAULT_TARGET_PATH); + installDirectoryText.setText(InstallManagerConstants.WINDOWS_DEFAULT_TARGET_PATH); } else { throw new IMFatalException(ErrorCode.UNSUPPORTED_PLATFORM); } @@ -119,9 +123,9 @@ public class SetInstallDirectoryPage extends PageTemplate { private void setConfigDirectory() { if (Platform.isLinux() || Platform.isMacOS()) { sdkWorkSpaceText.setText(Config.getConfigHome()); - } else { + } else if (Platform.isWindows()){ if (Config.isNewPackageServer) { - sdkWorkSpaceText.setText(WINDOWS_DEFAULT_DATA_PATH); + sdkWorkSpaceText.setText(InstallManagerConstants.WINDOWS_DEFAULT_DATA_PATH); } else { sdkWorkSpaceText.setText(Config.getConfigHome()); } @@ -157,7 +161,8 @@ public class SetInstallDirectoryPage extends PageTemplate { installDirectoryText.addModifyListener(new ModifyListener() { @Override public void modifyText(ModifyEvent arg0) { - if (checkPattern() && checkDuplicatePath(installDirectoryText.getText(), true)) { + if (checkPattern(SDKLABEL.TARGET) && + checkDuplicatePath(installDirectoryText.getText(), SDKLABEL.TARGET)) { availableInstallPath = true; } else { availableInstallPath = false; @@ -219,17 +224,23 @@ public class SetInstallDirectoryPage extends PageTemplate { sdkWorkSpaceText.addModifyListener(new ModifyListener() { @Override public void modifyText(ModifyEvent arg0) { - if (checkPattern()) { + if (checkPattern(SDKLABEL.DATAPATH)) { availableWorkSpacePath = true; } else { availableWorkSpacePath = false; } - if (checkDuplicatePath(sdkWorkSpaceText.getText(), false)) { + if (checkDuplicatePath(sdkWorkSpaceText.getText(), SDKLABEL.DATAPATH)) { isWorkSpaceDuplicate = true; } else { isWorkSpaceDuplicate = false; } + + if (checkDuplicatePath(installDirectoryText.getText(), SDKLABEL.TARGET)) { + availableInstallPath = true; + } else { + availableInstallPath = false; + } InstallManagerWindow.setNextBtnEnabled(availableInstallPath && availableWorkSpacePath); } @@ -259,7 +270,7 @@ public class SetInstallDirectoryPage extends PageTemplate { private void setErrLabel() { installErrLabel = new Label(customComposite, SWT.WRAP); - installErrLabel.setBounds(20, 170, 400, 50); + installErrLabel.setBounds(20, 190, 400, 50); installErrLabel.setBackground(InstallManagerWindow.getBackgroundColor()); installErrLabel.setForeground(new Color(null, 255, 0, 0)); } @@ -274,40 +285,53 @@ public class SetInstallDirectoryPage extends PageTemplate { spaceAvailableLabel.setBackground(InstallManagerWindow.getBackgroundColor()); } - private boolean checkDuplicatePath(String path, boolean isTargetDir) { - File duplicate = new File(path); + private boolean checkDuplicatePath(String path, SDKLABEL sdkLabel) { + File installedPackageListFile = new File( + PathUtil.get(path, InstallManagerConstants.SDK_INSTALLED_PACKAGE_LIST_PATH)); - if (isTargetDir) { - if (duplicate.exists()) { - installErrLabel.setText("Input path is used already. you must input another path."); + if (sdkLabel == SDKLABEL.TARGET) { + if (installedPackageListFile.exists()) { + installErrLabel.setText("The input SDK install path is used already. you must input another path."); return false; } else { - installErrLabel.setText(""); return true; } - } else { - if (duplicate.exists()) { + } else if (sdkLabel == SDKLABEL.DATAPATH) { + if (installedPackageListFile.exists()) { return false; } else { return true; } + } else { + Log.err("Unknown label in set install path page."); + return false; } } - private boolean checkPattern() { + private boolean checkPattern(SDKLABEL sdkLabel) { + String text = ""; + if (sdkLabel == SDKLABEL.TARGET) { + text = installDirectoryText.getText(); + } else if (sdkLabel == SDKLABEL.DATAPATH) { + text = sdkWorkSpaceText.getText(); + } else { + Log.err("Unknown label in set install path page."); + return false; + } + try { if (Platform.isUbuntu() || Platform.isMacOS()) { - if (!sdkWorkSpaceText.getText().matches("[^= ]+")) { + if (!text.matches("[^= ]+")) { installErrLabel.setText("Value cannot contain the '=' character or spaces."); return false; } else { - if (!sdkWorkSpaceText.getText().startsWith(System.getProperty("user.home"))) { - installErrLabel.setText("Set the installation path to the home directory."); + if (!text.startsWith(System.getProperty("user.home"))) { + installErrLabel.setText("Set the input path to the home directory."); return false; } } } else if (Platform.isWindows()) { - if (!sdkWorkSpaceText.getText().matches("[^`~!@#$%^&*=? ]+")) { + if (!text.matches("[^`~!@#$%^&*=? ]+")) { installErrLabel.setText("Value cannot contain special characters or spaces."); return false; } @@ -321,26 +345,36 @@ public class SetInstallDirectoryPage extends PageTemplate { return true; } - private boolean checkAvailablePath() { + private boolean checkAvailablePath(SDKLABEL sdkLabel) { if (installDirectoryText.getText().equals("")) { installErrLabel.setText("Set the installation path."); spaceAvailableLabel.setText("Space available : "); return false; } + String text = ""; + if (sdkLabel == SDKLABEL.TARGET) { + text = installDirectoryText.getText(); + } else if (sdkLabel == SDKLABEL.DATAPATH) { + text = sdkWorkSpaceText.getText(); + } else { + Log.err("Unknown label in set install path page."); + return false; + } + try { if (Platform.isUbuntu() || Platform.isMacOS()) { - if (!installDirectoryText.getText().matches("[^= ]+")) { + if (!text.matches("[^= ]+")) { installErrLabel.setText("Value cannot contain the '=' character or spaces."); return false; } else { - if (!installDirectoryText.getText().startsWith(System.getProperty("user.home"))) { + if (!text.startsWith(System.getProperty("user.home"))) { installErrLabel.setText("Set the installation path to the home directory."); return false; } } } else if (Platform.isWindows()) { - if (!installDirectoryText.getText().matches("[^`~!@#$%^&*=? ]+")) { + if (!text.matches("[^`~!@#$%^&*=? ]+")) { installErrLabel.setText("Value cannot contain special characters or spaces."); return false; } @@ -382,7 +416,8 @@ public class SetInstallDirectoryPage extends PageTemplate { sdkWorkSpaceText.setEnabled(Config.isNewPackageServer); selectDataPathBtn.setEnabled(Config.isNewPackageServer); - InstallManagerWindow.setNextBtnEnabled(checkAvailablePath() && checkDuplicatePath(installDirectoryText.getText(), true)); + InstallManagerWindow.setNextBtnEnabled(checkAvailablePath(SDKLABEL.TARGET) && + checkDuplicatePath(installDirectoryText.getText(), SDKLABEL.TARGET)); setAvailableSpace(installDirectoryText.getText()); spaceRequiredLabel.setText("Download size : " + convertToVolumeSize(requiredSize)); diff --git a/InstallManager_java/src/org/tizen/installmanager/ui/page/UninstallingPage.java b/InstallManager_java/src/org/tizen/installmanager/ui/page/UninstallingPage.java index da7cc94..ba43338 100644 --- a/InstallManager_java/src/org/tizen/installmanager/ui/page/UninstallingPage.java +++ b/InstallManager_java/src/org/tizen/installmanager/ui/page/UninstallingPage.java @@ -277,21 +277,6 @@ public class UninstallingPage extends PageTemplate { // Do nothing. } - @Override - public void setProgressTitle(String name) { - mProgressTitle = name; - } - - @Override - public void setFileName(String name) { - if (name.length() > MAX_LENGTH) { - mSubTitle = name.substring(0, MAX_LENGTH - 2); - mSubTitle = mSubTitle + STRING_ETC; - } else { - mSubTitle = name; - } - } - /** * set working package name to show during uninstalling */ @@ -307,12 +292,44 @@ public class UninstallingPage extends PageTemplate { } }); } + + /** + * set working file name to show during installing + */ + @Override + public void workedTitle(String title) { + mProgressTitle = title; + + if (display == null || display.isDisposed()) { + setCanceled(true); + return; + } + + display.syncExec(new Runnable() { + @Override + public void run() { + statusLabel.setText(mProgressTitle); + } + }); + } /** * set working file name to show during uninstalling */ @Override - public void workedFileName() { + public void workedSubTitle(String subTitle) { + if (subTitle.length() > MAX_LENGTH) { + mSubTitle = subTitle.substring(0, MAX_LENGTH - 2); + mSubTitle = mSubTitle + STRING_ETC; + } else { + mSubTitle = subTitle; + } + + if (display == null || display.isDisposed()) { + setCanceled(true); + return; + } + display.asyncExec(new Runnable() { @Override public void run() { @@ -320,23 +337,30 @@ public class UninstallingPage extends PageTemplate { } }); } + + @Override + public void workedProcess(String title) { + if (title == null || title.isEmpty()) { + return; + } + + String processTitle = "Processing : package \"" + mProgressTitle + "\""; + workedTitle(processTitle); + } @Override public void workedDownload(long size) { - // TODO Auto-generated method stub - + //Do nothing } @Override public void setDownloadStartTime(long startTime) { - // TODO Auto-generated method stub - + //Do nothing } @Override public void workedChecksum(long size) { - // TODO Auto-generated method stub - + //Do nothing } @Override @@ -352,7 +376,18 @@ public class UninstallingPage extends PageTemplate { @Override public void setError(int errorCode) { - // TODO Auto-generated method stub + //Do nothing + + } + + @Override + public void workedDownload(String title) { + //Do nothing + } + + @Override + public void workedChecksum(String title) { + //Do nothing } } diff --git a/InstallManager_java/src/org/tizen/installmanager/ui/page/ViewController.java b/InstallManager_java/src/org/tizen/installmanager/ui/page/ViewController.java index 6bbf3c4..ef90eb5 100644 --- a/InstallManager_java/src/org/tizen/installmanager/ui/page/ViewController.java +++ b/InstallManager_java/src/org/tizen/installmanager/ui/page/ViewController.java @@ -29,7 +29,12 @@ 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; @@ -43,6 +48,7 @@ import org.tizen.installmanager.core.InstallManagerConstants; import org.tizen.installmanager.core.Options; import org.tizen.installmanager.core.SDKExtensionInfo; import org.tizen.installmanager.core.Config.ServerType; +import org.tizen.installmanager.lib.Documents; import org.tizen.installmanager.lib.Downloader; import org.tizen.installmanager.lib.ErrorController; import org.tizen.installmanager.lib.IIMProgressMonitor; @@ -78,6 +84,9 @@ 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. @@ -304,6 +313,9 @@ public class ViewController { installablePackages = getInstallablePackages(installList); } + Registry.setSDKinfoBySDKPath(targetPath); + Registry.saveSDKInfo(targetPath); + boolean bResult = false; while(true) { try { @@ -311,26 +323,36 @@ public class ViewController { break; } catch (IMNetworkException e) { Log.ExceptionLog(e); + showRetryDialog(e.getMessage()); - //retry dialog. - String errorMsg = e.getMessage() + "\nWould you like to retry?"; - int ret = MessageBoxDlg.showDlg( - InstallManagerWindow.getInstallManagerWindow().getShell(), - "Warning", - errorMsg, - DialogType.WARNING, false); - - if (ret == SWT.NO) {//cancel - throw new IMFatalException(e.getMessage()); - } else {//retry - continue; - } + continue; + } catch (Exception e) { + Log.ExceptionLog(e); + throw new IMFatalException(e.getMessage()); } } + if (bResult) { + PathUtil.remove(Config.getInstance().getDownloadDirPath()); + } + return bResult; } + public void showRetryDialog(String msg) { + //retry dialog. + String errorMsg = msg + "\nWould you like to retry?"; + int ret = MessageBoxDlg.showDlg( + InstallManagerWindow.getInstallManagerWindow().getShell(), + "Warning", + errorMsg, + DialogType.WARNING, false); + + if (ret == SWT.NO) { //cancel + throw new IMFatalException(msg); + } + } + /** * Get installable packages. * @param installList package name list from UI. @@ -717,6 +739,25 @@ public class ViewController { return causePackages; } + public void showChangeLog() { + if (Documents.isChecked()) { + Documents.showChangeLog(); // show the change log(history) + } + } + + public void cleanUpTargetDirectory() { + Log.log("Clean up the target directory => " + Registry.getInstalledPath()); + if (packageManager == null || packageManager.getInstalledPackages().isEmpty()) { + String targetPath = Config.getInstance().getTargetDir(); + + if (targetPath.isEmpty()) { + return; + } else { + removeTargetPath(targetPath); + } + } + } + public boolean canInstallManagerUpdate() { Package pkg = packageManager.getPackageByName(InstallManagerConstants.INSTALLMANAGER_PACKAGE_NAME); diff --git a/InstallManager_java/src/org/tizen/installmanager/util/PathUtil.java b/InstallManager_java/src/org/tizen/installmanager/util/PathUtil.java index 07b6db8..ed5d597 100644 --- a/InstallManager_java/src/org/tizen/installmanager/util/PathUtil.java +++ b/InstallManager_java/src/org/tizen/installmanager/util/PathUtil.java @@ -553,15 +553,15 @@ public class PathUtil { public static File makeNewFile(String filePath) throws IOException{ File file = new File(filePath); -// if (Config.getInstance().isSupportMultiSDK()) { -// return file; -// } else { - if (file.exists()) { - if (!file.delete()) { - return null; - } - } -// } + if (file.exists()) { + Log.log("<" + file + "> exists already. it will be removed."); + if (!file.delete()) { + Log.err("Fail to delete file. => " + file); + return null; + } else { + Log.log("Success to delete file. => " + file); + } + } File parentDir = file.getParentFile(); if (!parentDir.exists()) { @@ -571,7 +571,10 @@ public class PathUtil { } if (!file.createNewFile()) { + Log.err("Fail to create file. => " + file); return null; + } else { + Log.log("Success to create file. => " + file); } return file; diff --git a/InstallManager_java/src/res/desktop_directory/tsudo b/InstallManager_java/src/res/desktop_directory/tsudo.sh similarity index 53% rename from InstallManager_java/src/res/desktop_directory/tsudo rename to InstallManager_java/src/res/desktop_directory/tsudo.sh index 0dba8e1..7959d81 100755 --- a/InstallManager_java/src/res/desktop_directory/tsudo +++ b/InstallManager_java/src/res/desktop_directory/tsudo.sh @@ -1,9 +1,9 @@ -#!/bin/bash +#!/bin/bash -x while getopts "m:h" opt ; do case $opt in m) - message="-m \"$OPTARG\"" + message="$OPTARG" ;; h) echo "SUDO Wrapper" @@ -20,7 +20,11 @@ cmd="$@" case $INSTALLMANAGER_UI in "GUI") if [ "`which gksudo`" ] ; then - gksudo "$message" $cmd + if [ "$message" ] ; then + gksudo -m "$message" -- $cmd + else + gksudo -- $cmd + fi elif [ "`which beesu`" ] ; then beesu $cmd elif [ "`which pkexec`" ] ; then @@ -32,15 +36,36 @@ case $INSTALLMANAGER_UI in if [ "$INTERACTIVE" = "true" ] ; then sudo $cmd else - expect -c "spawn sudo ls" \ - -c "expect -re \"assword\"" \ - -c "send \"$SUPASS\n\"" \ - -c "interact" + + cat > tsudo_cmd << EOF +#!/usr/bin/expect -- +set timeout 10 +spawn sh -c "sudo -S ${cmd};echo \$? > exit_status" +expect { + "password for" { + send "${SUPASS}\r" + exp_continue + } eof { + return + } +} +interact +EOF + chmod +x ./tsudo_cmd + ./tsudo_cmd + EXIT_CODE=`cat exit_status` + if [ "x${EXIT_CODE}" != "x0" ]; then + rm exit_status + exit 1; + else + rm exit_status + exit 0; + fi fi ;; *) echo "fail: $INSTALLMANAGER_UI $INTERACTIVE" + exit 1; ;; esac - diff --git a/InstallerStub/macos/InstallManager b/InstallerStub/macos/InstallManager deleted file mode 100755 index 86c5e05..0000000 --- a/InstallerStub/macos/InstallManager +++ /dev/null @@ -1,26 +0,0 @@ -#/bin/bash -current_path=`pwd` -InstallManager_path="$current_path/InstallManager.app/Contents/Resources/Java/" - -echo ${InstallManager_path} -cd ${InstallManager_path} - -if [ -e ${InstallManager_path}/InstallManager.jar ] -then - java -jar -XstartOnFirstThread ${InstallManager_path}/InstallManager.jar $@ -elif [ -e $HOME/tizen-sdk-data/tizensdkpath ] -then - tizenpath=`grep TIZEN_SDK_INSTALLED_PATH $HOME/tizen-sdk-data/tizensdkpath` - SDK_PATH=`echo $tizenpath | cut -f2 -d"="` - if [ "x$SDK_PATH" != "x" ] - then - cd $SDK_PATH/install-manager - if [ -e ${InstallManager_path}/InstallManager.jar ] - then - java -jar -XstartOnFirstThread ${InstallManager_path}/InstallManager.jar $@ - fi - fi -fi - -exit 0 - diff --git a/InstallerStub/macos/InstallManagerC b/InstallerStub/macos/InstallManagerC deleted file mode 100755 index 525bfce..0000000 --- a/InstallerStub/macos/InstallManagerC +++ /dev/null @@ -1,26 +0,0 @@ -#/bin/bash -current_path=`pwd` -InstallManager_path="$current_path/Tizen_SDK_Install.app/Contents/Resources/Java/" - -echo ${InstallManager_path} -cd ${InstallManager_path} - -if [ -e ${InstallManager_path}/InstallManager.jar ] -then - java -jar -XstartOnFirstThread ${InstallManager_path}/InstallManager.jar $@ -elif [ -e $HOME/tizen-sdk-data/tizensdkpath ] -then - tizenpath=`grep TIZEN_SDK_INSTALLED_PATH $HOME/tizen-sdk-data/tizensdkpath` - SDK_PATH=`echo $tizenpath | cut -f2 -d"="` - if [ "x$SDK_PATH" != "x" ] - then - cd $SDK_PATH/install-manager - if [ -e ${InstallManager_path}/InstallManager.jar ] - then - java -jar -XstartOnFirstThread ${InstallManager_path}/InstallManager.jar $@ - fi - fi -fi - -exit 0 - diff --git a/InstallerStub/macos/build.xml b/InstallerStub/macos/build.xml deleted file mode 100644 index 3e18f70..0000000 --- a/InstallerStub/macos/build.xml +++ /dev/null @@ -1,83 +0,0 @@ - - - Install Manager for MacOS - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/InstallerStub/macos/installer_stub b/InstallerStub/macos/installer_stub deleted file mode 100644 index 81c7edb..0000000 --- a/InstallerStub/macos/installer_stub +++ /dev/null @@ -1,36 +0,0 @@ -#!/bin/bash - -ORI_FILE_sum=$$$$__CHKSUM_REPLACE__$$$$ -ORI_FILE_LEN=$$$$__FILE_LENGTH_REPLACE__$$$$ - -TPUT="`which tput`" -if test -t 0 -a -t 1 -a -n "$TPUT"; then - CI="`$TPUT setf 6 || true`"; CE="`$TPUT setf 4 || true`" - CX="`$TPUT setf 2 || true`"; CN="`$TPUT sgr0 || true`" -else CI=''; CE=''; CX=''; CN='' -fi - -#### Init Environment Variables #### -CUR_DIR=`pwd` -OUT_PATH="${HOME}/tizen-sdk-data/install-manager" - -mkdir -p ${OUT_PATH} -cd ${CUR_DIR} -tail -n +"${ORI_FILE_LEN}" "$0" | tee >(md5>${OUT_PATH}/checksum) | tar xmz -C ${OUT_PATH}/ - -OUT_FILE_sum=`cat "$OUT_PATH/checksum" | awk '{ print $1 }'` -if [ "${OUT_FILE_sum}" != "${ORI_FILE_sum}" ]; then - echo "$CE The download file appears to be corrupted. " - echo " Please do not attempt to install this archive file. $CN" - #rm -rf ${OUT_PATH} - exit 1 -fi - -##Excute InstallManager -cd $OUT_PATH -./InstallManager $* - -##source bashrc -source ${HOME}/.bashrc - -exit 0 diff --git a/InstallerStub/macos/jarbundler-2.2.0/LICENSE.TXT b/InstallerStub/macos/jarbundler-2.2.0/LICENSE.TXT deleted file mode 100755 index d645695..0000000 --- a/InstallerStub/macos/jarbundler-2.2.0/LICENSE.TXT +++ /dev/null @@ -1,202 +0,0 @@ - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/InstallerStub/macos/jarbundler-2.2.0/build.xml b/InstallerStub/macos/jarbundler-2.2.0/build.xml deleted file mode 100755 index 06e2a39..0000000 --- a/InstallerStub/macos/jarbundler-2.2.0/build.xml +++ /dev/null @@ -1,128 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/InstallerStub/macos/jarbundler-2.2.0/dox/DiskImage.html b/InstallerStub/macos/jarbundler-2.2.0/dox/DiskImage.html deleted file mode 100755 index 3f0b9f1..0000000 --- a/InstallerStub/macos/jarbundler-2.2.0/dox/DiskImage.html +++ /dev/null @@ -1,71 +0,0 @@ - - - - Creating a Disk Image - - - - - - - - - -

JarBundler - Creating a Disk Image

- - -

I'm writing to -contribute a shell script which creates a disk image via terminal commands. -I wrote it a few years ago so I can't quite explain how it works and likely -needs some cleanup - but it basically does the job. It doesn't support a -background image yet nor icon positioning.

- -

Thanks,
-Philip Weaver -

- -
-
-<exec dir="." os="Mac OS X" executable="/bin/sh">
-	<arg value="-c"/>
-	<arg value="./scripts/mkdmg.sh /Users/Me/Development/ ./mac/ ./mac-image/ Project"/>
-</exec>
-<gzip zipfile="${dist}/mac-image/MyTool .dmg.gz" src="${dist}/mac-image/MyTool.dmg"/>
-
-
- -

mkdmg.sh

-
-#!/bin/sh
-
-BASE="$1"
-SRC="$2"
-DEST="$3"
-VOLUME="$4"
-
-echo Base Directory $1
-echo Source $2
-echo Destination $3
-echo Volume $4
-
-TEMP="TEMPORARY"
-
-cd BASE
-
-hdiutil create -megabytes 5 $DEST$TEMP.dmg -layout NONE
-MY_DISK=`hdid -nomount $DEST$TEMP.dmg`
-newfs_hfs -v $VOLUME $MY_DISK
-hdiutil eject $MY_DISK
-hdid $DEST$TEMP.dmg
-chflags -R nouchg,noschg "$SRC"
-ditto -rsrcFork -v "$SRC" "/Volumes/$VOLUME"
-#ditto -rsrcFork -v "./background/" "/Volumes/$VOLUME"
-hdiutil eject $MY_DISK
-hdiutil convert -format UDCO $DEST$TEMP.dmg -o $DEST$VOLUME.dmg
-hdiutil internet-enable -yes $DEST$VOLUME.dmg
-
- - - - \ No newline at end of file diff --git a/InstallerStub/macos/jarbundler-2.2.0/dox/DocumentType.html b/InstallerStub/macos/jarbundler-2.2.0/dox/DocumentType.html deleted file mode 100755 index f4a1da7..0000000 --- a/InstallerStub/macos/jarbundler-2.2.0/dox/DocumentType.html +++ /dev/null @@ -1,212 +0,0 @@ - - - - Mac OS X JarBundler ANT Task - DocumentType Nested Task - - - - - - - - -

JarBundler - Associating Files with your Application

- - -

The nested <documenttype> task adds the appropriate elements to the Info.plist -file to associate a set of document file types with the application. This association means -that this application: - -

    -
  • will be included in the documents control-click "Open with.." list -
  • will be selected if this document is dragged over it -
  • can be selected as the default application for opening this document type -
- -

It is important to note that these association are done by the operation system, your -application must supply to proper code to handle the open document requires. - -

Also see Apple Developer Documentation on the -CFBundleDocumentTypes -key. - -

NB: You must use at least one of the attributes "extensions", -mimetypes or "ostypes". Any combination of these three may, of course, be used. - - -

DocumentType Task Attributes

-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
AttributeDescription
name - An application's unique name for this document type. For example, "Text Document" or - "Raw Data Document" - -
NB: Required attribute
-
extensions - A comma or space delimited string of filename extensions. - Do not specify the leading period. To open documents with - any extension, specify an extension with a single asterisk "*".
ostypes - A comma or space delimited string of Mac OS types. Each value contains a four-letter type. - To open documents of any type, - include four asterisk characters "****" as the type code. These codes are equivalent - to the legacy type codes used by Mac OS 9. Currently, OS Types with leading or trailing - spaces or commas cannot be processed. -
mimetypes - A comma or space delimited string of mime-types. -
UTI - A comma or space delimited string of Uniform Type Identifier (UTI) strings for the document. - UTIs are strings that uniquely identify abstract types. They can be used to - describe a file format or data type but can also be used to describe type - information for other sorts of entities, such as directories, volumes, or - packages. For more information on UTIs, see the header file UTType.h, - available as part of LaunchServices.framework in Mac OS X v10.3 and later. -Also see the Apple Developer Connection document - - "Simplifying Data Handling with Uniform type Identifiers". - -
iconfile - Specifies the name of an icon file used to associate with this document type. This icon - file is copied into the application bundle. These icons will be used for the document - look if this application is associated as the default application for this document type - use the Finder "Get info" command with the document. -
role - This key specifies the application's role with respect to the type. The value can be - Editor, Viewer, Shell, or None. See - - "Document Configuration" - for descriptions of these values. - -
NB: Required attribute
-
bundle - Used with extention and iconfile attributes to specify to Finder that a directory tree be - treated and displayed as a single document. See - - "Property List Key Reference", - look for the document type key LSTypeIsPackage. - -
NB: Boolean attribute, takes "true" or "false", default is "false"
-
-
- - - - - - -

Example

- - - -

The following example shows four document types being associated with a JarBundler built -Mac OS X application. The first document type associates HTML files using the file extensions -html and htm. The application also provides a custom icon file which can be -used by Finder to render files with these two extensions, if this application is chosen as the -default application. - -

The second document type creates an association with files with the extension -rtf. In this case these files will be rendered by the Finder using a system default -icon or an icon set from another application. The application is also telling the Finder that -rtf files can be viewed but not edited. - -

The third document type associates a mime-type for JPEG and PNG images. Again, the -application is declaring that it can only view files of this mime-type. - -

The last document type is a bit interesting using the bundle attribute to -designate a directory, which has an extension, as a document. The application has an -icon set which will be used by the Finder to render this directory. The directory will -not be seen from the Finder as a folder and can be copied and renamed as a single unit. This -structure can be very useful or creating complex associations of files which should be treated -as a unit. The content of the document bundle can be viewed using a control-click and -choosing "Show Package Contents...". - -

A document bundle has proven very useful in my own development work bring UNIX applications -onto to Mac OS X platform where the application would require several input file and create a -myriad of small output files. - - -

-
-
-  <jarbundler dir="release"...> 
-                
-      <documenttype name="Hello World HTML document"
-                    extensions="html htm" 
-                    iconFile="icons/html.icns"
-                    role="Editor"/>
-                     
-      <documenttype name="Hello World RTF document"
-                    extensions="rtf" 
-                    role="Viewer"/>
-
-      <documenttype name="Hello World images"
-                    mimetypes="image/jpeg image/png" 
-                    role="Viewer"/>
-
-      <documenttype name="Hello Project document"
-                    extensions="hello"
-                    iconFile="icons/Hello Document.icns"
-                    bundle="true"
-                    role="Editor"/>
-                    
-  </jarbundler>
-
-
- - - - \ No newline at end of file diff --git a/InstallerStub/macos/jarbundler-2.2.0/dox/Examples.html b/InstallerStub/macos/jarbundler-2.2.0/dox/Examples.html deleted file mode 100755 index a20a4e5..0000000 --- a/InstallerStub/macos/jarbundler-2.2.0/dox/Examples.html +++ /dev/null @@ -1,119 +0,0 @@ - - - -Mac OS X JarBundler - Advanced Examples - - - - - - - - -

JarBundler - Advanced Example

- - - - - -
    -
  • Native Mac OS X look and feel -
  • Custom application icon file -
  • Long application name, short name used in the menu -
  • Requires minimum JVM of 1.4 -
  • Three strings to specify Finder version, Get Info copyright, and build number -
  • Default Help Book folder and Help Book name -
  • Five different document types -
  • Bundle license agreement -
  • Help Book JNI library -
  • Two language Help Book support -
- -
-
-<target name="complex" depends="jar, jni" description="Build an example application">
-
-  <taskdef name="release/jarbundler"
-             classname="net.sourceforge.jarbundler.JarBundler"/>
-
-  <jarbundler dir="release"
-              name="Hello World"
-              shortname="Hello"
-              signature="Helo"
-              mainclass="net.sourceforge.jarbundler.example.HelloWorld"
-              jar="build/Hello World.jar"
-              icon="icons/Hello World.icns"
-              jvmversion="1.4+"
-              version="1.2"
-              infostring="Hello World, copyright 2006"
-              build="213"
-              bundleid="net.sourceforge.jarbundler.example.HelloWorld"   
-              helpbookfolder="HelpBook"
-              helpbookname="Hello World Help" > 
-                
-    <!-- Adjust the look, feel and behavior -->
-    
-      <javaproperty name="apple.laf.useScreenMenuBar" value="true"/>
-      <javaproperty name="apple.awt.brushMetal" value="true"/>
-      <javaproperty name="apple.awt.showGrowBox" value="false"/>
-
-    <!-- Associate document types with this application -->
-    
-      <documenttype name="Hello World text document"
-                    extensions="txt text" 
-                    ostypes="TEXT sEXT ttro" 
-                    iconFile="icons/txt.icns"
-                    role="Editor"/>
-                    
-      <documenttype name="Hello World HTML document"
-                    extensions="html htm" 
-                    iconFile="icons/html.icns"
-                    role="Editor"/>
-                     
-      <documenttype name="Hello World RTF document"
-                    extensions="rtf" 
-                    role="Viewer"/>
-
-      <documenttype name="Hello World images"
-                    mimetypes="image/jpeg image/png" 
-                    role="Viewer"/>
-
-      <documenttype name="Hello World Document"
-                    extensions="hello"
-                    iconFile="icons/Hello Document.icns"
-                    bundle="true"
-                    role="Editor"/>
-                    
-    <!-- Just proving we can include a file.  Might use it in the About box --> 
-    
-      <resourcefilelist dir=".." files="LICENSE.TXT"/>
- 
-    <!-- Copy the HelpBook JNI library into the Java directory -->
-    
-      <javafilelist dir="./build" files="libHelpBookJNI.jnilib"/>
-
-    <!-- Copy the HelpBooks to the language specific folders            -->
-    <!--  English will use the foldername and book name from the Bundle -->
-    <!--  German or 'de' will use the custom folder name and book name  -->
-      
-      <helpbook locale="English">
-        <fileset dir="HelpBook/English" />
-        <fileset dir="HelpBook/common" />
-      </helpbook>
-      
-      <helpbook foldername="Hilfebuch" name="Hallo Welt Hilfe" locale="German">
-        <fileset dir="HelpBook/German" />
-        <fileset dir="HelpBook/common" />
-      </helpbook>
-
-                     
-  </jarbundler>
-    
-</target>
-
-
- - - - \ No newline at end of file diff --git a/InstallerStub/macos/jarbundler-2.2.0/dox/HelpBook.html b/InstallerStub/macos/jarbundler-2.2.0/dox/HelpBook.html deleted file mode 100755 index 532e505..0000000 --- a/InstallerStub/macos/jarbundler-2.2.0/dox/HelpBook.html +++ /dev/null @@ -1,149 +0,0 @@ - - - -Mac OS X JarBundler ANT Task - HelpBook Nested Task - - - - - - - - - -

JarBundler - Including an Apple Help Book

- -

Documentation for creating Apple Help Book support can be found here. Basically, one needs to -specify both the Help Book directory (folder) name and the Help Book name (AppleTitle meta -tag). The application must also have a unique Bundle ID so that the Help -Viewer can reference the application. - -The Help Book consists of pure HTML files, images, and optional CSS styling. It is easy to -create and develop a Help Book outside of the application. The "Hello, World" Help Book HTML -can be used as a starter or checkout any application's exiting Help Book folder now that you -know where to find it. - -

The Help Book viewer does not automatcially open the file named -index.html as does a web server. The root file must contain a META -tag specifing the name AppleTitle. The content of this tag must match the value -specified in the helpbookname attributer of the jarbundler task. This META -tag is used to both designate the root HTML file and its content is used by the Help Viewer in -its "Library" listing.

- -
-<html>
-  <head>
-         .
-         .
-     <meta name="AppleTitle" content="Hello World Help"/>
-         .
-         .
-  </head>
-
-
- -

Finally, the developer needs to create a JNI library in order to communicate between the -"Help" menu item and the "Help Book Viewer" or whichever application is being used to render -Help Book help. This is a very simple file and usage is demonstrated in the "Hello, World" -example. Windows and Linux users will not be able to generate the JNI library on their -platforms. In order to generate a univeral binary JNI you can use Xcode and the tutorial found -here. This process can only -be done under Mac OS X with the "Apple Developer Tools" installed. Windows and Linux -developer will have to obtain the JNI library from a Mac OS X system. - -

The example/build.xml file shows how to create a JNI library from source with -ANT using command lines. - - -

Help Book Example

- -

The application created in this example will have a single Help Book located at -Contents/Resources/HelpBook. The next example shows how to support multiple Help Books -for different languages. - -

-<jarbundler dir="${basedir}"
-                      .
-                      .
-                      .
-            helpbookfolder="HelpBook"
-            helpbookname="Hello World Help" > 
-                 
-  <!-- Copy the HelpBook JNI library  -->
-  <javafilelist dir="${basedir}/build" files="libHelpBookJNI.jnilib"/>
-
-  <!-- Specify the HelpBook contents -->   
-  <helpbook>
-     <fileset dir="${basedir}/HelpBook"/>
-  <helpbook/>
-                     
-</jarbundler>
-    
-
- - -

Internationalized Help Book Example

-

The following example shows the use of Help Books to support English, German and Swedish. -The default Help Book folder name and Help Book name are set in the JarBundler tag. The -English Help Book uses these defaults. - -

The German Help Book specifes both the Help Book folder name and Help Book name, effectivly -overriding the JarBundler defaults. - -

The Swedish Help Book uses the default Help Book foldername but specifies it's own Help -Book name. The Swedish locale is specfied using it's ISO country code, sv. The ISO -codes of en and de could have been used in place of English and -German. - -

The directory HelpBook/commom could contain images and CSS stylesheets common to -all Help Books. During help book development use a symbolic link to move the common -directory into the HTML tree. - - -

-<jarbundler dir="${basedir}"
-                      .
-                      .
-                      .
-            helpbookfolder="HelpBook"
-            helpbookname="Hello World Help" > 
-                      .
-                      .
-                      .
-  <helpbook locale="English">
-    <fileset dir="HelpBook/English" />
-    <fileset dir="HelpBook/common" />
-  </helpbook>
-      
-  <helpbook foldername="Hilfebuch" name="Hallo Welt Hilfe" locale="German">
-    <fileset dir="HelpBook/German" />
-    <fileset dir="HelpBook/common" />
-  </helpbook>
-  
-  <helpbook name="Hjälp" locale="sv">
-    <fileset dir="HelpBook/Swedish" />
-    <fileset dir="HelpBook/common" />
-  </helpbook>
-  
-</jarbundler>
-
- - - -

Troubleshooting the Help Viewer cache.

-

During development the Help Viewer sometimes -refuses to update the contents of a Help Book which changed. The Apple Developer Docs -suggest to delete or -edit the file ~/Library/Preferences/com.apple.help.plist. This file -contains the list of known Help Books. If you double-click on this file the XML Property Editor -applicaiton will be launched and re can 'delete' your bundle ID entry and "save" this file. Deleting -this file does no harm but is a less elegant way to deal with the problem. - -

This document also suggests deleting the -folder ~/Library/Caches/com.apple.helpui to help with refresh problem during development. - - - - \ No newline at end of file diff --git a/InstallerStub/macos/jarbundler-2.2.0/dox/Service.html b/InstallerStub/macos/jarbundler-2.2.0/dox/Service.html deleted file mode 100755 index 9be494f..0000000 --- a/InstallerStub/macos/jarbundler-2.2.0/dox/Service.html +++ /dev/null @@ -1,56 +0,0 @@ - - - -Mac OS X JarBundler ANT Task - Services Properties - - - - - - - - - -

JarBundler - Apple System Services Properties

- -

Documentation for creating Apple System Services Properties can be found here. - - - -

Services Task Example

- - -
-<jarbundler dir="${basedir}" ... > 
-                 
-  <service portname="jarBundler"
-           message="processRequest"
-           menuitem="JarBundler/Process Request"
-           sendtypes="NSStringPboardType,NSFilenamesPboardType"
-           returntypes="NSStringPboardType"
-           keyequivalent="p"
-           userdata="a string passed to the method"
-           timeout="5000" />
-
-  <service menuItem="jEdit/Open Files" 
-           message="openFile" 
-           sendTypes="NSStringPboardType,NSFilenamesPboardType"/>
-           
-  <service menuItem="jEdit/Insert Text" 
-           message="insertSelection" 
-           sendTypes="NSStringPboardType"/>
-           
-  <service menuItem="jEdit/New Buffer with Text" 
-           message="openSelection" 
-           sendTypes="NSStringPboardType"/>
-                     
-</jarbundler>
-    
-
- - - - - \ No newline at end of file diff --git a/InstallerStub/macos/jarbundler-2.2.0/dox/StubFile.html b/InstallerStub/macos/jarbundler-2.2.0/dox/StubFile.html deleted file mode 100755 index 1cad168..0000000 --- a/InstallerStub/macos/jarbundler-2.2.0/dox/StubFile.html +++ /dev/null @@ -1,87 +0,0 @@ - - - - Java Application Stub - - - - - - - - - -

JarBundler - Java Application Stub

- - -

The Java Launching stub file is located inside of your application bundle in the -subdirectory "Contents/MacOS/". The default name for this file is "JavaApplicationStub". -It is used by the Mac OS X system read the -applications plist and then launch the Java VM with the appropriate properties such as the -classpath and main class name. - - -

When run on OS X system, the JarBundler ANT task uses the current copy of the JavaApplicationStub -from the developer's disk. Starting with JarBundler 1.8 the attribute stubfile can be used to -set the name of the JavaApplicationStub file copied from the system framework. If the -stub file referenced by the stubfile attribute exists, that file will be used along with -it's filename. - -

When the JarBundler ANT task is used under Windows or Linux, a copy of the JavaApplicationStub -must be supplied by the developer. This cannot be built from source but must be obtained from -a Mac OS X system. - - -

Java Launching Stub as a Symbolic Link

- -

Creating a bundle with the your current copy of Java Launching Stub -could lead to a future situation where the JavaApplicationStub file -could become incompatible with a future OS X update. - -

Under Mac OS X one -could replace the "JavaApplicationStub" file with a symbolic link to the user's current -copy. This should guarentee that -the end user would always be using a current copy of the stub file. I have used this technique on -several versions of OS X and have not have had any reported problems with its use. - - -

Obviously, if you have used a stub file name which is different than the one shown in the -example below you will have to make changes to both the delete and the symbolic link commands. - -

This is not yet an option of the JarBundler task but can be accomplished with the following lines -of ANT code after building the bundle. NB: This will not work when building under -Windows and is untested under Linux. - - -

-   .
-   .
-   .
-  </jarbundler>
-        
-  <!-- Delete the JavaApplicationStub and replace it with a symbolic link -->
-  <!--   which should work on older and future versions of OS X           -->
-       
-  <delete file="${release}/${name}.app/Contents/MacOS/JavaApplicationStub"/>
-  <exec executable="ln">
-    <arg line="-s /System/Library/Frameworks/JavaVM.framework/Resources/MacOS/JavaApplicationStub"/>
-    <arg value="${release}/${name}.app/Contents/MacOS/JavaApplicationStub"/>
-  </exec>
-
-</target>
-       
-
- -

A Known problem with Java launching stub

- -

In early 2006 an Apple upgrade to Quicktime (7.0.4) caused -older versions of "JavaApplicationStub" to fail to start up. These old copies came from developers -who first created the application bundle as a directory and then created new applications by -replacing the JAR files within the bundle and not replacing "JavaApplicationStub" with a more current -copy. - - - - - \ No newline at end of file diff --git a/InstallerStub/macos/jarbundler-2.2.0/dox/index.html b/InstallerStub/macos/jarbundler-2.2.0/dox/index.html deleted file mode 100755 index 5e15ca7..0000000 --- a/InstallerStub/macos/jarbundler-2.2.0/dox/index.html +++ /dev/null @@ -1,1010 +0,0 @@ - - - -Mac OS X JarBundler ANT Task - - - - - - - - -

Mac OS X JarBundler ANT Task

-

Version 2.2.0

- -

How many times has this happened to you? You've written a little -Java utility, or maybe even a more complex application, and you want to -create Mac OS X application bundle for easy distribution. - -

You'd like to be able to do it automatically from your build process, -but you're forced to go run the Apple Jar Bundler and tweak all the -settings manually every time you build.

- -

Well no more! JarBundler is a feature-rich Ant task which will -create a Mac OS X application bundle from a list of Jar files and a -main class name. You can add an Icon resource, set various Mac OS X -native look-and-feel bells and whistles, and maintain your application -bundles as part of your normal build and release cycle. It is free -software licensed under the GNU General Public License.

- -

This release is based on the earlier work of -Seth Morabito. - - - -

What's New

- -
    -
  • Added the optional 'jvmarchs' space delimited string attribute to JarBundler task.
    -Thanks to Tobias Bley and his team
  • - -
  • Added the optional 'lsArchitecturePriority' space delimited string attribute to JarBundler task.
    -Thanks to Tobias Bley and his team
  • - -
  • Added the optional 'suFeedURL' string attribute to JarBundler task.
    -Thanks to Tobias Bley and his team
  • - -
- - -

Download

- -
- - - - - -
Source and binary, all platforms (ZIP):jarbundler.zip
Source and binary, all platforms (TAR):jarbundler.tar.gz
-
- - - -

Installation

- -

Move the file jarbundler-2.2.0.jar -into /usr/share/ant/lib or -into your local ANT lib directory. Remove any older versions at this time. -NB: This location used to be /Developer/Java/Ant/lib. You -may have to try both to get things to work. - - -

Using in the Build file

- -

To use the Jar Bundler Ant Task, create a task definition in your -ANT build.xml file like this:

- -
-<taskdef name="jarbundler" 
-         classname="net.sourceforge.jarbundler.JarBundler" />
-
- - - -

Now, from a target, you can add the "jarbundler" task.

- -
-<jarbundler dir="release"
-            name="MyApp"
-            mainclass="org.foo.myapp.Main" 
-            jar="myapp.jar" />
-
- - - - -

Task Attributes, required

-
- - - - - - - - - - - - - - - - - - - - - - - - - - - -
AttributeDescription
dirThe directory in which your application bundle will be created.
nameThe name of your application bundle (minus the ".app" extension).
mainclassThe name of the main class to run when the application bundle is launched. -
- The corresponding bundle variable is - MainClass -
-
jarA single jar file to be used in your application. -
Not Required if there are nested <jarfileset> or - <jarfilelist> nested tasks. -
-
- Can be used with nested <jarfileset> and/or <jarfilelist> - tasks i.e. all jar files will be added to the class path. -
-
-
- - - - -

Task Attributes, optional

-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
AttributeDescription
argumentsExtra command-line arguments for the Java application. -
- The corresponding bundle variable is - Arguments -
-
buildApplication build number. This string is used in the default - "About..." box along with the 'version' number. This default About Box format is "version (build)" i.e. - "4.3.1 (231)". Also see version and infostring attributes. - -
- The corresponding bundle variable is - CFBundleVersion -
- -
- Default: the value of the version attribute -
-
bundleidUnique identifier string for the bundle. This string should be in - the form of a java package name, for example com.apple.myapp. - -
- The corresponding bundle variable is - CFBundleIdentifier -
- - -
developmentregionThe development region of the bundle. - -
- The corresponding bundle variable is - CFBundleDevelopmentRegion -
- -
- Default: English -
-
extraclasspathA list of files or patternsets (space or comma seperated) to - add to the bundle's classpath. The files referenced by this property will - not be copied into the bundle, so the resulting .app may only work - on systems that have these external resources available. -
helpbookfolderSpecify the directory name of the Help Book in the "resources" - directory. When this name must match the directory name when using - the <resourcefileset> task to copy the Help Book HTML files into the bundle. - -
- The corresponding bundle variable is - CFBundleHelpBookFolder -
- -
helpbooknameSpecify the name of the Help Book. This is string is also used - as the META tag to designate the initial HTML file to be loaded into the Help Viewer application. -
- <meta name="AppleTitle" content="Hello World Help"/> -
- -
- NB: The Apple Help Book system does not open the file index.html by default. Although - it is a good practice to use this filename with the embedded META tag shown above. -
- -
- The corresponding bundle variable is - CFBundleHelpBookName -
- -
iconFile reference to a Mac OS X icon file. This file is created with - the Mac OS application located at "/Developer/Applications/Utilites/Icon Composer" -
infostringA string for display in the Finder's Get Info panel. Also see version and build attributes. - -
- The corresponding bundle variable is - CFBundleGetInfoString -
- -
- Default: the value of the version attribute -
-
jvmarchsA space delimited string. Used to take advantage of 64-bit computing. - -
- Example: jvmarchs="i386 x64_86 ppc" -
-
lsArchitecturePriorityA space delimited string. Contains an array of strings identifying the supported code architectures and their preferred execution priority. - -
- Example: jvmarchs="i386 x64_86 ppc" -
-
jvmversionThe version of the JVM required to run the application. - Typically a string in the form "1.3", "1.3+", "1.4", "1.4+", etc. - -
- The corresponding bundle variable is - JVMVersion -
- - - - - - - -
- Default: 1.3+ -
-
shortnameThe string used in the application menu. -
- This string is often shorter than - the application's name. For example, "Microsoft Word" displays "Word".. - Apple recommends that this string be limited to 16 characters. JarBuilder enforces this - limit silently by truncating shortname. If the shortname is not specified then - the application's name will be used with no truncation. -
-
showplistIf true, display the contents of the Info.plist file -
- Default: false -
-
signatureThe four-letter code identifying the bundle. - -
- The corresponding bundle variable is - CFBundleSignature -
-
- Default: ???? -
-
splashfile**Needs link to Apple Technical Document** - -
stubfileIf set, the location of a Mac OS X Java Application Stub file - to use for this application bundle. See the section "Specifying the Java Launching - Stub File" below.
Required for Windows or Linux
-
- Under MacOS, if the referenced file does not exist, then the file - name will be used in the bundle to reference a copy of the JavaApplicationStub. - This usage provides a way for each Java application to have a uniquely named executable - file name. This is useful when using the UNIX 'top' command to distinguish applications. -
-
suFeedURLUsed to check for new version of the applications. -
verboseIf true, output more verbose information to Ant while the task is - running. -
- Default: false -
-
versionVersion number displayed in Finder, this version number can be though of - as the "Marketing" version without distracting build information. The marketing version - is a string that usually displays the major and minor version of the bundle. This string - is usually of the form n.n.n where n is a number. Also see build and - infostring attributes. - -
- The corresponding bundle variable is - CFBundleShortVersionString -
- - -
- Default: 1.0
-
vmoptionsCommand line options to pass the JVM at startup. -
- The corresponding bundle variable is - VMOptions -
-
workingdirectoryThe working directory for the Java application. -
- The corresponding bundle variable is - WorkingDirectory -
-
startOnMainThread -
- Valid values 'true' or 'false'. -
-
- -
- - - -

Task Attributes, deprecated

- - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
AttributeDescription
aboutmenunameThe string to display in the "About" menu of the - running application. (Deprecated under JVM 1.4.1) -
- Use JarBunler attribute shortname instead -
-
antialiasedgraphicsIf set to true, use anti-aliasing when rendering graphics. -
- Use <javaproperty name="apple.awt.antialiasing" .../> -
-
antialiasedtextIf set to true, use anti-aliasing when rendering text. -
- Use <javaproperty name="apple.awt.textantialiasing" .../> -
-
chmodThe full path to the BSD 'chmod' command. -
- Using the ANT task "Chmod" internally. -
-
execsA list of files or patternsets (space or comma seperated) to - place into the "Resources/MacOS" directory and set executable. - -
- Usage Warning: Filenames and directory paths can sometimes contain spaces and - commas. If these characters are present the build will fail mysteriously when using this - attribute. -
-
- Use <execfileset/> or <execfilelist/> nested tasks instead. -
-
growboxShow the Aqua resize (grow) box. -
- Use <javaproperty name="apple.awt.showGrowBox" .../> -
-
growboxintrudesResizable window's growbox (resize control) intrudes - into AWT content. If turned off, the bottom of the window is - pushed down 15 pixels. (Deprecated under JVM 1.4.1)
jars - A list of jar files or patternsets (space or comma seperated) to be used in your application. - -
- Usage Warning: Filenames and directory paths can sometimes contain spaces and - commas. If these characters are present the build will fail mysteriously when using this - attribute. -
- -
- Use <jarfileset> and/or <jarfilelist> nested tasks instead. -
-
typeThe Mac OS type of the bundle. -
- This attribute is redundant with the implied behavior this ANT task i.e. CFBundlePackageType - should always be set to APPL for applications. -
-
shortinfostringUse infostring attribute instead. -
smalltabsIf set to true, tab controls in Swing applications more - closely resemble the Metal look and feel. If set to false, the tabs - assume a larger size more similar to the default Aqua controls. - (Deprecated under JVM 1.4.1)
liveresizeIf set to true, enable live-resizing of windows. - (Deprecated under JVM 1.4.1)
screenmenuIf set to true, puts Swing menus - in the Mac OS X menu bar if using the Aqua look and feel. -
Set the apple.laf.useScreenMenuBar property instead: - <javaproperty name="apple.laf.useScreenMenuBar" value="true"/>
-
- - - - -

Nested DataType Task

- -

<jarfileset>

-

The nested jarfileset element specifies a -FileSet. -All -files included in this fileset will be included in the application -bundle and added to the app bundle classpath. Only required if the -jars attribute is not set.

- -

<jarfilelist>

-

The nested jarfilelist element specifies a -FileList. All -files included in this filelist will be included in the application -bundle and added to the app bundle classpath. Only required if the -jars attribute is not set.

- - -

<javaproperty ...>

-

This ANT DataType element allows developers to specify java properties -for the info.plist. This DataType repalces many jarbundler tag attributes. However, if -a deprecated attribute is used it will take precedent over a javaproperty. This was done -to maintain backward compatibility with earlier versions of jarbundler. - -

This task takes name/value pairs: -

-<javaproperty name="apple.awt.showGrowBox" value="true"/>
-
- -

Additional Java Properites can be found in the Apple Developer Connection document:   - -Apple Java Properties for JDK 1.4+ - -

<execfileset>

-

The nested execfileset element specifies a -FileSet. All -files included in this fileset will be added to the application -bundle's "Contents/MacOS" directory and set executable. Optional.

- -

<execfilelist>

-

The nested execfilelist element specifies a -FileList. All -files included in this filelist will be added to the application -bundle's "Contents/MacOS" directory and set executable. Optional.

- - -

<resourcefileset>

-

The nested resourcefileset element specifies a -FileSet. All -files included in this fileset will be added to the application -bundle's "Contents/Resources" directory. Optional.

- -

<resourcefilelist>

-

The nested resourcefilelist element specifies a -FileList. All -files included in this filelist will be added to the application -bundle's "Contents/Resources" directory. Optional.

- - -

<javafileset>

-

The nested javafileset element specifies a -FileSet. All -files included in this fileset will be added to the application -bundle's "Contents/Resources/Java" directory. Optional.

- -

<javafilelist>

-

The nested javafilelist element specifies a -FileList. All -files included in this filelist will be added to the application -bundle's "Contents/Resources/Java" directory. Optional.

- -

<extraclasspathfileset>

-

The nested extraclasspathfileset element specifies -a FileSet. -All files included in this fileset will be added to the -application bundle's classpath, but the files will not be -copied into the bundle itself. This allows you to specify external -system classpath dependencies without bundling the resources. Resources -can be files or directories. Optional.

- -

<extraclasspathfilelist>

-

The nested extraclasspathfilelist element specifies -a FileList. -All files included in this filelist will be added to the -application bundle's classpath, but the files will not be -copied into the bundle itself. This allows you to specify external -system classpath dependencies without bundling the resources. Resources -can be files or directories. Optional.

- - -

Note on FileList and FileSet target locations

-

Note that in fact the files are installed in locations which have the same relation -to either Contents/MacOS or Contents/Resources directories as the -files in the FileSet or FileList have to the 'dir' attribute. Thus in the case: - -

- <resourcefileset dir="builddir/architectures" includes="ppc/*.jnilib"/>
-
- -

the *.jnilib files will be installed in Contents/Resources/ppc - - - - - - - -

Examples

- -

A minimal example might look like this

- -
- <jarbundler dir="release"
-             name="MyApp"
-             mainclass="org.foo.myapp.Main"
-             jar="build/myapp.jar" />
-
- -

This will create a Mac OS X application bundle called "MyApp.app" in -the directory "release" using a JAR file which was created in the "build" directory.

- -

You can use FileSets or FileLists for more complex builds. For example:

- -
-<jarbundler dir="release"
-            name="MyApp 1.0"
-            mainclass="org.foo.myapp.Main" >
-
-  <jarfileset dir="build">
-    <include name="**/*.jar" />
-    <exclude name="**/CVS" />
-  </jarfileset>
-
-  <jarfilelist dir="lib" file="GUI.jar, Utils.jar" />
-
-</jarbundler>
-
- - - - -

Advanced JarBundler Tasks

- -

Associating Documents with your Application

- -

Including an Apple Help Book

- -

Apple System Service Property

- -

Java Launching Stub File

- -

Advanced Example

- -

Creating a Disk Image

- - - - - - -

History

- -

Released: Oct 2008

-
    -
  • Added the optional 'startOnMainThread' boolean attribute to JarBundler task.
    -Thanks to Mitch Coopet for his patch and the many other feature requesters.
  • -
- - -

Released: Jan 2007 (version 2.0.0)

-
    -
  • Added the optional 'splashfile' attribute to JarBundler task.
    -Thanks to Angelo van der Sijpt for this addition.
  • -
  • When run under any Window OS, the file separator for included libraries is written -with a backslash, '\', instead of a forward slash, '/'.
    -Thanks to Anthony Goubard for this fix.
  • -
  • Version 2.0.0 isn't a major release, but the license as changed to the more flexible -Apache Software License v2.0 (ASLv2). This allows the JarBundler ANT task to be bundled -into other packages whose licensing does not conform with the GPL.
  • -
  • Removed the dependency on the Xerxes API when writing the info.plist file. -We lost the indenting but can look into this later.
    -Thanks to Christian Menz for providing this modification to the source code. -
  • -
  • ANT commands and shell script for creating a Disk Image. (Mac OS X only)
    -Thanks to Philip Weaver for providing these. See "Creating a Disk Image" -
  • -
- - -

June 19, 2006 (version 1.9)

- -
    -
  • Deprecated chmod attribute. Using the ANT task "Chmod" internally.
  • -
  • Using the ANT task "Delete" internally to delete any pre-existing ".app" file
  • -
  • Added the <service> nested task. This matches a task used in the JEdit -branch of JarBundler. -Thanks to Björn "Vampire" Kautler for providing source code.
  • -
  • Add UTI specifier to document types. Thanks to Deerwood McCord Jr. for -the implementation.
  • -
- - - -

April 12, 2006 (version 1.8.1)

- - -

Fix bug when using localized Help Books, the menu application would appears as (null) - -

Corrected the encoding for the Info.plist XML file so that the copyright character, -amongst others, are processed correctly. Thanks to Christian Roth for both pointing out -the encoding problem and providing a one line solution! - - -

April 11, 2006 (version 1.8)

- -

Added bundle attribute to documenttype task in order to specify -documents which are in reality directory trees, yet treated as a single entity by the Finder. -Thanks to Deerwood McCord Jr. for the implementation. - -

Added mimetypes attribute to documenttype task in order to specify -Multipurpose Internet Mail Extensions (MIME) types for the document. -Thanks to Deerwood McCord Jr. for the implementation. - -

No longer required to delete the existing application bundle, i.e. .app directory, -before invoking the jarbundler task. This is now done by the task itself. - -

The filename of the stubfile attribute will be used as the Java Application Stub filename -within the bundle and for the value of the CFBundleExecutable key in the Info.plist. -This usage provides a way for each Java application to have a uniquely named executable -filename. This is useful when using the UNIX 'top' command to distinguish applications. -Thanks to Deerwood McCord Jr. for the this idea. - -

Info.plist is built internally as a DOM tree instead of concatenating strings. This -resulting DOM tree is serialized into the file using two space indentation and one tag per line. - -

Improved readablity of the verbose output. The contents of the Info.plist file -is controlled by the showPlist attribute. - -

Reorganize JarBundler documentation by splitting out advanced features - - -

March 22, 2006 (version 1.7)

- -

Added <documenttype> nested task so that file associations can be set up -for the application. Thanks to Dan Stowell a sample "Info.plist" file containing -document type entries.

- -

Added <javafileset> and <javafilelist> nested tasks, -which mirror <resourcefileset> and <resourcefilelist>, in -order to add files to the Contents/Resources/Java directory

- -

Added Apple Help Book support by... - -

    -
  • Adding helpbookfolder attribute to the jarbundler task
  • -
  • Adding helpbookname attribute to the jarbundler task
  • -
  • Adding javafilelist nested task to assist in moving the Help Book JNI - library to the correct location. (see above) -
- -

Thanks to Will Lowe for an example Help Book project with JNI code. - - -

Split the "Hello, World" example into a complex build which associates -document types and uses a Help Book, and a simple minimal build - -

Reorganize 'example' source directory to include Objective-C JNI code and use -package structure for "Hello, World" application rather than putting everything - - - - - -

March 2, 2006 (version 1.6)

- -

Added <resourcefileset> and <resourcefilelist> nested elements, -which mirror <execfileset> and <execfilelist>, and add files to -the Contents/Resources directory. - -

Added build attribute to jarbundler task. See also version -and infostring for usage. -

Added jar attribute to jarbundler task. -

Added shortname attribute to jarbundler task. See also name -for usage. -

JarBundler is now a SourceForge project! -

Changed task package to net.sourceforge.jarbundler - - - - -

February 2006 (version 1.5)

- -

Changed the package from 'com.loomcom.ant.tasks.jarbundler' to - 'com.informagen.ant.tasks.jarbundler' so that version 1.4 can remain installed without - conflict - -

Added a nested DataType called "javaproperty" so that new properties can be added - by end users and deprecated properties can be removed. Former jarbundler - tag atributes are still available but have been deprecated in favor of their - 'javaproperty' equivalents. - -

Currently, a jarbundler tag attribute overrides a javaproperty tag. This was - done to maintain backward compatibility with version 1.4 - - -

13 November 2004 (version 1.4):

-

Fixed a bug that was causing application arguments not to be set.

- -

23 October 2004 (version 1.3):

-

Added "extraclasspath" attribute, and "extraclasspathfileset" and - "extraclasspathfilelist" nested elements, allowing users to - optionally add external resources to the runtime classpath which will - not be copied into the application bundle at build time. Removed - some Java 1.4 requirements to allow building the sources under Java - 1.3. Clarified the documentation.

- -

26 July 2004 (version 1.2):

-

Added Ant property setters for "bundleid" and "developmentregion". - Bundleid has no default, and is optional. Developmentregion defaults - to "English", and is also optional. Fixed documentation on the - website.

- -

26 July 2004 (version 1.1):

-

Fixed several minor bugs, and improved BuildException messages. - Jarfilesets and execfilesets now preserve directory structure - when copying. Thanks to Trevor Harmon for pointing out bugs and - enhancements.

- - -

25 July 2004 (version 1.0):

-

"execs" and "jars" can now be set using embedded FileSets or - FileLists. Added a "verbose" flag, which currently sees limited use. - Added "chmod" attribute, which can be used to point to a non-standard - 'chmod' command (not normally needed!) Increased error checking. - Hopefully, the code is now robust enough for widespread production - use!

- -

28 Dec 2003 (version 0.5):

-

Added setter for "execs" attribute. Added setter for "workingdirectory" - attribute. Fixed missing setter for "arguments" attribute. Added - alternate Java runtime parameter names for Mac OS X Java VM version - 1.4.1. Included change submitted by Pierre-Luc Paour. - Thanks also to Dante Briones and Graham Perks - for pointing out bugs and enhancements.

- -

12 October 2003 (Version 0.2:)

-

Added setter to properly support the "vmoptions" parameter. -(Change submitted by Alok Saldanha)

- -

Contact

- -

Please contact Will Gilbert if you have bugs to report, patches to the code, -ideas for enhancements, or any other suggestions! I can be reached -at gilbert@informagen.com

- - -

Acknowledgments

- -

Thanks to Dan Stowell for suggesting the "documenttype" task and supplying -and example Info.plist file. - -

Thanks to Will Lowe for providing an example project which implemented "Apple -Help Book" support for Java. - - - -

License

- -

The Jar Bundler Ant Task is Copyright © 2002 - 2006, Seth J. Morabito. All rights reserved. - -

This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version.

- -

This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See -the -GNU General Public License for more details.

- -

You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.

- - -
- - SourceForge.net Logo - -
- - - - diff --git a/InstallerStub/macos/jarbundler-2.2.0/dox/styles.css b/InstallerStub/macos/jarbundler-2.2.0/dox/styles.css deleted file mode 100755 index 7c73ef2..0000000 --- a/InstallerStub/macos/jarbundler-2.2.0/dox/styles.css +++ /dev/null @@ -1,37 +0,0 @@ -body { margin:1.5em; - margin-right:3em; - } - -h1 {text-align:center;} - -h2 {margin-top:2em;} - -h3.datatype {margin-top:2em; - margin-bottom:0.5em; - font-family:monospace;} - -tt {font-family:monospace; - font-size:1.15em; - font-weight:bold;} - -td tt {font-family:monospace; - font-size:1em; - font-weight:normal;} - -li {margin-top:1em;} - -pre {margin-bottom:3em; - background-color:#eee; - padding:5px; - border:1px solid black;} - -td div {margin-top:0.5em;} - - -.attribute {vertical-align:top; - text-align:left; - font-family:monospace; - width:200px;} - -.description {vertical-align:top; - text-align:left;} diff --git a/InstallerStub/macos/jarbundler-2.2.0/example/HelpBook/English/index.html b/InstallerStub/macos/jarbundler-2.2.0/example/HelpBook/English/index.html deleted file mode 100755 index d5b430e..0000000 --- a/InstallerStub/macos/jarbundler-2.2.0/example/HelpBook/English/index.html +++ /dev/null @@ -1,35 +0,0 @@ - - - - - - - Hello World Help - - - - - - -
-
-
- Application Icon - -

Hello World Help

- -

Hello World

-
-
- -
- -
-

Help Topics

- -

Topics

-
-
- - diff --git a/InstallerStub/macos/jarbundler-2.2.0/example/HelpBook/English/topics.html b/InstallerStub/macos/jarbundler-2.2.0/example/HelpBook/English/topics.html deleted file mode 100755 index 0ede0d3..0000000 --- a/InstallerStub/macos/jarbundler-2.2.0/example/HelpBook/English/topics.html +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - Topics - - - - - - -

Topics

- -
    -
  • The long and rich history of "Hello, World"
  • -
  • The "Hello, World" example in the modern world
  • -
  • "Hello, World" -- Pros and cons
  • -
  • The future of "Hello, World"
  • -
- - diff --git a/InstallerStub/macos/jarbundler-2.2.0/example/HelpBook/German/index.html b/InstallerStub/macos/jarbundler-2.2.0/example/HelpBook/German/index.html deleted file mode 100755 index c11badd..0000000 --- a/InstallerStub/macos/jarbundler-2.2.0/example/HelpBook/German/index.html +++ /dev/null @@ -1,34 +0,0 @@ - - - - - - - Hallo Welt Hilfe - - - - - - -
-
-
- Application Icon - -

Hallo Welt Hilfe

- -

Hallo Welt

-
-
- -
- -
-

Hilfe Themas

-

Themas

-
-
- - diff --git a/InstallerStub/macos/jarbundler-2.2.0/example/HelpBook/German/topics.html b/InstallerStub/macos/jarbundler-2.2.0/example/HelpBook/German/topics.html deleted file mode 100755 index b974723..0000000 --- a/InstallerStub/macos/jarbundler-2.2.0/example/HelpBook/German/topics.html +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - - Themas - - - - -

Themas

- -
    -
  • Die lange und reiche Geschichte von "Hello, World"
  • -
  • Das "Hello, World" Beispiel in der modernen Welt
  • -
  • "Hello, World" -- Pro und Kontra
  • -
  • Die Zunkunft des Programms "Hello, World"
  • -
- - diff --git a/InstallerStub/macos/jarbundler-2.2.0/example/HelpBook/common/images/HelloWorld-16x16.png b/InstallerStub/macos/jarbundler-2.2.0/example/HelpBook/common/images/HelloWorld-16x16.png deleted file mode 100755 index 6d3e0b6..0000000 Binary files a/InstallerStub/macos/jarbundler-2.2.0/example/HelpBook/common/images/HelloWorld-16x16.png and /dev/null differ diff --git a/InstallerStub/macos/jarbundler-2.2.0/example/HelpBook/common/images/HelloWorld.png b/InstallerStub/macos/jarbundler-2.2.0/example/HelpBook/common/images/HelloWorld.png deleted file mode 100755 index 1bdc16e..0000000 Binary files a/InstallerStub/macos/jarbundler-2.2.0/example/HelpBook/common/images/HelloWorld.png and /dev/null differ diff --git a/InstallerStub/macos/jarbundler-2.2.0/example/HelpBook/common/styles/styles.css b/InstallerStub/macos/jarbundler-2.2.0/example/HelpBook/common/styles/styles.css deleted file mode 100755 index a18ae3d..0000000 --- a/InstallerStub/macos/jarbundler-2.2.0/example/HelpBook/common/styles/styles.css +++ /dev/null @@ -1,80 +0,0 @@ -body { - color: #000; - background-color: #fff; - margin: 0 -} -a { - color: #00f; - font-family: Lucida Grande, Arial, sans-serif; - text-decoration: none -} -h1 { - color: #000; - font-size: 18pt; - font-family: Lucida Grande, Arial, sans-serif; - font-weight: 500; - letter-spacing: -1pt; - padding-top: 12px -} -h2 { - color: #000; - font-size: 11pt; - font-family: "Lucida Grande", Arial, sans-serif; - font-weight: 300; - margin-top: 16px -} -h4 { - color: #000; - font-size: 8pt; - font-family: "Lucida Grande", Arial, sans-serif; - font-weight: 300; - margin-top: 21px -} -p { - font-size: 9pt; - font-family: Lucida Grande, Arial, sans-serif; - margin-top: -10px; - margin-left: 0 -} -a:hover { - text-decoration: underline -} -#contentleft { - margin-top: 38px; - width: 235px; - float: left -} -#contentcenter { - margin-top: 2px; - padding: 0; - width: 18px; - float: left -} -#contentright { - margin-top: 18px; - padding-left: 30px; - width: 210px; - height: 300px; - float: left; - border-left: 1px solid #808080 -} -#frame { - text-align: left; - margin-top: 12px; - margin-right: auto; - margin-left: auto; - width: 500px -} -.space17 { - padding-top: 17px -} -.smlapp { - height: 275px -} -.utility { - margin-top: 6px; - margin-bottom: 24px -} -.icon { - margin-bottom: -2px -} diff --git a/InstallerStub/macos/jarbundler-2.2.0/example/build.xml b/InstallerStub/macos/jarbundler-2.2.0/example/build.xml deleted file mode 100755 index 2ff1b12..0000000 --- a/InstallerStub/macos/jarbundler-2.2.0/example/build.xml +++ /dev/null @@ -1,177 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/InstallerStub/macos/jarbundler-2.2.0/example/icons/Hello Document.icns b/InstallerStub/macos/jarbundler-2.2.0/example/icons/Hello Document.icns deleted file mode 100755 index 5357fa6..0000000 Binary files a/InstallerStub/macos/jarbundler-2.2.0/example/icons/Hello Document.icns and /dev/null differ diff --git a/InstallerStub/macos/jarbundler-2.2.0/example/icons/Hello World.icns b/InstallerStub/macos/jarbundler-2.2.0/example/icons/Hello World.icns deleted file mode 100755 index 6b87622..0000000 Binary files a/InstallerStub/macos/jarbundler-2.2.0/example/icons/Hello World.icns and /dev/null differ diff --git a/InstallerStub/macos/jarbundler-2.2.0/example/icons/html.icns b/InstallerStub/macos/jarbundler-2.2.0/example/icons/html.icns deleted file mode 100755 index bb7ab74..0000000 Binary files a/InstallerStub/macos/jarbundler-2.2.0/example/icons/html.icns and /dev/null differ diff --git a/InstallerStub/macos/jarbundler-2.2.0/example/icons/txt.icns b/InstallerStub/macos/jarbundler-2.2.0/example/icons/txt.icns deleted file mode 100755 index 214b198..0000000 Binary files a/InstallerStub/macos/jarbundler-2.2.0/example/icons/txt.icns and /dev/null differ diff --git a/InstallerStub/macos/jarbundler-2.2.0/example/src/java/net/sourceforge/jarbundler/example/HelloWorld.java b/InstallerStub/macos/jarbundler-2.2.0/example/src/java/net/sourceforge/jarbundler/example/HelloWorld.java deleted file mode 100755 index a9be4b0..0000000 --- a/InstallerStub/macos/jarbundler-2.2.0/example/src/java/net/sourceforge/jarbundler/example/HelloWorld.java +++ /dev/null @@ -1,76 +0,0 @@ -package net.sourceforge.jarbundler.example; - -import java.awt.BorderLayout; -import java.awt.Dimension; -import java.awt.Point; -import java.awt.Toolkit; -import java.awt.Window; - -import java.awt.event.KeyEvent; -import java.awt.event.ActionListener; -import java.awt.event.ActionEvent; - -import javax.swing.AbstractAction; -import javax.swing.KeyStroke; -import javax.swing.JFrame; -import javax.swing.JLabel; -import javax.swing.JMenuBar; -import javax.swing.JMenu; -import javax.swing.JMenuItem; -import javax.swing.SwingConstants; - -public class HelloWorld { - - public static void main(String[] args) { - JFrame frame = new JFrame("JarBuilder Test Application"); - - JMenuBar menubar = new JMenuBar(); - - menubar.add(new JMenu("File")); - menubar.add(new JMenu("Edit")); - - JMenu helpMenu = new JMenu("Help"); - JMenuItem helpItem = new JMenuItem("Hello World Help"); - helpMenu.add(helpItem); - helpItem - .setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_SLASH, - KeyEvent.SHIFT_MASK - | Toolkit.getDefaultToolkit() - .getMenuShortcutKeyMask())); - - // Attach simple anonymous listener - helpItem.addActionListener(new ActionListener() { - public void actionPerformed(ActionEvent e) { - HelpBook.launchHelpViewer(); - } - }); - - menubar.add(helpMenu); - frame.setJMenuBar(menubar); - - JLabel label = new JLabel("Hello, World!", SwingConstants.CENTER); - frame.getContentPane().add(label, BorderLayout.CENTER); - frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); - - placeWindow(frame, 400, 300); - frame.setVisible(true); - } - - public static void placeWindow(Window window, int width, int height) { - - // New size for this window - Dimension windowSize = new Dimension(width, height); - window.setSize(windowSize); - - // Place in the 'dialog' position, centered aligned 1/3 from top - Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize(); - - Point windowLocation = new Point(0, 0); - windowLocation.x = (screenSize.width - windowSize.width) / 2; - windowLocation.y = (screenSize.height / 3) - (windowSize.height / 2); - - // Set final size and location - window.setLocation(windowLocation); - } - -} \ No newline at end of file diff --git a/InstallerStub/macos/jarbundler-2.2.0/example/src/java/net/sourceforge/jarbundler/example/HelpBook.java b/InstallerStub/macos/jarbundler-2.2.0/example/src/java/net/sourceforge/jarbundler/example/HelpBook.java deleted file mode 100755 index ec4a9eb..0000000 --- a/InstallerStub/macos/jarbundler-2.2.0/example/src/java/net/sourceforge/jarbundler/example/HelpBook.java +++ /dev/null @@ -1,23 +0,0 @@ -/* -** Java-JNI bridge for involking Apple Help Viewer -** -** The library name is the name of the JNI Library file which must be created and -** placed in the Contents/Java folder of the application bundle. -** -** This filename is created by prepending 'lib' and append '.jnilib' as a file extension. -** -** Thus, the target of loadLibrary("HelpBookJNI") will the file named: -** -** Content/Java/libHelpBookJNI.jnilib -*/ - - -package net.sourceforge.jarbundler.example; - -public class HelpBook { - static { - System.loadLibrary("HelpBookJNI"); - } - - public static native void launchHelpViewer(); -} diff --git a/InstallerStub/macos/jarbundler-2.2.0/example/src/obj-c/HelpBookJNI.m b/InstallerStub/macos/jarbundler-2.2.0/example/src/obj-c/HelpBookJNI.m deleted file mode 100755 index b7d5793..0000000 --- a/InstallerStub/macos/jarbundler-2.2.0/example/src/obj-c/HelpBookJNI.m +++ /dev/null @@ -1,14 +0,0 @@ -/* -** JNI hook for involking "NSApplication showHelp:" -** -** Notice that the function name is created using the string "Java_" and the package name -** using an underscore instead of a period, then the class name of bridge file. Finally the -** name of the 'public static native' method is appended. -*/ - -#import -#import - -JNIEXPORT void JNICALL Java_net_sourceforge_jarbundler_example_HelpBook_launchHelpViewer (JNIEnv *env, jclass clazz) { - [[NSApplication sharedApplication] performSelectorOnMainThread:@selector(showHelp:) withObject:NULL waitUntilDone:NO]; -} diff --git a/InstallerStub/macos/jarbundler-2.2.0/src/net/sourceforge/jarbundler/AppBundleProperties.java b/InstallerStub/macos/jarbundler-2.2.0/src/net/sourceforge/jarbundler/AppBundleProperties.java deleted file mode 100755 index 3c55f8b..0000000 --- a/InstallerStub/macos/jarbundler-2.2.0/src/net/sourceforge/jarbundler/AppBundleProperties.java +++ /dev/null @@ -1,428 +0,0 @@ -/* - * A Mac OS X Jar Bundler Ant Task. - * - * Copyright (c) 2003, Seth J. Morabito All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - - -package net.sourceforge.jarbundler; - -// Java Utility -import java.util.ArrayList; -import java.util.Hashtable; -import java.util.List; -import java.util.LinkedList; -// import java.util.Scanner; - -// Java language imports -import java.lang.String; - -public class AppBundleProperties { - - // Required - private String mApplicationName; - private String mMainClass; - - // Application short name - private String mCFBundleName = null; - - // Finder version, with default - private String mCFBundleShortVersionString = "1.0"; - - // Get Info string, optional - private String mCFBundleGetInfoString = null; - - // Build number, optional - private String mCFBundleVersion = null; - - // Help Book folder, optional - private String mCFHelpBookFolder = null; - - // Help Book name, optional - private String mCFHelpBookName = null; - - // StartOnMainThread, optional - private Boolean mStartOnMainThread = null; - - // Explicit default: false - private boolean mCFBundleAllowMixedLocalizations = false; - - // Explicit default: JavaApplicationStub - private String mCFBundleExecutable = "JavaApplicationStub"; - - // Explicit default: English - private String mCFBundleDevelopmentRegion = "English"; - - // Explicit default: APPL - private final String mCFBundlePackageType = "APPL"; - - // Explicit default: ???? - private String mCFBundleSignature = "????"; - - // Explicit default: 1.3+ - private String mJVMVersion = "1.3+"; - - // Explicit default: 6.0 - private final String mCFBundleInfoDictionaryVersion = "6.0"; - - // Optional keys, with no defaults. - - private String mCFBundleIconFile = null; - private String mSplashFile = null; - private String mCFBundleIdentifier = null; - private String mVMOptions = null; // Java VM options - private String mWorkingDirectory = null; // Java Working Dir - private String mArguments = null; // Java command line arguments - - // Class path and extra class path elements - private List mClassPath = new ArrayList(); - private List mExtraClassPath = new ArrayList(); - - // New in JarBundler 2.2.0; Tobias Bley ---------------- - private List mJVMArchs = new ArrayList(); - private List mLSArchitecturePriority = new ArrayList(); - private String mSUFeedURL = null; - // ----------------------------------------------------- - - // Java properties - private Hashtable mJavaProperties = new Hashtable(); - - // Document types - private List mDocumentTypes = new LinkedList(); - - // Services - private List mServices = new LinkedList(); - - // ================================================================================ - - /** - * Add a Java runtime property to the properties hashtable. - */ - - public void addJavaProperty(String prop, String val) { - mJavaProperties.put(prop, val); - } - - public Hashtable getJavaProperties() { - return mJavaProperties; - } - - // New in JarBundler 2.2.0; Tobias Bley ---------------- - - public void addToJVMArchs(String s) { - mJVMArchs.add(s); - } - - public List getJVMArchs() { - return mJVMArchs; - } - - //------------------------------------------------------ - - public void addToClassPath(String s) - { - mClassPath.add("$JAVAROOT/" + s); - } - - public void addToExtraClassPath(String s) { - mExtraClassPath.add(s); - } - - public List getExtraClassPath() { - return mExtraClassPath; - } - - public DocumentType createDocumentType() { - return new DocumentType(); - } - - public List getDocumentTypes() { - return mDocumentTypes; - } - - /** - * Add a document type to the document type list. - */ - public void addDocumentType(DocumentType documentType) { - mDocumentTypes.add(documentType); - } - - public Service createService() { - return new Service(); - } - - public List getServices() { - return mServices; - } - - /** - * Add a service to the services list. - */ - public void addService(Service service) { - mServices.add(service); - } - - // ================================================================================ - - public void setApplicationName(String s) { - mApplicationName = s; - } - - public String getApplicationName() { - return mApplicationName; - } - - // ================================================================================ - // - // Bundle setters and getters - // - - public void setCFBundleName(String s) { - - if (s.length() > 16) - System.err - .println("WARNING: 'shortname' is recommeded to be no more than 16 " - + "charaters long. See usage notes."); - mCFBundleName = s; - } - - public String getCFBundleName() { - if (mCFBundleName == null) - return getApplicationName(); - - return mCFBundleName; - } - - public void setCFBundleVersion(String s) { - mCFBundleVersion = s; - } - - public String getCFBundleVersion() { - return mCFBundleVersion; - } - - public void setCFBundleInfoDictionaryVersion(String s) { - // mCFBundleInfoDictionaryVersion = s; - } - - public String getCFBundleInfoDictionaryVersion() { - return mCFBundleInfoDictionaryVersion; - } - - public void setCFBundleIdentifier(String s) { - mCFBundleIdentifier = s; - } - - public String getCFBundleIdentifier() { - return mCFBundleIdentifier; - } - - public void setCFBundleGetInfoString(String s) { - mCFBundleGetInfoString = s; - } - - public String getCFBundleGetInfoString() { - if (mCFBundleGetInfoString == null) - return getCFBundleShortVersionString(); - - return mCFBundleGetInfoString; - } - - public void setCFBundleShortVersionString(String s) { - mCFBundleShortVersionString = s; - } - - public String getCFBundleShortVersionString() { - return mCFBundleShortVersionString; - } - - public void setCFBundleIconFile(String s) { - mCFBundleIconFile = s; - } - - public String getCFBundleIconFile() { - return mCFBundleIconFile; - } - - public void setSplashFile(String s) { - mSplashFile = s; - } - - public String getSplashFile() { - return mSplashFile; - } - - public void setCFBundleAllowMixedLocalizations(boolean b) { - mCFBundleAllowMixedLocalizations = b; - } - - public boolean getCFBundleAllowMixedLocalizations() { - return mCFBundleAllowMixedLocalizations; - } - - public void setCFBundleExecutable(String s) { - mCFBundleExecutable = s; - } - - public String getCFBundleExecutable() { - return mCFBundleExecutable; - } - - public void setCFBundleDevelopmentRegion(String s) { - mCFBundleDevelopmentRegion = s; - } - - public String getCFBundleDevelopmentRegion() { - return mCFBundleDevelopmentRegion; - } - - public void setCFBundlePackageType(String s) { - // mCFBundlePackageType = s; - } - - public String getCFBundlePackageType() { - return mCFBundlePackageType; - } - - public void setCFBundleSignature(String s) { - mCFBundleSignature = s; - } - - public String getCFBundleSignature() { - return mCFBundleSignature; - } - - public void setCFBundleHelpBookFolder(String s) { - mCFHelpBookFolder = s; - } - - public String getCFBundleHelpBookFolder() { - return mCFHelpBookFolder; - } - - public void setCFBundleHelpBookName(String s) { - mCFHelpBookName = s; - } - - public String getCFBundleHelpBookName() { - return mCFHelpBookName; - } - - - public void setStartOnMainThread(Boolean b) { - mStartOnMainThread = b; - } - - public Boolean getStartOnMainThread() { - return mStartOnMainThread; - } - - public void setMainClass(String s) { - mMainClass = s; - } - - public String getMainClass() { - return mMainClass; - } - - public void setJVMVersion(String s) { - mJVMVersion = s; - } - - public String getJVMVersion() { - return mJVMVersion; - } - - public void setVMOptions(String s) { - mVMOptions = s; - } - - public String getVMOptions() { - return mVMOptions; - } - - public void setWorkingDirectory(String s) { - mWorkingDirectory = s; - } - - public String getWorkingDirectory() { - return mWorkingDirectory; - } - - public void setArguments(String s) { - mArguments = s; - } - - public String getArguments() { - return mArguments; - } - - public List getClassPath() { - return mClassPath; - } - - // New in JarBundler 2.2.0; Tobias Bley ---------------------------------------------------- - - /** - * @param archs space separated archs, e.g. i386 x64_64 ppc - */ - - public void setJVMArchs(String archs) { - - // Use for 1.4 backwards compatability - String[] tokens = archs.split("\\s+"); - for (int i=0; i All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package net.sourceforge.jarbundler; - -import java.lang.String; - -import java.io.File; - -import java.util.List; -import java.util.Arrays; -import java.util.ArrayList; - -/** - * Represents an Info.plist DocumentType used for associating a document with - * the application - * - * The Document Types allows you to specify which documents your finished - * product can handle. You should list the application's primary document type - * first because the document controller uses that type by default when the user - * requests a new document. - * - * Name - The name of the document type. - * - * UTI - A list of Uniform Type Identifier (UTI) strings for the document. UTIs - * are strings that uniquely identify abstract types. They can be used to - * describe a file format or data type but can also be used to describe type - * information for other sorts of entities, such as directories, volumes, or - * packages. For more information on UTIs, see the header file UTType.h, - * available as part of LaunchServices.framework in Mac OS X v10.3 and later. - * - * - * Extensions - A list of the filename extensions for this document type. Don't - * include the period in the extension. - * - * - * OS Types - A list of four-letter codes for the document. These codes are - * stored in the document's resources or information property list files. - * - * - * MIME Types - A list of the Multipurpose Internet Mail Extensions (MIME) types - * for the document. MIME types identify content types for Internet - * applications. - * - * - * Icon File - The name of the file that contains the document type's icon. - * - * - * Role - A description of how the application uses the documents of this type. - * - * Editor - The application can display, edit, and save documents of this type. - * - * Viewer - The application can display, but not edit, documents of this type. - * - * Shell - The application provides runtime services for other processes for - * example, a Java applet viewer. - * - * None - The application can neither display nor edit documents of this type - * but instead uses them in some other way. For example, Sketch uses this role - * to declare types it can export but not read. - * - * - * Bundle - Specifies whether the document is a single file or a file bundle, - * that is, a directory that is treated as a single document by certain - * applications, such as the Finder. - * - * - * name="Scan Project" extensions="scansort scanproj" - * ostypes="fold disk fdrp" iconfile="document.icns" mimetypes="text/html - * image/jpeg" role="editor" bundle="true" /> - * - */ - - -public class DocumentType { - - private static final List EMPTYLIST = new ArrayList(0); - - /** Name. The name of the document type. */ - public String name = null; - - /** - * Extensions. A list of the filename extensions for this document type. - * Don't include the period in the extension. - */ - - public String[] extensions = null; - /** - * OS Types. A list of four-letter codes for the document. These codes are - * stored in the document's resources or information property list files. - */ - - public String[] osTypes = null; - /** - * MIME Types. A list of the Multipurpose Internet Mail Extensions (MIME) - * types for the document. MIME types identify content types for Internet - * applications. - */ - - public String[] mimeTypes = null; - - /** - * UTI. A list of Uniform Type Identifier (UTI) strings for the document. - * UTIs are strings that uniquely identify abstract types. They can be used - * to describe a file format or data type but can also be used to describe - * type information for other sorts of entities, such as directories, - * volumes, or packages. For more information on UTIs, see the header file - * UTType.h, available as part of LaunchServices.framework in Mac OS X v10.3 - * and later. - */ - public String[] UTIs = null; - - /** - * Icon File. The name of the file that contains the document types icon. - */ - - public File iconFile = null; - /** - * Role. A description of how the application uses the documents of this - * type. You can choose from four values: - *

- * Editor. The application can display, edit, and save documents of this - * type. - *

- * Viewer. The application can display, but not edit, documents of this - * type. - *

- * Shell. The application provides runtime services for other processesfor - * example, a Java applet viewer. - *

- * None. The application can neither display nor edit documents of this type - * but instead uses them in some other way. For example, Sketch uses this - * role to declare types it can export but not read. - */ - - public String role = null; - - /** - * Bundle. Specifies whether the document is a single file document or a - * document bundle, that is, a directory that is treated as a single - * document by certain applications, such as the Finder. - */ - - public boolean isBundle = false; - - // Document type name - public void setName(String name) { - this.name = name; - } - - public String getName() { - return name; - } - - // Extensions - public void setExtensions(String extensions) { - this.extensions = extensions.split("[\\s,]"); - } - - public List getExtensions() { - return (extensions == null) ? EMPTYLIST : Arrays.asList(extensions); - } - - // OS Types - public void setOSTypes(String osTypes) { - this.osTypes = osTypes.split("[\\s,]"); - } - - public List getOSTypes() { - return (osTypes == null) ? EMPTYLIST : Arrays.asList(osTypes); - } - - // mime-types - public void setMimeTypes(String mimeTypes) { - this.mimeTypes = mimeTypes.split("[\\s,]"); - } - - public List getMimeTypes() { - return (mimeTypes == null) ? EMPTYLIST : Arrays.asList(this.mimeTypes); - } - - // Uniform Type Identifiers - public void setUTIs(String UTIs) { - this.UTIs = UTIs.split("[\\s,]"); - } - - public List getUTIs() { - return this.UTIs == null ? EMPTYLIST : Arrays.asList(this.UTIs); - } - - // Document icon file - public void setIconFile(File iconFile) { - this.iconFile = iconFile; - } - - public File getIconFile() { - return iconFile; - } - - // Document role - public void setRole(String role) { - this.role = role; - } - - public String getRole() { - return role; - } - - // Is this document represented as a bundle - public void setBundle(boolean isBundle) { - this.isBundle = isBundle; - } - - public boolean isBundle() { - return isBundle; - } - -} diff --git a/InstallerStub/macos/jarbundler-2.2.0/src/net/sourceforge/jarbundler/HelpBook.java b/InstallerStub/macos/jarbundler-2.2.0/src/net/sourceforge/jarbundler/HelpBook.java deleted file mode 100755 index 892bfba..0000000 --- a/InstallerStub/macos/jarbundler-2.2.0/src/net/sourceforge/jarbundler/HelpBook.java +++ /dev/null @@ -1,87 +0,0 @@ -/* - * Copyright (c) 2003, Seth J. Morabito All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package net.sourceforge.jarbundler; - -import java.util.ArrayList; -import java.util.List; - -import org.apache.tools.ant.taskdefs.MatchingTask; -import org.apache.tools.ant.types.FileList; -import org.apache.tools.ant.types.FileSet; - -import java.lang.String; - - - -public class HelpBook extends MatchingTask { - - private String folderName = null; - private String name = null; - private String locale = null; - - private final List fileLists = new ArrayList(); - private final List fileSets = new ArrayList(); - - - // Help Book name - public void setName(String name) { - this.name = name; - } - - public String getName() { - return name; - } - - - // Help Book folder name - public void setFolderName(String folderName) { - this.folderName = folderName; - } - - public String getFolderName() { - return folderName; - } - - - // Help Book locale - public void setLocale(String locale) { - this.locale = locale; - } - - public String getLocale() { - return locale; - } - - // Help Book files as a ANT FileList - public void addFileList(FileList fileList) { - fileLists.add(fileList); - } - - public List getFileLists() { - return fileLists; - } - - // Help Book files as a ANT FileSet - public void addFileSet(FileSet fileSet) { - fileSets.add(fileSet); - } - - public List getFileSets() { - return fileSets; - } - -} diff --git a/InstallerStub/macos/jarbundler-2.2.0/src/net/sourceforge/jarbundler/JarBundler.java b/InstallerStub/macos/jarbundler-2.2.0/src/net/sourceforge/jarbundler/JarBundler.java deleted file mode 100755 index 97a056c..0000000 --- a/InstallerStub/macos/jarbundler-2.2.0/src/net/sourceforge/jarbundler/JarBundler.java +++ /dev/null @@ -1,1519 +0,0 @@ -/* - * A Mac OS X Jar Bundler Ant Task. - * - * - * Copyright (c) 2003, Seth J. Morabito All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package net.sourceforge.jarbundler; - -// This package's imports -import net.sourceforge.jarbundler.AppBundleProperties; -import net.sourceforge.jarbundler.DocumentType; -import net.sourceforge.jarbundler.JavaProperty; -import net.sourceforge.jarbundler.PropertyListWriter; - -// Java I/O -import java.io.BufferedWriter; -import java.io.BufferedReader; -import java.io.File; -import java.io.FileWriter; -import java.io.FileReader; -import java.io.IOException; -import java.io.InputStream; -import java.io.PrintWriter; - -// Java Utility -import java.util.ArrayList; -import java.util.HashSet; -import java.util.Iterator; -import java.util.List; -import java.util.Set; - -// Apache Jakarta -import org.apache.tools.ant.BuildException; -import org.apache.tools.ant.FileScanner; -import org.apache.tools.ant.Project; -import org.apache.tools.ant.Task; - -import org.apache.tools.ant.types.FileList; -import org.apache.tools.ant.types.FileSet; -import org.apache.tools.ant.types.PatternSet; - -import org.apache.tools.ant.taskdefs.MatchingTask; -import org.apache.tools.ant.taskdefs.Chmod; -import org.apache.tools.ant.taskdefs.Delete; - -import org.apache.tools.ant.util.FileUtils; - - -// Java language imports -import java.lang.Boolean; -import java.lang.Process; -import java.lang.Runtime; -import java.lang.String; -import java.lang.System; - -/** - *

- * An ant task which creates a Mac OS X Application Bundle for a Java - * application. - *

- * - *
- *
dir
- *
The directory into which to put the new application bundle.
- *
name
- *
The name of the application bundle. Note that the maximum length of this - * name is 16 characters, and it will be silently cropped if it is longer than - * this.
- *
mainclass
- *
The main Java class to call when running the application.
- *
- * - *

- * One of the following three MUST be used: - * - *

    - *
  1. jars Space or comma-separated list of JAR files to include.; OR
  2. - *
  3. One or more nested <jarfileset>s. These are normal ANT FileSets; - * OR
  4. - *
  5. One or more nested <jarfilelist>s. These are standard ANT - * FileLists.
  6. - *
- * - *

- * Optional attributes: - * - *

- * The following attributes are not required, but you can use them to override - * default behavior. - * - *

- *
verbose - *
If true, show more verbose output while running the task - * - *
version - *
Version information about your application (e.g., "1.0") - * - *
infostring - *
String to show in the "Get Info" dialog - *
- * - * These attributes control the fine-tuning of the "Mac OS X" look and feel. - * - *
- *
arguments - *
Command line arguments. (no default) - * - *
smalltabs - *
Use small tabs. (default "false") Deprecated under JVM 1.4.1 - * - *
antialiasedgraphics - *
Use anti-aliased graphics (default "false") - * - *
antialiasedtext - *
Use anti-aliased text (default "false") - * - *
bundleid - *
Unique identifier for this bundle, in the form of a Java package. No - * default. - * - *
buildnumber - *
Unique identifier for this build - * - *
developmentregion - *
Development Region. Default "English". - * - *
execs - *
Files to be copied into "Resources/MacOS" and made executable - * - *
liveresize - *
Use "Live resizing" (default "false") Deprecated under JVM 1.4.1 - * - * - *
growbox - *
Show growbox (default "true") - * - *
growboxintrudes - *
Intruding growbox (default "false") Deprecated under JVM 1.4.1 - * - *
screenmenu - *
Put swing menu into Mac OS X menu bar. - * - *
type - *
Bundle type (default "APPL") - * - *
signature - *
Bundle Signature (default "????") - * - *
stubfile - *
The Java Application Stub file to copy for your application (default - * MacOS system stub file) - *
- * - *

- * Rarely used optional attributes. - *

- *
chmod - *
Full path to the chmod command. This almost certainly does NOT need to - * be set. - *
- * - *

- * The task also supports nested <execfileset> and/or <execfilelist> - * elements, and <resourcefileset> and/or <resourcefilelist> - * elements, which are standard Ant FileSet and FileList elements. In the first - * case, the referenced files are copied to the Contents/MacOS - * directory and made executable, and in the second they are copied to the - * Contents/Resources directory and not made executable. If you - * winrces, note that in fact the files are installed in locations which have - * the same relation to the Contents/Resources directory as the - * files in the FileSet or FileList have to the 'dir' attribute. Thus in the - * case: - * - *

- *   <resourcefileset dir="builddir/architectures"
- *                       includes="ppc/*.jnilib"/>
- * 
- * - *

- * the *.jnilib files will be installed in - * Contents/Resources/ppc. - * - *

- * The task supports a nested <javaproperty> element, which allows you to - * specify further properties which are set for the JVM when the application is - * launched. This takes a required key attribute, giving the - * property key, plus an attribute giving the property value, which may be one - * of value, giving the string value of the property, - * file, setting the value of the property to be the absolute - * path of the given file, or path, which sets the value to the - * given path. If you are setting paths here, recall that, within the bundle, - * $APP_PACKAGE is set to the root directory of the bundle (ie, - * the path to the foo.app directory), and $JAVAROOT - * to the directory Contents/Resources/Java. - * - *

- * Minimum example: - * - *

- *  
- *    <jarbundler dir="release" name="Bar Project" mainclass="org.bar.Main"
- *        jars="bin/Bar.jar" />
- * 
- * - *

- * Using Filesets - * - *

- *    <jarbundler dir="release" name="Bar Project" mainclass="org.bar.Main">
- *      <jarfileset dir="bin">
- *        <include name="*.jar" />
- *        <exclude name="test.jar" />
- *      </jarfileset>
- *      <execfileset dir="execs">
- *        <include name="**" />
- *      </execfileset>
- *    </jarbundler>
- * 
- * - *

- * Much Longer example: - *

- * - *
- *    <jarbundler dir="release"
- *                name="Foo Project"
- *                mainclass="org.bar.Main"
- *                version="1.0 b 1"
- *                infostring="Foo Project (c) 2002" 
- *                type="APPL"
- *                jars="bin/foo.jar bin/bar.jar"
- *                execs="exec/foobar"
- *                signature="????"
- *                workingdirectory="temp"
- *                icon="resources/foo.icns"
- *                jvmversion="1.4.1+"
- *                vmoptions="-Xmx256m"/>
- * 
- * - * http://developer.apple.com/documentation/MacOSX/Conceptual/BPRuntimeConfig/ - */ -public class JarBundler extends MatchingTask { - - private static final String DEFAULT_STUB = "/System/Library/Frameworks/JavaVM.framework/Versions/Current/Resources/MacOS/JavaApplicationStub"; - - private static final String ABOUTMENU_KEY = "com.apple.mrj.application.apple.menu.about.name"; - private static final Set menuItems = new HashSet(); - private File mAppIcon; - - private File mRootDir; - - private final List mJavaFileLists = new ArrayList(); - private final List mJarFileSets = new ArrayList(); - - private final List mExecFileLists = new ArrayList(); - private final List mExecFileSets = new ArrayList(); - - private final List mResourceFileLists = new ArrayList(); - private final List mResourceFileSets = new ArrayList(); - - private final List mJarFileLists = new ArrayList(); - private final List mJavaFileSets = new ArrayList(); - - private final List mExtraClassPathFileLists = new ArrayList(); - private final List mExtraClassPathFileSets = new ArrayList(); - - private final List mJarAttrs = new ArrayList(); - - private final List mExecAttrs = new ArrayList(); - - private final List mExtraClassPathAttrs = new ArrayList(); - - private final List mHelpBooks = new ArrayList(); - - private boolean mVerbose = false; - private boolean mShowPlist = false; - - // Java properties used by Mac OS X Java applications - - private File mStubFile = new File(DEFAULT_STUB); - - private Boolean mAntiAliasedGraphics = null; - - private Boolean mAntiAliasedText = null; - - private Boolean mLiveResize = null; - - private Boolean mScreenMenuBar = null; - - private Boolean mGrowbox = null; - - private Boolean mGrowboxIntrudes = null; - - // The root of the application bundle - private File bundleDir; - - // "Contents" directory - private File mContentsDir; - - // "Contents/MacOS" directory - private File mMacOsDir; - - // "Contents/Resources" directory - private File mResourcesDir; - - // "Contents/Resources/Java" directory - private File mJavaDir; - - // Full path to the 'chmod' command. Can be overridden - // with the 'chmod' attribute. Won't cause any harm if - // not set, or if this executable doesn't exist. - - - private AppBundleProperties bundleProperties = new AppBundleProperties(); - - // Ant file utilities - - private FileUtils mFileUtils = FileUtils.getFileUtils(); - - /*************************************************************************** - * Retreive task attributes - **************************************************************************/ - - /** - * Arguments to the - * - * @param s - * The arguments to pass to the application being launched. - */ - public void setArguments(String s) { - bundleProperties.setArguments(s); - } - - /** - * Override the stub file path to build on non-MacOS platforms - * - * @param file - * the path to the stub file - */ - public void setStubFile(File file) { - mStubFile = (file.exists()) ? file : new File(DEFAULT_STUB); - bundleProperties.setCFBundleExecutable(file.getName()); - } - - /** - * Setter for the "dir" attribute (required) - */ - public void setDir(File f) { - mRootDir = f; - } - - /** - * Setter for the "name" attribute (required) This attribute names the - * output application bundle and asks as the CFBundleName if 'bundlename' is - * not specified - */ - public void setName(String s) { - bundleProperties.setApplicationName(s); - } - - /** - * Setter for the "shortname" attribute (optional) This key identifies the - * short name of the bundle. This name should be less than 16 characters - * long and be suitable for displaying in the menu and the About box. The - * name is (silently) cropped to this if necessary. - */ - public void setShortName(String s) { - bundleProperties.setCFBundleName(s); - } - - /** - * Setter for the "mainclass" attribute (required) - */ - public void setMainClass(String s) { - bundleProperties.setMainClass(s); - } - - /** - * Setter for the "WorkingDirectory" attribute (optional) - */ - public void setWorkingDirectory(String s) { - bundleProperties.setWorkingDirectory(s); - } - - /** - * Setter for the "icon" attribute (optional) - */ - - public void setIcon(File f) { - mAppIcon = f; - bundleProperties.setCFBundleIconFile(f.getName()); - } - - /** - * Setter for the "splashfile" attribute (optional). If it is somewhere - * in a jar file, which contains a Splash-Screen manifest entry, - * use "$JAVAROOT/myjar.jar" - */ - - public void setSplashFile(String s) { - bundleProperties.setSplashFile(s); - } - - /** - * Setter for the "bundleid" attribute (optional) This key specifies a - * unique identifier string for the bundle. This identifier should be in the - * form of a Java-style package name, for example com.mycompany.myapp. The - * bundle identifier can be used to locate the bundle at runtime. The - * preferences system uses this string to identify applications uniquely. - * - * No default. - */ - public void setBundleid(String s) { - bundleProperties.setCFBundleIdentifier(s); - } - - /** - * Setter for the "developmentregion" attribute(optional) Default "English". - */ - public void setDevelopmentregion(String s) { - bundleProperties.setCFBundleDevelopmentRegion(s); - } - - /** - * Setter for the "aboutmenuname" attribute (optional) - */ - public void setAboutmenuname(String s) { - bundleProperties.setCFBundleName(s); - } - - /** - * Setter for the "smalltabs" attribute (optional) - */ - public void setSmallTabs(boolean b) { - bundleProperties.addJavaProperty("com.apple.smallTabs", new Boolean(b) - .toString()); - } - - /** - * Setter for the "vmoptions" attribute (optional) - */ - public void setVmoptions(String s) { - bundleProperties.setVMOptions(s); - } - - /** - * Setter for the "antialiasedgraphics" attribute (optional) - */ - public void setAntialiasedgraphics(boolean b) { - mAntiAliasedGraphics = new Boolean(b); - } - - /** - * Setter for the "antialiasedtext" attribute (optional) - */ - public void setAntialiasedtext(boolean b) { - mAntiAliasedText = new Boolean(b); - } - - /** - * Setter for the "screenmenu" attribute (optional) - */ - public void setScreenmenu(boolean b) { - mScreenMenuBar = new Boolean(b); - } - - /** - * Setter for the "growbox" attribute (optional) - */ - public void setGrowbox(boolean b) { - mGrowbox = new Boolean(b); - } - - /** - * Setter for the "growboxintrudes" attribute (optional) - */ - public void setGrowboxintrudes(boolean b) { - mGrowboxIntrudes = new Boolean(b); - } - - /** - * Setter for the "liveresize" attribute (optional) - */ - public void setLiveresize(boolean b) { - mLiveResize = new Boolean(b); - } - - /** - * Setter for the "type" attribute (optional) - */ - public void setType(String s) { - bundleProperties.setCFBundlePackageType(s); - } - - /** - * Setter for the "signature" attribute (optional) - */ - public void setSignature(String s) { - bundleProperties.setCFBundleSignature(s); - } - - /** - * Setter for the "jvmversion" attribute (optional) - */ - public void setJvmversion(String s) { - bundleProperties.setJVMVersion(s); - } - - // New in JarBundler 2.2.0; Tobias Bley ---------------- - - /** - * Setter for the "JVMArchs" attribute (optional) - */ - public void setJvmArchs(String s) { - bundleProperties.setJVMArchs(s); - } - - /** - * Setter for the "LSArchitecturePriority" attribute (optional) - */ - public void setLSArchitecturePriority(String s) { - bundleProperties.setLSArchitecturePriority(s); - } - - //------------------------------------------------------- - - /** - * Setter for the "startonmainthread" attribute (optional) - */ - public void setStartonmainthread(boolean b) { - bundleProperties.setStartOnMainThread(new Boolean(b)); - } - - /** - * Setter for the "infostring" attribute (optional) This key identifies a - * human-readable plain text string displaying the copyright information for - * the bundle. The Finder displays this information in the Info window of - * the bundle. (This string was also known as the long version string in Mac - * OS 9). The format of the key should be of the following format: "© - * Great Software, Inc, 1999". You can localize this string by including it - * in the InfoPlist.strings file of the appropriate .lproj directory. - */ - - public void setInfoString(String s) { - bundleProperties.setCFBundleGetInfoString(s); - } - - /** - * Setter for the "shortinfostring" attribute (optional) This key identifies - * the marketing version of the bundle. The marketing version is a string - * that usually displays the major and minor version of the bundle. This - * string is usually of the form n.n.n where n is a number. The first number - * is the major version number of the bundle. The second and third numbers - * are minor revision numbers. You may omit minor revision numbers as - * appropriate. The value of this key is displayed in the default About box - * for Cocoa applications. - * - * The value for this key differs from the value for "CFBundleVersion", - * which identifies a specific build number. The CFBundleShortVersionString - * value represents a more formal version that does not change with every - * build. - */ - public void setShortInfoString(String s) { - setVersion(s); - } - - /** - * Setter for the "verbose" attribute (optional) - */ - public void setVerbose(boolean verbose) { - this.mVerbose = verbose; - } - public void setShowPlist(boolean showPlist) { - this.mShowPlist = showPlist; - } - - - - - /** - * Setter for the "buildnumber" attribute (optional) This key specifies the - * exact build version of the bundle. This string is usually of the form - * nn.n.nxnnn where n is a digit and x is a character from the set [abdf]. - * The first number is the major version number of the bundle and can - * contain one or two digits to represent a number in the range 0-99. The - * second and third numbers are minor revision numbers and must be a single - * numeric digit. The fourth set of digits is the specific build number for - * the release. - * - * You may omit minor revision and build number information as appropriate. - * You may also omit major and minor revision information and specify only a - * build number. For example, valid version numbers include: 1.0.1, - * 1.2.1b10, 1.2d200, d125, 101, and 1.0. - * - * The value of this key typically changes between builds and is displayed - * in the Cocoa About panel in parenthesis. To specify the version - * information of a released bundle, use the CFBundleShortVersionString key. - */ - public void setBuild(String s) { - bundleProperties.setCFBundleVersion(s); - } - - /** - * Setter for the version attribute (optional). It is this property, not - * CFBundleVersion, which should receive the `short' version string. See for - * example - * - */ - public void setVersion(String s) { - bundleProperties.setCFBundleShortVersionString(s); - } - - public void setHelpBookFolder(String s) { - bundleProperties.setCFBundleHelpBookFolder(s); - } - - public void setHelpBookName(String s) { - bundleProperties.setCFBundleHelpBookName(s); - } - - - /** - * Setter for the "jars" attribute (required if no "jarfileset" is present) - */ - public void setJars(String s) { - PatternSet patset = new PatternSet(); - patset.setIncludes(s); - - String[] jarNames = patset.getIncludePatterns(getProject()); - - for (int i = 0; i < jarNames.length; i++) - mJarAttrs.add(getProject().resolveFile(jarNames[i])); - } - - /** - * Setter for the "jar" attribute (required if no "jarfileset" is present) - */ - public void setJar(File s) { - mJarAttrs.add(s); - } - - /** - * Setter for the "execs" attribute (optional) - */ - public void setExecs(String s) { - PatternSet patset = new PatternSet(); - patset.setIncludes(s); - - String[] execNames = patset.getIncludePatterns(getProject()); - - for (int i = 0; i < execNames.length; i++) { - File f = new File(execNames[i]); - mExecAttrs.add(f); - } - } - - /** - * Setter for the "extraclasspath" attribute (optional) - */ - public void setExtraclasspath(String s) { - if (s == null || s.trim().equals("")) return; - PatternSet patset = new PatternSet(); - patset.setIncludes(s); - - String[] cpNames = patset.getIncludePatterns(getProject()); - - for (int i = 0; i < cpNames.length; i++) { - File f = new File(cpNames[i]); - mExtraClassPathAttrs.add(f); - } - } - - /** - * Set the 'chmod' executable. - */ - public void setChmod(String s) { - log("The \"chmod\" attribute has deprecaited, using the ANT Chmod task internally"); - } - - /*************************************************************************** - * Nested tasks - derived from FileList and FileSet - **************************************************************************/ - - public void addJarfileset(FileSet fs) { - mJarFileSets.add(fs); - } - - public void addJarfilelist(FileList fl) { - mJarFileLists.add(fl); - } - - public void addExecfileset(FileSet fs) { - mExecFileSets.add(fs); - } - - public void addExecfilelist(FileList fl) { - mExecFileLists.add(fl); - } - - public void addResourcefileset(FileSet fs) { - mResourceFileSets.add(fs); - } - - public void addResourcefilelist(FileList fl) { - mResourceFileLists.add(fl); - } - - public void addJavafileset(FileSet fs) { - mJavaFileSets.add(fs); - } - - public void addJavafilelist(FileList fl) { - mJavaFileLists.add(fl); - } - - public void addExtraclasspathfileset(FileSet fs) { - mExtraClassPathFileSets.add(fs); - } - - public void addExtraclasspathfilelist(FileList fl) { - mExtraClassPathFileLists.add(fl); - } - - - /*************************************************************************** - * Nested tasks - new tasks with custom attributes - **************************************************************************/ - - - public void addConfiguredJavaProperty(JavaProperty javaProperty) - throws BuildException { - - String name = javaProperty.getName(); - String value = javaProperty.getValue(); - - if ((name == null) || (value == null)) - throw new BuildException( - "'' must have both 'name' and 'value' attibutes"); - - bundleProperties.addJavaProperty(name, value); - } - - public void addConfiguredDocumentType(DocumentType documentType) throws BuildException { - - String name = documentType.getName(); - String role = documentType.getRole(); - List osTypes = documentType.getOSTypes(); - List extensions = documentType.getExtensions(); - List mimeTypes = documentType.getMimeTypes(); - - if ((name == null) || (role == null)) - throw new BuildException( - "'' must have both a 'name' and a 'role' attibute"); - - if ((osTypes.isEmpty()) && (extensions.isEmpty()) && (mimeTypes.isEmpty())) - throw new BuildException( - "'' of \"" - + name - + "\" must have 'osTypes' or 'extensions' or 'mimeTypes'"); - - bundleProperties.addDocumentType(documentType); - } - - public void addConfiguredService(Service service) { - - //if (service.getPortName() == null) - // throw new BuildException("\"\" must have a \"portName\" attribute"); - - if (service.getMessage() == null) - throw new BuildException("\"\" must have a \"message\" attribute"); - - String menuItem = service.getMenuItem(); - if (menuItem == null) - throw new BuildException("\"\" must have a \"menuItem\" attribute"); - if (!menuItems.add(menuItem)) - throw new BuildException("\"\" \"menuItem\" value must be unique"); - - if (service.getSendTypes().isEmpty() && service.getReturnTypes().isEmpty()) - throw new BuildException("\"\" must have either a \"sendTypes\" attribute, a \"returnTypes\" attribute or both"); - - String keyEquivalent = service.getKeyEquivalent(); - if ((keyEquivalent != null) && (1 != keyEquivalent.length())) - throw new BuildException("\"\" \"keyEquivalent\" must be one character if present"); - - String timeoutString = service.getTimeout(); - if (timeoutString != null) { - long timeout = -1; - try { - timeout = Long.parseLong(timeoutString); - } catch (NumberFormatException nfe) { - throw new BuildException("\"\" \"timeout\" must be a positive integral number"); - } - if (timeout < 0) - throw new BuildException("\"\" \"timeout\" must not be negative"); - } - - bundleProperties.addService(service); - } - - public void addConfiguredHelpBook(HelpBook helpBook) { - - // Validity check on 'foldername' - if (helpBook.getFolderName() == null) { - if (bundleProperties.getCFBundleHelpBookFolder() == null) - throw new BuildException("Either the '' attribute 'foldername' or the '' attribute 'helpbookfolder' must be defined"); - helpBook.setFolderName(bundleProperties.getCFBundleHelpBookFolder()); - } - - // Validity check on 'title' - if (helpBook.getName() == null) { - if (bundleProperties.getCFBundleHelpBookName() == null) - throw new BuildException("Either the '' attribute 'name' or the '' attribute 'helpbookname' must be defined"); - helpBook.setName(bundleProperties.getCFBundleHelpBookName()); - } - - // Make sure some file were selected... - List fileLists = helpBook.getFileLists(); - List fileSets = helpBook.getFileSets(); - - if ( fileLists.isEmpty() && fileSets.isEmpty() ) - throw new BuildException("The '' task must have either " + - "'' or '' nested tags"); - - - mHelpBooks.add(helpBook); - } - - - - /*************************************************************************** - * Execute the task - **************************************************************************/ - - /** - * The method executing the task - */ - - public void execute() throws BuildException { - - // Delete any existing Application bundle directory structure - - bundleDir = new File(mRootDir, bundleProperties.getApplicationName() + ".app"); - - if (bundleDir.exists()) { - Delete deleteTask = new Delete(); - deleteTask.setProject(getProject()); - deleteTask.setDir(bundleDir); - deleteTask.execute(); - } - - // Validate - look for required attributes - // /////////////////////////////////////////// - - if (mRootDir == null) - throw new BuildException("Required attribute \"dir\" is not set."); - - if (mJarAttrs.isEmpty() && mJarFileSets.isEmpty() - && mJarFileLists.isEmpty()) - throw new BuildException("Either the attribute \"jar\" must " - + "be set, or one or more jarfilelists or " - + "jarfilesets must be added."); - - if (!mJarAttrs.isEmpty() - && (!mJarFileSets.isEmpty() || !mJarFileLists.isEmpty())) - throw new BuildException( - "Cannot set both the attribute " - + "\"jars\" and use jar filesets/filelists. Use only one or the other."); - - if (bundleProperties.getApplicationName() == null) - throw new BuildException("Required attribute \"name\" is not set."); - - if (bundleProperties.getMainClass() == null) - throw new BuildException( - "Required attribute \"mainclass\" is not set."); - - // ///////////////////////////////////////////////////////////////////////////////////// - - // Set up some Java properties - - // About Menu, deprecated under 1.4+ - if (useOldPropertyNames()) - bundleProperties.addJavaProperty(ABOUTMENU_KEY, bundleProperties - .getCFBundleName()); - - // Anti Aliased Graphics, renamed in 1.4+ - String antiAliasedProperty = useOldPropertyNames() - ? "com.apple.macosx.AntiAliasedGraphicsOn" - : "apple.awt.antialiasing"; - - if (mAntiAliasedGraphics != null) - bundleProperties.addJavaProperty(antiAliasedProperty, - mAntiAliasedGraphics.toString()); - - // Anti Aliased Text, renamed in 1.4+ - String antiAliasedTextProperty = useOldPropertyNames() - ? "com.apple.macosx.AntiAliasedTextOn" - : "apple.awt.textantialiasing"; - - if (mAntiAliasedText != null) - bundleProperties.addJavaProperty(antiAliasedTextProperty, - mAntiAliasedText.toString()); - - // Live Resize, deprecated under 1.4+ - if (useOldPropertyNames() && (mLiveResize != null)) - bundleProperties.addJavaProperty( - "com.apple.mrj.application.live-resize", mLiveResize - .toString()); - - // Screen Menu Bar, renamed in 1.4+ - String screenMenuBarProperty = useOldPropertyNames() - ? "com.apple.macos.useScreenMenuBar" - : "apple.laf.useScreenMenuBar"; - - if (mScreenMenuBar != null) - bundleProperties.addJavaProperty(screenMenuBarProperty, - mScreenMenuBar.toString()); - - // Growbox, added with 1.4+ - if ((useOldPropertyNames() == false) && (mGrowbox != null)) - bundleProperties.addJavaProperty("apple.awt.showGrowBox", mGrowbox - .toString()); - - // Growbox Intrudes, deprecated under 1.4+ - if (useOldPropertyNames() && (mGrowboxIntrudes != null)) - bundleProperties.addJavaProperty( - "com.apple.mrj.application.growbox.intrudes", - mGrowboxIntrudes.toString()); - - if (!mRootDir.exists() - || (mRootDir.exists() && !mRootDir.isDirectory())) - throw new BuildException( - "Destination directory specified by \"dir\" " - + "attribute must already exist."); - - if (bundleDir.exists()) - throw new BuildException("The directory/bundle \"" - + bundleDir.getName() - + "\" already exists, cannot continue."); - - // Status message - log("Creating application bundle: " + bundleDir); - - if (!bundleDir.mkdir()) - throw new BuildException("Unable to create bundle: " + bundleDir); - - // Make the Contents directory - mContentsDir = new File(bundleDir, "Contents"); - - if (!mContentsDir.mkdir()) - throw new BuildException("Unable to create directory " - + mContentsDir); - - // Make the "MacOS" directory - mMacOsDir = new File(mContentsDir, "MacOS"); - - if (!mMacOsDir.mkdir()) - throw new BuildException("Unable to create directory " + mMacOsDir); - - // Make the Resources directory - mResourcesDir = new File(mContentsDir, "Resources"); - - if (!mResourcesDir.mkdir()) - throw new BuildException("Unable to create directory " - + mResourcesDir); - - // Make the Resources/Java directory - mJavaDir = new File(mResourcesDir, "Java"); - - if (!mJavaDir.mkdir()) - throw new BuildException("Unable to create directory " + mJavaDir); - - // Copy icon file to resource dir. If no icon parameter - // is supplied, the default icon will be used. - - if (mAppIcon != null) { - - - try { - File dest = new File(mResourcesDir, mAppIcon.getName()); - - if(mVerbose) - log("Copying application icon file to \"" + bundlePath(dest) + "\""); - - mFileUtils.copyFile(mAppIcon, dest); - } catch (IOException ex) { - throw new BuildException("Cannot copy icon file: " + ex); - } - } - - // Copy document type icons, if any, to the resource dir - try { - Iterator itor = bundleProperties.getDocumentTypes().iterator(); - - while (itor.hasNext()) { - DocumentType documentType = (DocumentType) itor.next(); - File iconFile = documentType.getIconFile(); - if (iconFile != null) { - File dest = new File(mResourcesDir, iconFile.getName()); - if(mVerbose) - log("Copying document icon file to \"" + bundlePath(dest) + "\""); - mFileUtils.copyFile(iconFile, dest); - } - } - } catch (IOException ex) { - throw new BuildException("Cannot copy document icon file: " + ex); - } - - // Copy application jar(s) from the "jars" attribute (if any) - processJarAttrs(); - - // Copy application jar(s) from the nested jarfileset element(s) - processJarFileSets(); - - // Copy application jar(s) from the nested jarfilelist element(s) - processJarFileLists(); - - // Copy executable(s) from the "execs" attribute (if any) - processExecAttrs(); - - // Copy executable(s) from the nested execfileset element(s) - processExecFileSets(); - - // Copy executable(s) from the nested execfilelist element(s) - processExecFileLists(); - - // Copy resource(s) from the nested resourcefileset element(s) - processResourceFileSets(); - - // Copy resource(s) from the nested javafileset element(s) - processJavaFileSets(); - - // Copy resource(s) from the nested resourcefilelist element(s) - processResourceFileLists(); - - // Copy resource(s) from the nested javafilelist element(s) - processJavaFileLists(); - - // Add external classpath references from the extraclasspath attributes - processExtraClassPathAttrs(); - - // Add external classpath references from the nested - // extraclasspathfileset element(s) - processExtraClassPathFileSets(); - - // Add external classpath references from the nested - // extraclasspathfilelist attributes - processExtraClassPathFileLists(); - - // Copy HelpBooks into place - copyHelpBooks(); - - // Copy the JavaApplicationStub file from the Java system directory to - // the MacOS directory - copyApplicationStub(); - - // Create the Info.plist file - writeInfoPlist(); - - // Create the PkgInfo file - writePkgInfo(); - - // Done! - } - - /*************************************************************************** - * Private utility methods. - **************************************************************************/ - - private void setExecutable(File f) { - - Chmod chmodTask = new Chmod(); - chmodTask.setProject(getProject()); - chmodTask.setFile(f); - chmodTask.setPerm("ugo+rx"); - - if (mVerbose) - log("Setting \"" + bundlePath(f) + "\" to executable"); - - chmodTask.execute(); - - } - - /** - * Utility method to determine whether this app bundle is targeting a 1.3 or - * 1.4 VM. The Mac OS X 1.3 VM uses different Java property names from the - * 1.4 VM to hint at native Mac OS X look and feel options. For example, on - * 1.3 the Java property to tell the VM to display Swing menu bars as screen - * menus is "com.apple.macos.useScreenMenuBar". Under 1.4, it becomes - * "apple.laf.useScreenMenuBar". Such is the price of progress, I suppose. - * - * Obviously, this logic may need refactoring in the future. - */ - - private boolean useOldPropertyNames() { - return (bundleProperties.getJVMVersion().startsWith("1.3")); - } - - private void processJarAttrs() throws BuildException { - - try { - - for (Iterator jarIter = mJarAttrs.iterator(); jarIter.hasNext();) { - File src = (File) jarIter.next(); - File dest = new File(mJavaDir, src.getName()); - - if (mVerbose) - log("Copying JAR file to \"" + bundlePath(dest) + "\""); - - - mFileUtils.copyFile(src, dest); - bundleProperties.addToClassPath(dest.getName()); - } - } catch (IOException ex) { - throw new BuildException("Cannot copy jar file: " + ex); - } - } - - private void processJarFileSets() throws BuildException { - - for (Iterator jarIter = mJarFileSets.iterator(); jarIter.hasNext();) { - - FileSet fs = (FileSet) jarIter.next(); - - Project p = fs.getProject(); - File srcDir = fs.getDir(p); - FileScanner ds = fs.getDirectoryScanner(p); - fs.setupDirectoryScanner(ds, p); - ds.scan(); - - String[] files = ds.getIncludedFiles(); - - try { - - for (int i = 0; i < files.length; i++) { - String fileName = files[i]; - File src = new File(srcDir, fileName); - File dest = new File(mJavaDir, fileName); - - if (mVerbose) - log("Copying JAR file to \"" + bundlePath(dest) + "\""); - - mFileUtils.copyFile(src, dest); - bundleProperties.addToClassPath(fileName); - } - - } catch (IOException ex) { - throw new BuildException("Cannot copy jar file: " + ex); - } - } - } - - private void processJarFileLists() throws BuildException { - - for (Iterator jarIter = mJarFileLists.iterator(); jarIter.hasNext();) { - FileList fl = (FileList) jarIter.next(); - Project p = fl.getProject(); - File srcDir = fl.getDir(p); - String[] files = fl.getFiles(p); - - try { - - for (int i = 0; i < files.length; i++) { - String fileName = files[i]; - File src = new File(srcDir, fileName); - File dest = new File(mJavaDir, fileName); - - if (mVerbose) - log("Copying JAR file to \"" + bundlePath(dest) + "\""); - - - mFileUtils.copyFile(src, dest); - bundleProperties.addToClassPath(fileName); - } - } catch (IOException ex) { - throw new BuildException("Cannot copy jar file: " + ex); - } - } - } - - private void processExtraClassPathAttrs() throws BuildException { - - for (Iterator jarIter = mExtraClassPathAttrs.iterator(); jarIter - .hasNext();) { - File src = (File) jarIter.next(); - String path = src.getPath().replace(File.separatorChar, '/'); - bundleProperties.addToExtraClassPath(path); - } - } - - private void processExtraClassPathFileSets() throws BuildException { - - for (Iterator jarIter = mExtraClassPathFileSets.iterator(); jarIter - .hasNext();) { - FileSet fs = (FileSet) jarIter.next(); - Project p = fs.getProject(); - File srcDir = fs.getDir(p); - FileScanner ds = fs.getDirectoryScanner(p); - fs.setupDirectoryScanner(ds, p); - ds.scan(); - - String[] files = ds.getIncludedFiles(); - - for (int i = 0; i < files.length; i++) { - File f = new File(srcDir, files[i]); - String path = f.getPath().replace(File.separatorChar, '/'); - bundleProperties.addToExtraClassPath(path); - } - } - } - - private void processExtraClassPathFileLists() throws BuildException { - - for (Iterator jarIter = mExtraClassPathFileLists.iterator(); jarIter - .hasNext();) { - FileList fl = (FileList) jarIter.next(); - Project p = fl.getProject(); - File srcDir = fl.getDir(p); - String[] files = fl.getFiles(p); - - for (int i = 0; i < files.length; i++) { - File f = new File(srcDir, files[i]); - String path = f.getPath().replace(File.separatorChar, '/'); - bundleProperties.addToExtraClassPath(path); - } - } - } - - private void processExecAttrs() throws BuildException { - - try { - - for (Iterator execIter = mExecAttrs.iterator(); execIter.hasNext();) { - File src = (File) execIter.next(); - File dest = new File(mMacOsDir, src.getName()); - - if (mVerbose) - log("Copying exec file to \"" + bundlePath(dest) + "\""); - - - mFileUtils.copyFile(src, dest); - setExecutable(dest); - } - } catch (IOException ex) { - throw new BuildException("Cannot copy exec file: " + ex); - } - } - - // Methods for copying FileSets into the application bundle /////////////////////////////// - - // Files for the Contents/MacOS directory - private void processExecFileSets() { - processCopyingFileSets(mExecFileSets, mMacOsDir, true); - } - - // Files for the Contents/Resources directory - private void processResourceFileSets() { - processCopyingFileSets(mResourceFileSets, mResourcesDir, false); - } - - // Files for the Contents/Resources/Java directory - private void processJavaFileSets() { - processCopyingFileSets(mJavaFileSets, mJavaDir, false); - } - - private void processCopyingFileSets(List fileSets, File targetdir, boolean setExec) { - - for (Iterator execIter = fileSets.iterator(); execIter.hasNext();) { - FileSet fs = (FileSet) execIter.next(); - Project p = fs.getProject(); - File srcDir = fs.getDir(p); - FileScanner ds = fs.getDirectoryScanner(p); - fs.setupDirectoryScanner(ds, p); - ds.scan(); - - String[] files = ds.getIncludedFiles(); - - if (files.length == 0) { - // this is probably an error -- warn about it - System.err - .println("WARNING: fileset for copying from directory " - + srcDir + ": no files found"); - } else { - try { - for (int i = 0; i < files.length; i++) { - String fileName = files[i]; - File src = new File(srcDir, fileName); - File dest = new File(targetdir, fileName); - - if (mVerbose) - log("Copying " - + (setExec ? "exec" : "resource") - + " file to \"" + bundlePath(dest) +"\""); - - mFileUtils.copyFile(src, dest); - if (setExec) - setExecutable(dest); - } - } catch (IOException ex) { - throw new BuildException("Cannot copy file: " + ex); - } - } - } - } - - // Methods for copying FileLists into the application bundle ///////////////////////////// - - // Files for the Contents/MacOS directory - private void processExecFileLists() throws BuildException { - processCopyingFileLists(mExecFileLists, mMacOsDir, true); - } - - // Files for the Contents/Resources directory - private void processResourceFileLists() throws BuildException { - processCopyingFileLists(mResourceFileLists, mResourcesDir, false); - } - - // Files for the Contents/Resources/Java directory - private void processJavaFileLists() throws BuildException { - processCopyingFileLists(mJavaFileLists, mJavaDir, false); - } - - private void processCopyingFileLists(List fileLists, File targetDir, boolean setExec) throws BuildException { - - for (Iterator execIter = fileLists.iterator(); execIter.hasNext();) { - - FileList fl = (FileList) execIter.next(); - Project p = fl.getProject(); - File srcDir = fl.getDir(p); - String[] files = fl.getFiles(p); - - if (files.length == 0) { - // this is probably an error -- warn about it - System.err.println("WARNING: filelist for copying from directory " - + srcDir + ": no files found"); - } else { - try { - for (int i = 0; i < files.length; i++) { - String fileName = files[i]; - File src = new File(srcDir, fileName); - File dest = new File(targetDir, fileName); - - if (mVerbose) - log("Copying " - + (setExec ? "exec" : "resource") - + " file to \"" + bundlePath(dest) +"\""); - - mFileUtils.copyFile(src, dest); - if (setExec) - setExecutable(dest); - } - } catch (IOException ex) { - throw new BuildException("Cannot copy jar file: " + ex); - } - } - } - } - - - - private void copyHelpBooks() { - - for (Iterator itor = mHelpBooks.iterator(); itor.hasNext();) { - - HelpBook helpBook = (HelpBook)itor.next(); - - String folderName = helpBook.getFolderName(); - String name = helpBook.getName(); - String locale = helpBook.getLocale(); - - List fileLists = helpBook.getFileLists(); - List fileSets = helpBook.getFileSets(); - - - File helpBookDir = null; - - if (locale == null) { - - // Set the Bundle entries for a nonlocalized Help Book - if (folderName != null) - bundleProperties.setCFBundleHelpBookFolder(folderName); - - if (name != null) - bundleProperties.setCFBundleHelpBookName(name); - - // The non-localized Help Book is top level "/Resources" - helpBookDir = new File(mResourcesDir, folderName); - helpBookDir.mkdir(); - - if(mVerbose) - log("Creating Help Book at \"" + - bundlePath(helpBookDir) + "\""); - - - } else { - - // The localized Help Book is "/Resources/locale.lproj" - - File lproj = new File(mResourcesDir, locale + ".lproj"); - lproj.mkdir(); - helpBookDir = new File(lproj, folderName); - helpBookDir.mkdir(); - - if(mVerbose) - log("Creating Help Book for \"" + locale + - "\" at \"" + bundlePath(helpBookDir) + "\""); - - // Create a local file to override the Bundle settings - File infoPList = new File(lproj, "InfoPlist.strings"); - PrintWriter writer = null; - try { - writer = new PrintWriter(new FileWriter(infoPList)); - writer.println("CFBundleHelpBookFolder = \"" + folderName + "\";"); - writer.println("CFBundleHelpBookName = \"" + name + "\";"); - writer.println("CFBundleName = \"" + bundleProperties.getCFBundleName() + "\";"); - } catch (IOException ioe) { - throw new BuildException("IOException in writing Help Book locale: " + locale); - } finally { - mFileUtils.close(writer); - } - } - - // Write the Help Book source files into the bundle - - processCopyingFileSets(fileSets, helpBookDir, false); - processCopyingFileLists(fileLists, helpBookDir, false); - - } - } - - - - - // Copy the application stub into the bundle - // ///////////////////////////////////////////// - - private void copyApplicationStub() throws BuildException { - - File newStubFile = new File(mMacOsDir, bundleProperties.getCFBundleExecutable()); - - if (mVerbose) - log("Copying Java application stub to \"" + bundlePath(newStubFile) + "\""); - - try { - mFileUtils.copyFile(mStubFile, newStubFile); - } catch (IOException ex) { - throw new BuildException("Cannot copy Java Application Stub: " + ex); - } - - // Set the permissions on the stub file to executable - - setExecutable(newStubFile); - } - - private void writeInfoPlist() throws BuildException { - PropertyListWriter listWriter = new PropertyListWriter(bundleProperties); - File infoPlist = new File(mContentsDir, "Info.plist"); - - listWriter.writeFile(infoPlist); - - if (mVerbose) - log("Creating \"" + bundlePath(infoPlist) + "\" file"); - - - if (mShowPlist) { - try { - BufferedReader in = new BufferedReader(new FileReader(infoPlist)); - String str; - while ((str = in.readLine()) != null) - log(str); - in.close(); - } catch (IOException e) { - throw new BuildException(e); - } - } - } - - - // - // Write the PkgInfo file into the application bundle - // - - private void writePkgInfo() throws BuildException { - File pkgInfo = new File(mContentsDir, "PkgInfo"); - PrintWriter writer = null; - - try { - writer = new PrintWriter(new BufferedWriter(new FileWriter(pkgInfo))); - writer.print(bundleProperties.getCFBundlePackageType()); - writer.println(bundleProperties.getCFBundleSignature()); - writer.flush(); - } catch (IOException ex) { - throw new BuildException("Cannot create PkgInfo file: " + ex); - } finally { - mFileUtils.close(writer); - } - } - - private String bundlePath(File bundleFile) { - - String rootPath = bundleDir.getAbsolutePath(); - String thisPath = bundleFile.getAbsolutePath(); - - return thisPath.substring(rootPath.length()); - - } -} diff --git a/InstallerStub/macos/jarbundler-2.2.0/src/net/sourceforge/jarbundler/JavaProperty.java b/InstallerStub/macos/jarbundler-2.2.0/src/net/sourceforge/jarbundler/JavaProperty.java deleted file mode 100755 index d371488..0000000 --- a/InstallerStub/macos/jarbundler-2.2.0/src/net/sourceforge/jarbundler/JavaProperty.java +++ /dev/null @@ -1,80 +0,0 @@ -/* - * Copyright (c) 2003, Seth J. Morabito All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package net.sourceforge.jarbundler; - -public class JavaProperty { - - /** The JavaProperties' name and value */ - - private String name = null; - private String value = null; - - /** - * Construct an empty JavaProperty - */ - - public JavaProperty() { - } - - /** - * Set the JavaProperties's name; required - * - * @param name - * the JavaProperties' name - */ - public void setName(String name) { - this.name = name; - } - - /** - * Get the JavaProperties' name - * - * @return the JavaProperties' name. - */ - public String getName() { - - if (this.name == null) - return null; - - return this.name.trim(); - } - - /** - * Set the JavaProperties' value; required - * - * @param value - * the JavaProperties' value - */ - - public void setValue(String value) { - this.value = value; - } - - /** - * Get the JavaProperties' value. - * - * @return the JavaProperties' value. - */ - public String getValue() { - - if (this.value == null) - return null; - - return this.value.trim(); - } - -} diff --git a/InstallerStub/macos/jarbundler-2.2.0/src/net/sourceforge/jarbundler/PropertyListWriter.java b/InstallerStub/macos/jarbundler-2.2.0/src/net/sourceforge/jarbundler/PropertyListWriter.java deleted file mode 100755 index cec1876..0000000 --- a/InstallerStub/macos/jarbundler-2.2.0/src/net/sourceforge/jarbundler/PropertyListWriter.java +++ /dev/null @@ -1,483 +0,0 @@ -/* - * Write the application bundle file: Info.plist - * - * - * Copyright (c) 2003, Seth J. Morabito All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package net.sourceforge.jarbundler; - -// This package's imports -import javax.xml.transform.OutputKeys; -import javax.xml.transform.Transformer; -import javax.xml.transform.TransformerConfigurationException; -import javax.xml.transform.TransformerException; -import javax.xml.transform.TransformerFactory; -import javax.xml.transform.dom.DOMSource; -import javax.xml.transform.stream.StreamResult; -import net.sourceforge.jarbundler.AppBundleProperties; - -// Java I/O -import java.io.BufferedWriter; -import java.io.File; -import java.io.FileOutputStream; -import java.io.IOException; -import java.io.OutputStreamWriter; -import java.io.Writer; - -// Java Utility -import java.util.Hashtable; -import java.util.Iterator; -import java.util.List; - -// Java language imports -import java.lang.Boolean; -import java.lang.ClassCastException; -import java.lang.Double; -import java.lang.String; -import java.lang.System; - -// Apache Ant -import org.apache.tools.ant.BuildException; -import org.apache.tools.ant.util.FileUtils; - -// Java XML DOM creation -import javax.xml.parsers.DocumentBuilderFactory; -import javax.xml.parsers.DocumentBuilder; -import javax.xml.parsers.ParserConfigurationException; - -// W3C DOM -import org.w3c.dom.Document; -import org.w3c.dom.DOMImplementation; -import org.w3c.dom.Node; -import org.w3c.dom.Element; -import org.w3c.dom.Attr; - - - -/** - * Write out a Java application bundle property list file. For descriptions of - * the property list keys, see Apple docs. - */ - - -public class PropertyListWriter { - - - // Our application bundle properties - private AppBundleProperties bundleProperties; - - private double version = 1.3; - - // DOM version of Info.plist file - private Document document = null; - - - private FileUtils fileUtils = FileUtils.getFileUtils(); - - /** - * Create a new Property List writer. - */ - public PropertyListWriter(AppBundleProperties bundleProperties) { - this.bundleProperties = bundleProperties; - setJavaVersion(bundleProperties.getJVMVersion()); - } - - private void setJavaVersion(String version) { - - if (version == null) - return; - - this.version = Double.valueOf(version.substring(0, 3)).doubleValue(); - } - - - public void writeFile(File fileName) throws BuildException { - - Writer writer = null; - - try { - - this.document = createDOM(); - buildDOM(); - - TransformerFactory transFactory = TransformerFactory.newInstance(); - Transformer trans = transFactory.newTransformer(); - trans.setOutputProperty(OutputKeys.INDENT, "yes"); - trans.setOutputProperty("{http://xml.apache.org/xslt}indent-amount","2" ); - writer = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(fileName), "UTF-8")); - trans.transform(new DOMSource(document), new StreamResult(writer)); - } catch (TransformerConfigurationException tce) { - throw new BuildException(tce); - } catch (TransformerException te) { - throw new BuildException(te); - } catch (ParserConfigurationException pce) { - throw new BuildException(pce); - } catch (IOException ex) { - throw new BuildException("Unable to write \"" + fileName + "\""); - } finally { - fileUtils.close(writer); - } - } - - private Document createDOM() throws ParserConfigurationException { - - DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); - DocumentBuilder documentBuilder = factory.newDocumentBuilder(); - DOMImplementation domImpl = documentBuilder.getDOMImplementation(); - - // We needed to reference using the full class name here because we already have - // a class named "DocumentType" - - org.w3c.dom.DocumentType doctype = domImpl.createDocumentType( - "plist", - "-//Apple Computer//DTD PLIST 1.0//EN", - "http://www.apple.com/DTDs/PropertyList-1.0.dtd"); - - return domImpl.createDocument(null, "plist", doctype); - } - - - private void buildDOM() { - - Element plist = this.document.getDocumentElement(); - plist.setAttribute("version","1.0"); - - // Open the top level dictionary, - - Node dict = createNode("dict", plist); - - // Application short name i.e. About menu name - writeKeyStringPair("CFBundleName", bundleProperties.getCFBundleName(), dict); - - // Finder 'Version' label, defaults to "1.0" - writeKeyStringPair("CFBundleShortVersionString", bundleProperties.getCFBundleShortVersionString(), dict); - - // Finder 'Get Info' - writeKeyStringPair("CFBundleGetInfoString", bundleProperties.getCFBundleGetInfoString(), dict); - - // Mac OS X required key, defaults to "false" - writeKeyStringPair("CFBundleAllowMixedLocalizations", - (bundleProperties.getCFBundleAllowMixedLocalizations() ? "true" : "false"), dict); - - // Mac OS X required, defaults to "6.0" - writeKeyStringPair("CFBundleInfoDictionaryVersion", - bundleProperties.getCFBundleInfoDictionaryVersion(), dict); - - // Bundle Executable name, required, defaults to "JavaApplicationStub" - writeKeyStringPair("CFBundleExecutable", bundleProperties.getCFBundleExecutable(), dict); - - // Bundle Development Region, required, defaults to "English" - writeKeyStringPair("CFBundleDevelopmentRegion", bundleProperties.getCFBundleDevelopmentRegion(), dict); - - // Bundle Package Type, required, defaults tp "APPL" - writeKeyStringPair("CFBundlePackageType", bundleProperties.getCFBundlePackageType(), dict); - - // Bundle Signature, required, defaults tp "????" - writeKeyStringPair("CFBundleSignature", bundleProperties.getCFBundleSignature(), dict); - - // Application build number, optional - if (bundleProperties.getCFBundleVersion() != null) - writeKeyStringPair("CFBundleVersion", bundleProperties.getCFBundleVersion(), dict); - - // Application Icon file, optional - if (bundleProperties.getCFBundleIconFile() != null) - writeKeyStringPair("CFBundleIconFile", bundleProperties.getCFBundleIconFile(), dict); - - // Bundle Identifier, optional - if (bundleProperties.getCFBundleIdentifier() != null) - writeKeyStringPair("CFBundleIdentifier", bundleProperties.getCFBundleIdentifier(), dict); - - // Help Book Folder, optional - if (bundleProperties.getCFBundleHelpBookFolder() != null) - writeKeyStringPair("CFBundleHelpBookFolder", bundleProperties.getCFBundleHelpBookFolder(), dict); - - // Help Book Name, optional - if (bundleProperties.getCFBundleHelpBookName() != null) - writeKeyStringPair("CFBundleHelpBookName", bundleProperties.getCFBundleHelpBookName(), dict); - - // Document Types, optional - List documentTypes = bundleProperties.getDocumentTypes(); - - if (documentTypes.size() > 0) - writeDocumentTypes(documentTypes, dict); - - // Java entry in the plist dictionary - writeKey("Java", dict); - Node javaDict = createNode("dict", dict); - - // Main class, required - writeKeyStringPair("MainClass", bundleProperties.getMainClass(), javaDict); - - // Target JVM version, optional but recommended - if (bundleProperties.getJVMVersion() != null) - writeKeyStringPair("JVMVersion", bundleProperties.getJVMVersion(), javaDict); - - // New in JarBundler 2.2.0; Tobias Bley --------------------------------- - - // JVMArchs, optional - List jvmArchs = bundleProperties.getJVMArchs(); - - if (jvmArchs != null && !jvmArchs.isEmpty()) - writeJVMArchs(jvmArchs, javaDict); - - // lsArchitecturePriority, optional - List lsArchitecturePriority = bundleProperties.getLSArchitecturePriority(); - - if (lsArchitecturePriority != null && !lsArchitecturePriority.isEmpty()) - writeLSArchitecturePriority(lsArchitecturePriority, javaDict); - - //----------------------------------------------------------------------- - - - // Classpath is composed of two types, required - // 1: Jars bundled into the JAVA_ROOT of the application - // 2: External directories or files with an absolute path - - List classPath = bundleProperties.getClassPath(); - List extraClassPath = bundleProperties.getExtraClassPath(); - - if ((classPath.size() > 0) || (extraClassPath.size() > 0)) - writeClasspath(classPath, extraClassPath, javaDict); - - - // JVM options, optional - if (bundleProperties.getVMOptions() != null) - writeKeyStringPair("VMOptions", bundleProperties.getVMOptions(), javaDict); - - // Working directory, optional - if (bundleProperties.getWorkingDirectory() != null) - writeKeyStringPair("WorkingDirectory", bundleProperties.getWorkingDirectory(), javaDict); - - // StartOnMainThread, optional - if (bundleProperties.getStartOnMainThread() != null) { - writeKey("StartOnMainThread", javaDict); - createNode(bundleProperties.getStartOnMainThread().toString(), javaDict); - } - - // SplashFile, optional - if (bundleProperties.getSplashFile() != null) - writeKeyStringPair("SplashFile", bundleProperties.getSplashFile(), javaDict); - - // Main class arguments, optional - if (bundleProperties.getArguments() != null) - writeKeyStringPair("Arguments", bundleProperties.getArguments(), javaDict); - - // Java properties, optional - Hashtable javaProperties = bundleProperties.getJavaProperties(); - - if (javaProperties.isEmpty() == false) - writeJavaProperties(javaProperties, javaDict); - - - // Services, optional - List services = bundleProperties.getServices(); - if (services.size() > 0) - writeServices(services,dict); - - } - - - private void writeDocumentTypes(List documentTypes, Node appendTo) { - - writeKey("CFBundleDocumentTypes", appendTo); - - Node array = createNode("array", appendTo); - - Iterator itor = documentTypes.iterator(); - - while (itor.hasNext()) { - - DocumentType documentType = (DocumentType) itor.next(); - - Node documentDict = createNode("dict", array); - - writeKeyStringPair("CFBundleTypeName", documentType.getName(), documentDict); - writeKeyStringPair("CFBundleTypeRole", documentType.getRole(), documentDict); - - File iconFile = documentType.getIconFile(); - - if (iconFile != null) - writeKeyStringPair("CFBundleTypeIconFile", iconFile.getName(), documentDict); - - - List extensions = documentType.getExtensions(); - - if (extensions.isEmpty() == false) { - writeKey("CFBundleTypeExtensions", documentDict); - writeArray(extensions, documentDict); - } - - List osTypes = documentType.getOSTypes(); - - if (osTypes.isEmpty() == false) { - writeKey("CFBundleTypeOSTypes", documentDict); - writeArray(osTypes, documentDict); - } - - - List mimeTypes = documentType.getMimeTypes(); - - if (mimeTypes.isEmpty() == false) { - writeKey("CFBundleTypeMIMETypes", documentDict); - writeArray(mimeTypes, documentDict); - } - - List UTIs = documentType.getUTIs(); - - if (UTIs.isEmpty() == false) { - writeKey("LSItemContentTypes", documentDict); - writeArray(UTIs, documentDict); - } - - // Only write this key if true - if (documentType.isBundle()) - writeKeyStringPair("LSTypeIsPackage", "true", documentDict); - } - } - - private void writeServices(List services, Node appendTo) { - - writeKey("NSServices",appendTo); - Node array = createNode("array",appendTo); - Iterator itor = services.iterator(); - - while (itor.hasNext()) { - Service service = (Service)itor.next(); - Node serviceDict = createNode("dict",array); - - String portName = service.getPortName(); - if (portName == null) - portName = bundleProperties.getCFBundleName(); - - writeKeyStringPair("NSPortName", portName, serviceDict); - writeKeyStringPair("NSMessage",service.getMessage(),serviceDict); - - List sendTypes = service.getSendTypes(); - if (!sendTypes.isEmpty()) { - writeKey("NSSendTypes",serviceDict); - writeArray(sendTypes,serviceDict); - } - - List returnTypes = service.getReturnTypes(); - if (!returnTypes.isEmpty()) { - writeKey("NSReturnTypes",serviceDict); - writeArray(returnTypes,serviceDict); - } - - writeKey("NSMenuItem",serviceDict); - Node menuItemDict = createNode("dict",serviceDict); - writeKeyStringPair("default",service.getMenuItem(),menuItemDict); - - String keyEquivalent = service.getKeyEquivalent(); - if (null != keyEquivalent) { - writeKey("NSKeyEquivalent",serviceDict); - Node keyEquivalentDict = createNode("dict",serviceDict); - writeKeyStringPair("default",keyEquivalent,keyEquivalentDict); - } - - String userData = service.getUserData(); - if (null != userData) - writeKeyStringPair("NSUserData", userData, serviceDict); - - String timeout = service.getTimeout(); - if (null != timeout) - writeKeyStringPair("NSTimeout",timeout,serviceDict); - } - } - - private void writeClasspath(List classpath, List extraClasspath, Node appendTo) { - writeKey("ClassPath", appendTo); - classpath.addAll(extraClasspath); - writeArray(classpath, appendTo); - } - - - private void writeJavaProperties(Hashtable javaProperties, Node appendTo) { - - writeKey("Properties", appendTo); - - Node propertiesDict = createNode("dict", appendTo); - - for (Iterator i = javaProperties.keySet().iterator(); i.hasNext();) { - String key = (String) i.next(); - - if (key.startsWith("com.apple.") && (version >= 1.4)) { - System.out.println("Deprecated as of 1.4: " + key); - continue; - } - - writeKeyStringPair(key, (String)javaProperties.get(key), propertiesDict); - } - } - - // New in JarBundler 2.2.0; Tobias Bley --------------------------------- - - private void writeJVMArchs(List jvmArchs, Node appendTo) - { - writeKey("JVMArchs", appendTo); - writeArray(jvmArchs, appendTo); - } - - private void writeLSArchitecturePriority(List lsArchitecturePriority, Node appendTo) - { - writeKey("LSArchitecturePriority", appendTo); - writeArray(lsArchitecturePriority, appendTo); - } - - //---------------------------------------------------------------------- - - private Node createNode(String tag, Node appendTo) - { - Node node = this.document.createElement(tag); - appendTo.appendChild(node); - return node; - } - - - private void writeKeyStringPair(String key, String string, Node appendTo) { - - if (string == null) - return; - - writeKey(key, appendTo); - writeString(string, appendTo); - } - - - private void writeKey(String key, Node appendTo) { - Element keyNode = this.document.createElement("key"); - appendTo.appendChild(keyNode); - keyNode.appendChild(this.document.createTextNode(key)); - } - - - private void writeString(String string, Node appendTo) { - Element stringNode = this.document.createElement("string"); - stringNode.appendChild(this.document.createTextNode(string)); - appendTo.appendChild(stringNode); - } - - private void writeArray(List stringList, Node appendTo) { - - Node arrayNode = createNode("array", appendTo); - - for (Iterator it = stringList.iterator(); it.hasNext();) - writeString((String)it.next(), arrayNode); - - } -} diff --git a/InstallerStub/macos/jarbundler-2.2.0/src/net/sourceforge/jarbundler/Service.java b/InstallerStub/macos/jarbundler-2.2.0/src/net/sourceforge/jarbundler/Service.java deleted file mode 100755 index 8f690cd..0000000 --- a/InstallerStub/macos/jarbundler-2.2.0/src/net/sourceforge/jarbundler/Service.java +++ /dev/null @@ -1,220 +0,0 @@ -/* - * Copyright (c) 2003, Seth J. Morabito All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package net.sourceforge.jarbundler; - -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; - - - -/** - * Represents an Info.plist Service specifying a service provided by the application. - * - * Port Name - The name of the port the application monitors for incoming service requests. - * - - * Message - The name of the instance method to invoke for the service. - * In Objective-C, the instance method must be of the form messageName:userData:error:. - * In Java, the instance method must be of the form messageName(NSPasteBoard,String). - * - * - * Menu Item - The text to add to the Services menu. The value must be unique. - * You can use a slash character "/" to specify a submenu. For example, Mail/Send - * would appear in the Services Menu as a menu named Mail with an item named Send. - * - * - * Send Types - A list of the data type names that can be read by the service. - * The NSPasteboard class description lists several common data types. - * - * - * Return Types - A list of the data type names that can be returned by the service. - * The NSPasteboard class description lists several common data types. - * You must specify either Return Types, Send Types or both. - * - * You must specify either Send Types, Return Types or both. - * - * - * Key Equivalent - This attribute is optional. The keyboard equivalent used to invoke - * the service menu command. The value has to be a single character. Users invoke this - * keyboard equivalent by pressing the Command and Shift key modifiers along with the character. - * - * - * User Data - This attribute is optional. The value is free choosable and is passed - * to the method as second parameter. - * - * - * Timeout - This attribute is optional. It indicates the number of milliseconds - * Services should wait for a response from the application providing - * a service when a respond is required. - * - * - * - */ -public class Service { - private static final List EMPTYLIST = new ArrayList(0); - - - /** The name of the port the application monitors for incoming service requests. */ - private String portName = null; - - - /** - - * The name of the instance method to invoke for the service. - * In Objective-C, the instance method must be of the form messageName:userData:error:. - - * In Java, the instance method must be of the form messageName(NSPasteBoard,String). - */ - private String message = null; - - - /** - - * The text to add to the Services menu. The value must be unique. - - * You can use a slash character "/" to specify a submenu. For example, Mail/Send - - * would appear in the Services Menu as a menu named Mail with an item named Send. - */ - private String menuItem = null; - - /** - * A list of the data type names that can be read by the service. - - * The NSPasteboard class description lists several common data types. - - * You must specify either Send Types, Return Types or both. - */ - private String[] sendTypes = null; - - - /** - * A list of the data type names that can be returned by the service. - - * The NSPasteboard class description lists several common data types. - - * You must specify either Return Types, Send Types or both. - */ - private String[] returnTypes = null; - - - /** - * This attribute is optional. The keyboard equivalent used to invoke - - * the service menu command. The value has to be a single character. Users invoke this - - * keyboard equivalent by pressing the Command and Shift key modifiers along with the character. - - */ - private String keyEquivalent = null; - - - /** - - * This attribute is optional. The value is free choosable and is passed - - * to the method as second parameter. - - */ - private String userData = null; - - - /** - - * This attribute is optional. It indicates the number of milliseconds - - * Services should wait for a response from the application providing - - * a service when a respond is required. - - */ - private String timeout = null; - - - public void setPortName(String portName) { - this.portName = portName; - } - - public String getPortName() { - return portName; - } - - public void setMessage(String message) { - this.message = message; - } - - public String getMessage() { - return message; - } - - public void setMenuItem(String menuItem) { - this.menuItem = menuItem; - - } - - public String getMenuItem() { - return menuItem; - } - - public void setSendTypes(String sendTypes) { - this.sendTypes = sendTypes.split("[\\s,]"); - } - - public List getSendTypes() { - return (sendTypes == null) ? EMPTYLIST : Arrays.asList(sendTypes); - } - - public void setReturnTypes(String returnTypes) { - this.returnTypes = returnTypes.split("[\\s,]"); - } - - public List getReturnTypes() { - return (returnTypes == null) ? EMPTYLIST : Arrays.asList(returnTypes); - } - - public void setKeyEquivalent(String keyEquivalent) { - this.keyEquivalent = keyEquivalent; - } - - public String getKeyEquivalent() { - return keyEquivalent; - } - - public void setUserData(String userData) { - this.userData = userData; - } - - public String getUserData() { - return userData; - } - - public void setTimeout(String timeout) { - this.timeout = timeout; - } - - public String getTimeout() { - return timeout; - } -} diff --git a/InstallerStub/macos/makeBin b/InstallerStub/macos/makeBin deleted file mode 100755 index 3cb2448..0000000 --- a/InstallerStub/macos/makeBin +++ /dev/null @@ -1,31 +0,0 @@ -#!/bin/sh -###### Make Zip ###### -appDir="Tizen_SDK_Install.app" - -##zip files -tarGzFile=InstallManager-Network.tar.gz - -tar cvfz ${tarGzFile} InstallManagerC ${appDir} - -## make binary -currentDate=`date '+%Y%m%d%H%M'` -binFile=$1_${currentDate}.bin - -###### Make Bin ###### -CUR_DIR=`pwd` -cp installer_stub installerstub_cp -INSTALLSTUB="installerstub_cp" - -echo "checking" -ORI_MD5SUM=`md5 "${tarGzFile}" | awk '{ print $4 }'` -ORI_LEN=`wc -l "$INSTALLSTUB" | awk '{ print $1 }'` -ORI_LEN=`expr $ORI_LEN + 1` - -echo "making" -sed -e "s|\$\$\$\$__CHKSUM_REPLACE__\$\$\$\$$|\"$ORI_MD5SUM\"|g" $INSTALLSTUB > _temp_1 -sed -e "s|\$\$\$\$__FILE_LENGTH_REPLACE__\$\$\$\$$|\"$ORI_LEN\"|g" _temp_1 > _temp_2 - -cp _temp_2 ${binFile} -cat ${tarGzFile} >> ${binFile} - -rm _temp_1 _temp_2 ${tarGzFile} diff --git a/InstallerStub/macos/makeInstaller b/InstallerStub/macos/makeInstaller deleted file mode 100755 index e725219..0000000 --- a/InstallerStub/macos/makeInstaller +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/sh -x - -## make binary -currentDate=`date '+%Y%m%d%H%M'` -binFile=$1-${currentDate} - -ant -DINSTALL_NAME=${binFile} diff --git a/InstallerStub/windows/readme.txt b/InstallerStub/windows/readme.txt deleted file mode 100644 index c0dba50..0000000 --- a/InstallerStub/windows/readme.txt +++ /dev/null @@ -1,2 +0,0 @@ -installerStub for windows. - -- jonghwan2.park@samsung.com diff --git a/os_stubs/linux/installer_stub b/os_stubs/linux/installer_stub index 17d2fda..ff93227 100755 --- a/os_stubs/linux/installer_stub +++ b/os_stubs/linux/installer_stub @@ -39,11 +39,11 @@ 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 libudev-dev" + INSTALLATION_CHECK="procps gettext libdbus-1-3 libcurl3 expect grep zip make libgnome2-0 libudev-dev libpng12-0" elif [ "fedora" = "${OS_NAME}" ]; then - INSTALLATION_CHECK="procps-ng gettext dbus-libs libcurl expect gtk2 grep zip make qemu-user webkitgtk" + INSTALLATION_CHECK="procps-ng gettext dbus-libs libcurl expect gtk2 grep zip make libgnome qemu-user webkitgtk libpng12" elif [ "tizen" = "${OS_NAME}" ] ; then - INSTALLATION_CHECK="procps-ng gettext-tools libdbus libcurl expect libgtk2 grep zip make qemu-linux-user libwebkitgtk2" + INSTALLATION_CHECK="procps-ng gettext-tools libdbus libcurl expect libgtk2 grep zip make libgnome2 qemu-linux-user libwebkitgtk2" fi pkg_list="" diff --git a/os_stubs/windows/InstallManager-64.nsi b/os_stubs/windows/InstallManager-64.nsi index a275d0c..78d2629 100644 --- a/os_stubs/windows/InstallManager-64.nsi +++ b/os_stubs/windows/InstallManager-64.nsi @@ -10,11 +10,67 @@ Icon "SDK_icon.ico" !include LogicLib.nsh !insertmacro GetParameters !insertmacro GetOptions -!define /date MYTIMESTAMP "%Y%m%d%H%M%S" + +### TimeStamp +!ifndef TimeStamp + !define TimeStamp "!insertmacro _TimeStamp" + !macro _TimeStamp FormatedString + !ifdef __UNINSTALL__ + Call un.__TimeStamp + !else + Call __TimeStamp + !endif + Pop ${FormatedString} + !macroend + +!macro __TimeStamp UN +Function ${UN}__TimeStamp + ClearErrors + ## Store the needed Registers on the stack + Push $0 ; Stack $0 + Push $1 ; Stack $1 $0 + Push $2 ; Stack $2 $1 $0 + Push $3 ; Stack $3 $2 $1 $0 + Push $4 ; Stack $4 $3 $2 $1 $0 + Push $5 ; Stack $5 $4 $3 $2 $1 $0 + Push $6 ; Stack $6 $5 $4 $3 $2 $1 $0 + + ## Call System API to get the current system Time + System::Alloc 16 + Pop $0 + System::Call 'kernel32::GetLocalTime(i) i(r0)' + System::Call '*$0(&i2, &i2, &i2, &i2, &i2, &i2, &i2, &i2)i (.r1, .r2, n, .r3, .r4, .r5, .r6)' + System::Free $0 + + IntFmt $2 "%02i" $2 + IntFmt $3 "%02i" $3 + IntFmt $4 "%02i" $4 + IntFmt $5 "%02i" $5 + IntFmt $6 "%02i" $6 + + ## Generate Timestamp + StrCpy $0 "$1$2$3$4$5$6" + + ## Restore the Registers and add Timestamp to the Stack + Pop $6 ; Stack $5 $4 $3 $2 $1 $0 + Pop $5 ; Stack $4 $3 $2 $1 $0 + Pop $4 ; Stack $3 $2 $1 $0 + Pop $3 ; Stack $2 $1 $0 + Pop $2 ; Stack $1 $0 + Pop $1 ; Stack $0 + Exch $0 ; Stack ${TimeStamp} + +FunctionEnd +!macroend +!insertmacro __TimeStamp "" +!insertmacro __TimeStamp "un." +!endif +########### section ${GetParameters} $R0 ${GetExePath} $R1 + ${TimeStamp} $0 SetRegView 64 StrCpy $1 "SOFTWARE\JavaSoft\Java Runtime Environment" @@ -33,7 +89,7 @@ section done: StrCpy $2 '-path "$R1"' - StrCpy $INSTDIR "$TEMP\tizensdk_${MYTIMESTAMP}" + StrCpy $INSTDIR "$TEMP\tizensdk_$0" RMDir /r $INSTDIR SetOutPath $INSTDIR SetOverwrite on diff --git a/os_stubs/windows/InstallManager.nsi b/os_stubs/windows/InstallManager.nsi index d0f1419..f7de70c 100644 --- a/os_stubs/windows/InstallManager.nsi +++ b/os_stubs/windows/InstallManager.nsi @@ -10,11 +10,67 @@ Icon "SDK_icon.ico" !include LogicLib.nsh !insertmacro GetParameters !insertmacro GetOptions -!define /date MYTIMESTAMP "%Y%m%d%H%M%S" + +### TimeStamp +!ifndef TimeStamp + !define TimeStamp "!insertmacro _TimeStamp" + !macro _TimeStamp FormatedString + !ifdef __UNINSTALL__ + Call un.__TimeStamp + !else + Call __TimeStamp + !endif + Pop ${FormatedString} + !macroend + +!macro __TimeStamp UN +Function ${UN}__TimeStamp + ClearErrors + ## Store the needed Registers on the stack + Push $0 ; Stack $0 + Push $1 ; Stack $1 $0 + Push $2 ; Stack $2 $1 $0 + Push $3 ; Stack $3 $2 $1 $0 + Push $4 ; Stack $4 $3 $2 $1 $0 + Push $5 ; Stack $5 $4 $3 $2 $1 $0 + Push $6 ; Stack $6 $5 $4 $3 $2 $1 $0 + + ## Call System API to get the current system Time + System::Alloc 16 + Pop $0 + System::Call 'kernel32::GetLocalTime(i) i(r0)' + System::Call '*$0(&i2, &i2, &i2, &i2, &i2, &i2, &i2, &i2)i (.r1, .r2, n, .r3, .r4, .r5, .r6)' + System::Free $0 + + IntFmt $2 "%02i" $2 + IntFmt $3 "%02i" $3 + IntFmt $4 "%02i" $4 + IntFmt $5 "%02i" $5 + IntFmt $6 "%02i" $6 + + ## Generate Timestamp + StrCpy $0 "$1$2$3$4$5$6" + + ## Restore the Registers and add Timestamp to the Stack + Pop $6 ; Stack $5 $4 $3 $2 $1 $0 + Pop $5 ; Stack $4 $3 $2 $1 $0 + Pop $4 ; Stack $3 $2 $1 $0 + Pop $3 ; Stack $2 $1 $0 + Pop $2 ; Stack $1 $0 + Pop $1 ; Stack $0 + Exch $0 ; Stack ${TimeStamp} + +FunctionEnd +!macroend +!insertmacro __TimeStamp "" +!insertmacro __TimeStamp "un." +!endif +########### section ${GetParameters} $R0 ${GetExePath} $R1 + ${TimeStamp} $0 StrCpy $1 "SOFTWARE\JavaSoft\Java Runtime Environment" StrCpy $2 0 @@ -32,7 +88,7 @@ section done: StrCpy $2 '-path "$R1"' - StrCpy $INSTDIR "$TEMP\tizensdk_${MYTIMESTAMP}" + StrCpy $INSTDIR "$TEMP\tizensdk_$0" RMDir /r $INSTDIR SetOutPath $INSTDIR SetOverwrite on diff --git a/os_stubs/windows/makeExe b/os_stubs/windows/makeExe index 36b9cca..bb47947 100755 --- a/os_stubs/windows/makeExe +++ b/os_stubs/windows/makeExe @@ -16,7 +16,7 @@ then then if [ "$SIGNPASSWORD" != "" ] then - "$SIGNTOOL_PATH" "sign" "//f" "$SIGNFILE_PATH" "//p" "${SIGNPASSWORD}" "//t" "http://timestamp.verisign.com/scripts/timestamp.dll" "$SRCDIR/build/inst-manager.exe" + "$SIGNTOOL_PATH" "sign" "//f" "$SIGNFILE_PATH" "//p" "${SIGNPASSWORD}" "$SRCDIR/build/inst-manager.exe" else echo "Skip signing... Signing password is not defined!" fi diff --git a/package/build.linux b/package/build.linux index c03996a..7455ee8 100755 --- a/package/build.linux +++ b/package/build.linux @@ -5,7 +5,7 @@ targetBinary="inst-manager" ##make config file buildConfigFile() { configFile="${buildDir}/installmanager.conf" - packageServer="http://download.tizen.org/sdk/packages-2.2b/" + packageServer="http://download.tizen.org/sdk/packages/" distribution="official" releaseNoteUrl="https://developer.tizen.org/downloads/sdk/2.0-release-notes" diff --git a/package/build.macos b/package/build.macos index 0be1ad2..10e9997 100755 --- a/package/build.macos +++ b/package/build.macos @@ -5,7 +5,7 @@ targetBinary="inst-manager" ##make config file buildConfigFile() { configFile="${buildDir}/installmanager.conf" - packageServer="http://download.tizen.org/sdk/packages-2.2b/" + packageServer="http://download.tizen.org/sdk/packages/" distribution="official" releaseNoteUrl="https://developer.tizen.org/downloads/sdk/2.0-release-notes" diff --git a/package/build.windows b/package/build.windows index 0c53032..3010568 100755 --- a/package/build.windows +++ b/package/build.windows @@ -5,7 +5,7 @@ targetBinary="inst-manager" ##make config file buildConfigFile() { configFile="${buildDir}/img/installmanager.conf" - packageServer="http://download.tizen.org/sdk/packages-2.2b/" + packageServer="http://download.tizen.org/sdk/packages/" distribution="official" releaseNoteUrl="https://developer.tizen.org/downloads/sdk/2.0-release-notes" diff --git a/package/changelog b/package/changelog index 9e0dad1..5341d7d 100644 --- a/package/changelog +++ b/package/changelog @@ -1,3 +1,42 @@ +*2.2.29 +- Modify tsudo.sh script for working well. +- InstallManager works well by cli mode. +== Yongsung Kim 2013-07-12 +*2.2.28 +- Modify tsudo.sh script for working well. +== Yongsung Kim 2013-07-11 +*2.2.27 +- Modify InstallManager-64.nsi script because of useless character +== Yongsung Kim 2013-07-10 +*2.2.26 +- Add libpng package to pre-requisites for ubuntu and fedora. +- Progress bar works better than before. +- When installmanager makes temporary directory for installation on windows, it can get current time correctly. +== Yongsung Kim 2013-07-10 +*2.2.25 +- InstallManager can support 'tsudo' command as ${TSUDO} for install and remove script of package. +- InstallManager can support non-interactive cli mode. +- Modify wrong character in install script of installmanager. +- InstallManager works well by cli mode. +- change the directory location to download packages.(to target directory/.info/download) +== Yongsung Kim 2013-07-09 +*2.2.23 +- InstallManager can support 'tsudo' command as ${TSUDO} for install and remove script of package. +== Yongsung Kim 2013-07-08 +*2.2.21 +- InstallManager can show remove target directory dialog end of uninstallation. +- Fix bug that installmanager cannot update SDK. +- InstallManager can support SDK_DATA_PATH environment variable when SDK updates. +- InstallManager can check that input paths are duplicated and has wrong pattern both SDK install path and SDK data path same time. +- Error message more detail than before in set install path page. +== Yongsung Kim 2013-07-04 +*2.2.20 +- When installmanager cancels to download packages, remove the target directory. +- Add libgnome to prerequistes +== Yongsung Kim 2013-07-04 +*2.2.19 +- For 2.2 beta. InstallManage heads for http://download.tizen.org/sdk/packages/ +== Yongsung Kim 2013-07-04 *2.2.18 - For 2.2 beta. InstallManage heads for http://download.tizen.org/sdk/packages-2.2b/ == Shihyun Kim 2013-06-29 diff --git a/package/install-manager.install.linux b/package/install-manager.install.linux index ccae460..0a2ea92 100755 --- a/package/install-manager.install.linux +++ b/package/install-manager.install.linux @@ -28,5 +28,5 @@ if [ -f "${CONFIG_FILE}" ]; then echo ${CONFIG_FILE} exists. else echo "TIZEN_SDK_INSTALLED_PATH="${INSTALLED_PATH} >> ${CONFIG_FILE} - echo "TIZNE_SDK_DATA_PATH="${HOME}"/tizen-sdk-data" >> ${CONFIG_FILE} + echo "TIZEN_SDK_DATA_PATH="${HOME}"/tizen-sdk-data" >> ${CONFIG_FILE} fi diff --git a/package/install-manager.install.macos-64 b/package/install-manager.install.macos-64 index d3f73fb..acf2969 100644 --- a/package/install-manager.install.macos-64 +++ b/package/install-manager.install.macos-64 @@ -6,5 +6,5 @@ if [ -f "${CONFIG_FILE}" ]; then echo ${CONFIG_FILE} exists. else echo "TIZEN_SDK_INSTALLED_PATH="${INSTALLED_PATH} >> ${CONFIG_FILE} - echo "TIZNE_SDK_DATA_PATH="${HOME}"/tizen-sdk-data" >> ${CONFIG_FILE} + echo "TIZEN_SDK_DATA_PATH="${HOME}"/tizen-sdk-data" >> ${CONFIG_FILE} fi diff --git a/package/pkginfo.manifest b/package/pkginfo.manifest index 104a66a..5b8bdfb 100644 --- a/package/pkginfo.manifest +++ b/package/pkginfo.manifest @@ -1,5 +1,5 @@ Source: install-manager -Version: 2.2.18 +Version: 2.2.29 Maintainer: Shihyun Kim, Yongsung Kim Package: install-manager diff --git a/utils/makeDmgFromZip b/utils/makeDmgFromZip deleted file mode 100644 index 88e1ec9..0000000 --- a/utils/makeDmgFromZip +++ /dev/null @@ -1,27 +0,0 @@ -#!/bin/bash -# check arguments -SDK_PKG_FILE=$2 -DMG_NAME=$1 - -#check tools -REQUIRE_BINARY="hdiutil" -echo "Checking Prerequisite..." -for bin in $REQUIRE_BINARY -do - if [ "`which $bin 2>/dev/null`" ] ; then - echo "checking $bin... OK" - else - echo "checking $bin... is not installed" - exit 1 - fi -done - -# extract -rm -rf ./data -unzip $SDK_PKG_FILE -d ./ - -# make dmg -hdiutil create ./${DMG_NAME}.dmg -srcfolder ./data/install-manager/*.app -ov - -# remove extracted files -rm -rf ./data diff --git a/utils/makeImageLinux b/utils/makeImageLinux deleted file mode 100755 index 322b5da..0000000 --- a/utils/makeImageLinux +++ /dev/null @@ -1,36 +0,0 @@ -#!/bin/sh - -if [ ! -f installmanager.conf ] -then - echo "installmanager.conf file do not exist." - exit 1 -fi - -if [ $# -ne 1 ] -then - echo "Check your parameter. This script need 1 parameter(binary file name) " - echo "ex)./makeImageLinux ImageForUbuntu" - exit 1 -fi - -##download packages to './binary/*' -./InstallManager -onlyDownload all linux - -mv installmanager.conf installmanager.conf.temp -echo ${version} >> installmanager.conf - -currentDate=`date '+%Y%m%d%H%M'` - -zip -r $1_${currentDate} binary/ pkg_list_linux - -echo "exitcode="$? - -rm installmanager.conf pkg_list_linux - -if [ $? -eq 0 ] -then - rm -rf binary -fi - -mv installmanager.conf.temp installmanager.conf - diff --git a/utils/makeImageWindows b/utils/makeImageWindows deleted file mode 100755 index 207e6fc..0000000 --- a/utils/makeImageWindows +++ /dev/null @@ -1,36 +0,0 @@ -#!/bin/sh - -if [ ! -f installmanager.conf ] -then - echo "installmanager.conf file do not exist." - exit 1 -fi - -if [ $# -ne 1 ] -then - echo "Check your parameter. This script need 1 parameter(binary file name) " - echo "ex)./makeImageWindows ImageForWindows" - exit 1 -fi - -##download packages to './binary/*' -./InstallManager -onlyDownload all windows - -mv installmanager.conf installmanager.conf.temp -echo ${version} >> installmanager.conf - -currentDate=`date '+%Y%m%d%H%M'` - -zip -r $1_${currentDate} binary/ pkg_list_windows - -echo "exitcode="$? - -rm installmanager.conf pkg_list_windows - -if [ $? -eq 0 ] -then - rm -rf binary -fi - -mv installmanager.conf.temp installmanager.conf - diff --git a/utils/makeLocal b/utils/makeLocal deleted file mode 100755 index 38ffc25..0000000 --- a/utils/makeLocal +++ /dev/null @@ -1,43 +0,0 @@ -#!/bin/sh - -if [ ! -f installmanager.conf ] -then - echo "installmanager.conf file do not exist." - exit 1 -fi - -if [ $# -ne 1 ] -then - echo "Check your parameter. This script need 1 parameter(binary file name) " - echo "ex)./makeLocal tizen_sdk_local" - exit 1 -fi - -##download packages to './binary/*' -./InstallManager -onlyDownload all - -##create local config file -version=`grep "Version" installmanager.conf` - -mv installmanager.conf installmanager.conf.temp -echo ${version} >> installmanager.conf - -tar cvfz InstallManager-Local.tar.gz binary/ InstallManager InstallManager.jar installmanager.conf pkg_list_linux - -echo "exitcode="$? - -rm installmanager.conf pkg_list_linux - -if [ $? -eq 0 ] -then - rm -rf binary -fi - -currentDate=`date '+%Y%m%d%H%M'` -binFile=$1_${currentDate}.bin - -./makeInstaller InstallManager-Local.tar.gz ${binFile} - -rm -rf InstallManager-Local.tar.gz -mv installmanager.conf.temp installmanager.conf -