diff --git a/InstallerSharedCore/src/actionScripts/managers/DetectionManager.as b/InstallerSharedCore/src/actionScripts/managers/DetectionManager.as index 1530c5c..c675ed3 100644 --- a/InstallerSharedCore/src/actionScripts/managers/DetectionManager.as +++ b/InstallerSharedCore/src/actionScripts/managers/DetectionManager.as @@ -279,17 +279,17 @@ package actionScripts.managers case ComponentTypes.TYPE_SVN: if (HelperConstants.IS_MACOS) { - var svnDefaultPaths:Array = ["/usr/local/bin", "/opt/local/bin"]; + var svnDefaultPaths:Array = ["/usr/local/bin/svn", "/opt/local/bin/svn"]; for each(var svnPath:String in svnDefaultPaths) { - item.installToPath = HelperUtils.isValidExecutableBy( + item.isAlreadyDownloaded = HelperUtils.isValidExecutableBy( item.type, svnPath, item.pathValidation ); - item.isAlreadyDownloaded = item.installToPath != null; if (item.isAlreadyDownloaded) { + item.installToPath = svnPath; break; } } @@ -300,41 +300,53 @@ package actionScripts.managers break; case ComponentTypes.TYPE_HAXE: var haxeDefaultPath:String = HelperConstants.IS_MACOS ? "/usr/local/lib/haxe" : "c:\\HaxeToolkit\\haxe"; - item.installToPath = HelperUtils.isValidExecutableBy( + item.isAlreadyDownloaded = HelperUtils.isValidExecutableBy( item.type, haxeDefaultPath, item.pathValidation ); - item.isAlreadyDownloaded = item.installToPath != null; + if (item.isAlreadyDownloaded) + { + item.installToPath = haxeDefaultPath; + } break; case ComponentTypes.TYPE_NEKO: var nekoDefaultPath:String = HelperConstants.IS_MACOS ? "/usr/local/lib/neko" : "c:\\HaxeToolkit\\neko"; - item.installToPath = HelperUtils.isValidExecutableBy( + item.isAlreadyDownloaded = HelperUtils.isValidExecutableBy( item.type, nekoDefaultPath, item.pathValidation ); - item.isAlreadyDownloaded = item.installToPath != null; + if (item.isAlreadyDownloaded) + { + item.installToPath = nekoDefaultPath; + } break; case ComponentTypes.TYPE_VAGRANT: var vagrantDefaultPath:String = HelperConstants.IS_MACOS ? "/usr/local/bin" : "C:\\HashiCorp\\Vagrant"; - item.installToPath = HelperUtils.isValidExecutableBy( + item.isAlreadyDownloaded = HelperUtils.isValidExecutableBy( item.type, vagrantDefaultPath, item.pathValidation ); - item.isAlreadyDownloaded = item.installToPath != null; + if (item.isAlreadyDownloaded) + { + item.installToPath = vagrantDefaultPath; + } break; case ComponentTypes.TYPE_MACPORTS: if (HelperConstants.IS_MACOS) { var macPortsDefaultPath:String = "/opt/local/bin"; - item.installToPath = HelperUtils.isValidExecutableBy( + item.isAlreadyDownloaded = HelperUtils.isValidExecutableBy( item.type, macPortsDefaultPath, item.pathValidation ); - item.isAlreadyDownloaded = item.installToPath != null; + if (item.isAlreadyDownloaded) + { + item.installToPath = macPortsDefaultPath; + } } break; } diff --git a/InstallerSharedCore/src/actionScripts/utils/HelperUtils.as b/InstallerSharedCore/src/actionScripts/utils/HelperUtils.as index 97302dd..3caf1a7 100644 --- a/InstallerSharedCore/src/actionScripts/utils/HelperUtils.as +++ b/InstallerSharedCore/src/actionScripts/utils/HelperUtils.as @@ -148,7 +148,7 @@ package actionScripts.utils return false; } - public static function isValidExecutableBy(type:String, originPath:String, validationPath:Array=null):String + public static function isValidExecutableBy(type:String, originPath:String, validationPath:Array=null):Boolean { var pathValidationFileName:String; if (FileUtils.isPathExists(originPath)) @@ -160,7 +160,7 @@ package actionScripts.utils (type == ComponentTypes.TYPE_GIT) && !isGitSVNSpecialPathCheckPass(originPath)) { - return null; + return false; } // file-system check inside the named-sdk @@ -179,14 +179,14 @@ package actionScripts.utils var fullPath:String = originPath + File.separator + pathValidationFileName; if (FileUtils.isPathExists(fullPath)) { - return fullPath; + return true; } } else { if (originPath.toLowerCase().indexOf(pathValidationFileName.toLowerCase()) != -1) { - return originPath; + return true; } } } @@ -194,11 +194,11 @@ package actionScripts.utils } else { - return originPath; + return true; } } - return null; + return false; } public static function updatePathWithCustomWindows(path:String):void