flex-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From erikdebr...@apache.org
Subject svn commit: r1376073 [2/4] - in /incubator/flex/utilities/trunk: common/src/assets/images/ common/src/org/ common/src/org/apache/ common/src/org/apache/flex/ common/src/org/apache/flex/utilities/ common/src/org/apache/flex/utilities/common/ common/src/...
Date Wed, 22 Aug 2012 14:35:33 GMT
Modified: incubator/flex/utilities/trunk/installer/src/InstallApacheFlex.mxml
URL: http://svn.apache.org/viewvc/incubator/flex/utilities/trunk/installer/src/InstallApacheFlex.mxml?rev=1376073&r1=1376072&r2=1376073&view=diff
==============================================================================
--- incubator/flex/utilities/trunk/installer/src/InstallApacheFlex.mxml (original)
+++ incubator/flex/utilities/trunk/installer/src/InstallApacheFlex.mxml Wed Aug 22 14:35:32 2012
@@ -35,7 +35,7 @@ variables are not required because the l
 					   xmlns:s="library://ns.adobe.com/flex/spark" 
 					   xmlns:mx="library://ns.adobe.com/flex/mx"
 					   width="800" height="550" maxWidth="800" maxHeight="550" minWidth="800" minHeight="550"
-					   backgroundColor="0xDDDDDD" title="Package Apache Flex SDK for use in an IDE"
+					   backgroundColor="0xDDDDDD"
 					   applicationComplete="handleApplicationComplete(event)" showStatusBar="false"
 					   skinClass="ws.tink.spark.skins.controls.InstallApacheFlexSkin" 
 					   xmlns:controls="ws.tink.spark.controls.*" 
@@ -46,1663 +46,1664 @@ variables are not required because the l
 	<fx:Style source="assets/styles/ApacheFlexToolsStyle.css" />
 	<fx:Style source="assets/styles/InstallApacheFlexStyle.css" />
 	
-	<fx:Script>
-		<![CDATA[	
-			import flash.globalization.LocaleID;
-			import flash.globalization.StringTools;
-			
-			import mx.collections.ArrayCollection;
-			import mx.core.IFlexDisplayObject;
-			import mx.events.FlexEvent;
-			import mx.managers.PopUpManager;
-			import mx.utils.StringUtil;
-			
-			import org.apache.flex.packageflexsdk.model.OptionalComponentVO;
-			import org.apache.flex.packageflexsdk.resource.RuntimeLocale;
-			import org.apache.flex.packageflexsdk.resource.ViewResourceConstants;
-			import org.apache.flex.packageflexsdk.util.MD5CompareUtil;
-			import org.apache.flex.packageflexsdk.util.MirrorURLUtil;
-			import org.apache.flex.packageflexsdk.view.UpdaterDialog;
-			import org.apache.flex.packageflexsdk.view.components.AdobeLicense;
-			import org.apache.flex.packageflexsdk.view.components.ConsoleWindow;
-			import org.apache.flex.packageflexsdk.view.components.MPLLicense;
-			import org.as3commons.zip.Zip;
-			import org.as3commons.zip.ZipEvent;
-			import org.as3commons.zip.ZipFile;
-			
-			import spark.events.IndexChangeEvent;
-			import spark.events.TextOperationEvent;
-			
-			import ws.tink.spark.controls.StepItem;
-			
-			/**
-			 * Installer version number for the log file.  
-			 */			
-			private static const INSTALLER_VERSION:String = String(INSTALLER::releaseVersion);
-			private static const INSTALLER_BUILD_NUMBER:String = String(INSTALLER::buildNumber);
-			
-			/**
-			 * Local Constants
-			 */
-			private const TMP_URL:String = "http://mirror.metrocast.net/apache/";
-			
-			/**
-			 * Utility Singleton Instances
-			 */
-			private var _md5CompareUtil:MD5CompareUtil = MD5CompareUtil.instance;
-			private var _mirrorURLUtil:MirrorURLUtil = MirrorURLUtil.instance;
+	<fx:Script><![CDATA[
+		
+		import flash.globalization.LocaleID;
+		import flash.globalization.StringTools;
+		
+		import mx.collections.ArrayCollection;
+		import mx.core.IFlexDisplayObject;
+		import mx.events.FlexEvent;
+		import mx.managers.PopUpManager;
+		import mx.utils.StringUtil;
+		
+		import org.apache.flex.packageflexsdk.model.OptionalComponentVO;
+		import org.apache.flex.packageflexsdk.resource.ViewResourceConstants;
+		import org.apache.flex.packageflexsdk.util.MD5CompareUtil;
+		import org.apache.flex.packageflexsdk.view.UpdaterDialog;
+		import org.apache.flex.packageflexsdk.view.components.AdobeLicense;
+		import org.apache.flex.packageflexsdk.view.components.ConsoleWindow;
+		import org.apache.flex.packageflexsdk.view.components.MPLLicense;
+		import org.apache.flex.utilities.common.Constants;
+		import org.apache.flex.utilities.common.MirrorURLUtil;
+		import org.apache.flex.utilities.common.interfaces.ILog;
+		import org.apache.flex.utilities.common.vo.LogMessagesVO;
+		import org.as3commons.zip.Zip;
+		import org.as3commons.zip.ZipEvent;
+		import org.as3commons.zip.ZipFile;
+		
+		import spark.events.IndexChangeEvent;
+		import spark.events.TextOperationEvent;
+		
+		import ws.tink.spark.controls.StepItem;
+		
+		private var _mirrorURLCGI:String;
+		private var _latestVersion:String;
+		
+		public var installerAppPath:String;
+		public var installerAppFileName:String;
+		
+		/**
+		 * Installer version number for the log file.  
+		 */			
+		private static const INSTALLER_VERSION:String = String(INSTALLER::releaseVersion);
+		private static const INSTALLER_BUILD_NUMBER:String = String(INSTALLER::buildNumber);
+		
+		/**
+		 * Utility Singleton Instances
+		 */
+		private var _md5CompareUtil:MD5CompareUtil = MD5CompareUtil.instance;
+		private var _mirrorURLUtil:MirrorURLUtil = MirrorURLUtil.instance;
 
-			/**
-			 * The url that stores the current version number of the InstallApacheFlex.{exe|dmg}  
-			 */
-			private var VERSION_URL:String;
-			
-			/**
-			 * Apache Flex binary distribution
-			 * 
-			 * Values stored in ApacheFlexConfig.xml edit file to change
-			 * 
-			 */
-			private var APACHE_FLEX_BIN_DISTRO_DOMAIN:String;
-			private var APACHE_FLEX_BIN_DISTRO_PATH:String;
-			private var APACHE_FLEX_BIN_DISTRO_FILE:String;
-			private var APACHE_FLEX_BIN_DISTRO_URL:String;
-			
-			/**
-			 * Adobe AIR SDK
-			 * 
-			 * Values stored in ApacheFlexConfig.xml edit file to change
-			 * 
-			 */ 
-			private var ADOBE_AIR_SDK_WIN_FILE:String;
-			private var ADOBE_AIR_SDK_WIN_URL:String;
-			private var ADOBE_AIR_SDK_MAC_FILE:String;
-			private var ADOBE_AIR_SDK_MAC_URL:String;
-			
-			/**
-			 * Adobe Flash Player
-			 * 
-			 * Values stored in ApacheFlexConfig.xml edit file to change
-			 * 
-			 */
-			private var ADOBE_FB_GLOBALPLAYER_SWC_FILE:String;
-			private var ADOBE_FB_GLOBALPLAYER_SWC_URL:String;
-			
-			
-			/**
-			 * Optional installs 
-			 * 
-			 */
-			private var OSMF_FILE:String;
-			private var OSMF_URL:String;
-			
-			private var TLF_FILE:String;
-			private var TLF_URL:String;
-			
-			private var BLAZEDS_FILE:String;
-			private var BLAZEDS_URL:String;
-			
-			private var AFE_FILE:String;
-			private var AFE_URL:String;
-			private var AGLJ40_FILE:String;
-			private var AGLJ40_URL:String;
-			private var FLEX_FONTKIT_FILE:String;
-			private var FLEX_FONTKIT_URL:String;
-			private var RIDEAU_FILE:String;
-			private var RIDEAU_URL:String;
-			
-			private const APP_NAME:String = "InstallApacheFlex";
-			private const WINDOWS_OS:String = "windows";
-			private const MAC_OS:String = "mac";
-			
-			[Bindable]private var _flexHome:String;
-			private var _flexTemp:String;
-			private var _flexHomeDir:File;
-			private var _flexTempDir:File;
-			private var _apacheFlexSDKZipFile:File;
-			private var _adobeAIRSDKZipFile:File;
-			private var _fbGlobalPlayerDir:File;
-			private var _fbGlobalPlayerFile:File;
-			private var _blazeDSJarFile:File;
-			private var _afeJarFile:File;
-			private var _aglj40JarFile:File;
-			private var _flexFontKitJarFile:File;
-			private var _rideauJarFile:File;
-			private var _osmfFile:File;
-			private var _tlfFile:File;
-			
-			private var _os:String;
-			private var _loader:URLLoader;	
-			private var _process:NativeProcess;
-			private var _previousDisplayedPercent:int = 0;
-			private var _runtimeLocale:RuntimeLocale = new RuntimeLocale();
-			private var _fileUnzipErrorFunction:Function;
-			private var _numOptionalComponents:int = 4;
-			private var _numOptionalComponentsPermissions:int = 0;
-			
-			[Bindable] private var _constants:ViewResourceConstants;
-			[Bindable] private var _installationSteps:ArrayCollection = new ArrayCollection();
-			[Bindable] private var _optionalInstallsDataProvider:ArrayCollection = new ArrayCollection();
-			[Bindable] public var _messages:ArrayCollection = new ArrayCollection();
+		/**
+		 * Apache Flex binary distribution
+		 * 
+		 * Values stored in ApacheFlexConfig.xml edit file to change
+		 * 
+		 */
+		private var APACHE_FLEX_BIN_DISTRO_PATH:String;
+		private var APACHE_FLEX_BIN_DISTRO_FILE:String;
+		private var APACHE_FLEX_BIN_DISTRO_URL:String;
+		
+		/**
+		 * Adobe AIR SDK
+		 * 
+		 * Values stored in ApacheFlexConfig.xml edit file to change
+		 * 
+		 */ 
+		private var ADOBE_AIR_SDK_WIN_FILE:String;
+		private var ADOBE_AIR_SDK_WIN_URL:String;
+		private var ADOBE_AIR_SDK_MAC_FILE:String;
+		private var ADOBE_AIR_SDK_MAC_URL:String;
+		
+		/**
+		 * Adobe Flash Player
+		 * 
+		 * Values stored in ApacheFlexConfig.xml edit file to change
+		 * 
+		 */
+		private var ADOBE_FB_GLOBALPLAYER_SWC_FILE:String;
+		private var ADOBE_FB_GLOBALPLAYER_SWC_URL:String;
+		
+		
+		/**
+		 * Optional installs 
+		 * 
+		 */
+		private var OSMF_FILE:String;
+		private var OSMF_URL:String;
+		
+		private var TLF_FILE:String;
+		private var TLF_URL:String;
+		
+		private var BLAZEDS_FILE:String;
+		private var BLAZEDS_URL:String;
+		
+		private var AFE_FILE:String;
+		private var AFE_URL:String;
+		private var AGLJ40_FILE:String;
+		private var AGLJ40_URL:String;
+		private var FLEX_FONTKIT_FILE:String;
+		private var FLEX_FONTKIT_URL:String;
+		private var RIDEAU_FILE:String;
+		private var RIDEAU_URL:String;
+		
+		private const WINDOWS_OS:String = "windows";
+		private const MAC_OS:String = "mac";
+		
+		[Bindable]private var _flexHome:String;
+		private var _flexTemp:String;
+		private var _flexHomeDir:File;
+		private var _flexTempDir:File;
+		private var _apacheFlexSDKZipFile:File;
+		private var _adobeAIRSDKZipFile:File;
+		private var _fbGlobalPlayerDir:File;
+		private var _fbGlobalPlayerFile:File;
+		private var _blazeDSJarFile:File;
+		private var _afeJarFile:File;
+		private var _aglj40JarFile:File;
+		private var _flexFontKitJarFile:File;
+		private var _rideauJarFile:File;
+		private var _osmfFile:File;
+		private var _tlfFile:File;
+		
+		private var _os:String;
+		private var _loader:URLLoader;	
+		private var _process:NativeProcess;
+		private var _previousDisplayedPercent:int = 0;
+		private var _fileUnzipErrorFunction:Function;
+		private var _numOptionalComponents:int = 4;
+		private var _numOptionalComponentsPermissions:int = 0;
+		
+		[Bindable] private var _viewResourceConstants:ViewResourceConstants;
+		[Bindable] private var _installationSteps:ArrayCollection = new ArrayCollection();
+		[Bindable] private var _optionalInstallsDataProvider:ArrayCollection = new ArrayCollection();
+		[Bindable] public var _messages:ArrayCollection = new ArrayCollection();
+		
+		protected function handleApplicationComplete(event:FlexEvent):void
+		{
+			_langSelect.dataProvider = ViewResourceConstants.supportedLanguages;
+			_langSelect.selectedIndex = 0;
+			selectDefaultLanguage();
+
+			_viewResourceConstants = ViewResourceConstants.instance;
+			resourceManager.addEventListener(Event.CHANGE, _viewResourceConstants.update);
+			_viewResourceConstants.update();
+
+			updateWindow();
 			
-			protected function handleApplicationComplete(event:FlexEvent):void
-			{
-				centerWindow();
-				
-				_constants = ViewResourceConstants.getInstance();
-				_runtimeLocale.enumerateBundles();
-				_langSelect.dataProvider = _runtimeLocale.supportedLanguage;
-				_langSelect.selectedIndex = 0;
-				selectDefaultLanguage();
-				
-				_mirrorURLUtil.getMirrorURL(getApacheMirrorURLResultHandler);
-			}
+			loadXML();
+		}
+		
+		private function updateWindowTitle():void
+		{
+			this.nativeWindow.title = _viewResourceConstants.INFO_WINDOW_TITLE;
+		}
+		
+		protected function selectDefaultLanguage():void 
+		{
+			var supportedLanguages:ArrayCollection = ViewResourceConstants.supportedLanguages;
 			
-			private function getApacheMirrorURLResultHandler(abort:Boolean, classLog:ArrayCollection):void
-			{
-				var i:int;
-				var n:int = classLog.length;
-				for (i = 0; i < n; i++)
-				{
-					log(String(classLog.getItemAt(i)));
-				}
-				
-				if (abort)
-					abortInstallation();
-				
-				loadXML();
-			}
+			var userLocale:String = new StringTools(LocaleID.DEFAULT).actualLocaleIDName.replace("-","_");
 			
-			protected function selectDefaultLanguage():void {
-				var length:int = _runtimeLocale.supportedLanguage.length;
-				var tool:StringTools = new StringTools(LocaleID.DEFAULT);
-				var userLocale:String = tool.actualLocaleIDName.replace("-","_");
-				
-				for (var i:int = 0; i < length; i++)
-				{
-					if (_runtimeLocale.supportedLanguage[i].data == userLocale) {
-						_langSelect.selectedIndex = i;
-						break;
-					}
+			var n:int = supportedLanguages.length;
+			for (var i:int = 0; i < n; i++)
+			{
+				if (supportedLanguages[i].data == userLocale) {
+					_langSelect.selectedIndex = i;
+					
+					break;
 				}
 			}
+		}
+		
+		protected function updateWindow():void
+		{
+			updateWindowTitle();
+			
+			this.nativeWindow.x = Screen.mainScreen.bounds.width/2 - this.nativeWindow.width/2;
+			this.nativeWindow.y = Screen.mainScreen.bounds.height/2 - this.nativeWindow.height/2;
+		}
+		
+		protected function loadXML():void
+		{
+			var request:URLRequest = new URLRequest(Constants.APACHE_FLEX_URL + Constants.CONFIG_XML_NAME);
 			
-			protected function centerWindow():void
-			{
-				this.nativeWindow.x = Screen.mainScreen.bounds.width/2 - this.nativeWindow.width/2;
-				this.nativeWindow.y = Screen.mainScreen.bounds.height/2 - this.nativeWindow.height/2;
-			}
+			_loader = new URLLoader();
 			
-			protected function loadXML():void
+			try
 			{
-				var request:URLRequest = new URLRequest(ViewResourceConstants.URL_CONFIG_XML);
-				
-				_loader = new URLLoader();
-				
-				try
-				{
-					_loader.load(request);
-				}
-				catch (error:Error)
-				{
-					log(_constants.ERROR_CONFIG_XML_LOAD + error.errorID + " " + error.message);
-					abortInstallation();
-				}
-				
-				_loader.addEventListener(IOErrorEvent.IO_ERROR, xmlError,false,0,true);
-				_loader.addEventListener(Event.COMPLETE, xmlLoaded,false,0,true);
+				_loader.load(request);
 			}
-			
-			protected function xmlError(event:IOErrorEvent):void
+			catch (error:Error)
 			{
-				log(_constants.ERROR_CONFIG_XML_LOAD + event.errorID);
+				log(_viewResourceConstants.ERROR_CONFIG_XML_LOAD + error.errorID + " " + error.message);
 				abortInstallation();
 			}
 			
-			protected function xmlLoaded(event:Event):void
-			{
-				setOSSpecificVariables();
-				
-				if (setXMLVariables())
-				{
-					main();
-				}
+			_loader.addEventListener(IOErrorEvent.IO_ERROR, xmlError,false,0,true);
+			_loader.addEventListener(Event.COMPLETE, xmlLoaded,false,0,true);
+		}
+		
+		protected function xmlError(event:IOErrorEvent):void
+		{
+			log(_viewResourceConstants.ERROR_CONFIG_XML_LOAD + event.errorID);
+			abortInstallation();
+		}
+		
+		protected function xmlLoaded(event:Event):void
+		{
+			setOSSpecificVariables();
+			
+			if (setXMLVariables())
+			{
+				_mirrorURLUtil.logMessages = new LogMessagesVO(
+					_viewResourceConstants.FETCH_MIRROR_CGI,
+					_viewResourceConstants.FETCH_MIRROR_CGI_DONE,
+					_viewResourceConstants.FETCH_MIRROR_CGI_ERROR);
+				
+				_mirrorURLUtil.getMirrorURL(
+					Constants.APACHE_FLEX_URL + _mirrorURLCGI,
+					getMirrorURLResultHandler);
 			}
+		}
+		
+		protected function setXMLVariables():Boolean
+		{
+			var data:XML = XML(_loader.data);
+			var version:Number = Number(data.version.toString());
+			var files:XMLList = data.files.file;
+			var keepGoing:Boolean = true;
 			
-			protected function setXMLVariables():Boolean
-			{
-				var data:XML = XML(_loader.data);
-				var version:Number = Number(data.version.toString());
-				var files:XMLList = data.files.file;
-				var keepGoing:Boolean = true;
-				
-				VERSION_URL = data.versionurl.toString();
-				
-				APACHE_FLEX_BIN_DISTRO_DOMAIN = _mirrorURLUtil.url;
-				APACHE_FLEX_BIN_DISTRO_FILE = files.(@name == 'ApacheFlexSDK').@file.toString();
-				APACHE_FLEX_BIN_DISTRO_PATH = files.(@name == 'ApacheFlexSDK').@path.toString();
-				
-				if (!APACHE_FLEX_BIN_DISTRO_FILE || !APACHE_FLEX_BIN_DISTRO_PATH)
-				{
-					log(_constants.ERROR_INVALID_SDK_URL);
-					keepGoing = false;
-				}
-				APACHE_FLEX_BIN_DISTRO_URL = APACHE_FLEX_BIN_DISTRO_DOMAIN + 
-					APACHE_FLEX_BIN_DISTRO_PATH + APACHE_FLEX_BIN_DISTRO_FILE;
-				
-				ADOBE_AIR_SDK_WIN_FILE = files.(@name == 'AdobeAIRSDKWin').@file.toString();
-				ADOBE_AIR_SDK_WIN_URL = files.(@name == 'AdobeAIRSDKWin').@path.toString();
-				if (_os == WINDOWS_OS && (!ADOBE_AIR_SDK_WIN_FILE || !ADOBE_AIR_SDK_WIN_URL))
-				{
-					log(_constants.ERROR_INVALID_AIR_SDK_URL_WINDOWS);
-					keepGoing = false;
-				}
-				ADOBE_AIR_SDK_WIN_URL += ADOBE_AIR_SDK_WIN_FILE;
-				
-				ADOBE_AIR_SDK_MAC_FILE = files.(@name == 'AdobeAIRSDKMac').@file.toString();
-				ADOBE_AIR_SDK_MAC_URL = files.(@name == 'AdobeAIRSDKMac').@path.toString();
-				if (_os == MAC_OS && (!ADOBE_AIR_SDK_MAC_FILE || !ADOBE_AIR_SDK_MAC_URL))
-				{
-					log(_constants.ERROR_INVALID_AIR_SDK_URL_MAC);
-					keepGoing = false;
-				}
-				ADOBE_AIR_SDK_MAC_URL += ADOBE_AIR_SDK_MAC_FILE;
-				
-				ADOBE_FB_GLOBALPLAYER_SWC_FILE =  files.(@name == 'FlashPlayer').@file.toString();
-				ADOBE_FB_GLOBALPLAYER_SWC_URL = files.(@name == 'FlashPlayer').@path.toString();
-				if (!ADOBE_FB_GLOBALPLAYER_SWC_FILE || !ADOBE_FB_GLOBALPLAYER_SWC_URL)
-				{
-					log(_constants.ERROR_INVALID_FLASH_PLAYER_SWC_URL);
-					keepGoing = false;
-				}
-				ADOBE_FB_GLOBALPLAYER_SWC_URL += ADOBE_FB_GLOBALPLAYER_SWC_FILE;
-				
-				OSMF_FILE = files.(@name == 'OSMF').@file.toString();
-				OSMF_URL = files.(@name == 'OSMF').@path.toString();
-				
-				TLF_FILE = files.(@name == 'TLF').@file.toString();
-				TLF_URL = files.(@name == 'TLF').@path.toString();
-				
-				BLAZEDS_FILE = files.(@name == 'BlazeDS').@file.toString();
-				BLAZEDS_URL = files.(@name == 'BlazeDS').@path.toString();
-				
-				AFE_FILE = files.(@name == 'afe').@file.toString();
-				AFE_URL = files.(@name == 'afe').@path.toString();
-				
-				AGLJ40_FILE = files.(@name == 'aglj40').@file.toString();
-				AGLJ40_URL = files.(@name == 'aglj40').@path.toString();
-				
-				FLEX_FONTKIT_FILE = files.(@name == 'flex-fontkit').@file.toString();
-				FLEX_FONTKIT_URL = files.(@name == 'flex-fontkit').@path.toString();
-				
-				RIDEAU_FILE = files.(@name == 'rideau').@file.toString();
-				RIDEAU_URL = files.(@name == 'rideau').@path.toString();
-				
-				return keepGoing;
-			}
+			_latestVersion = data.version.latest.toString();
 			
-			protected function setOSSpecificVariables():void
-			{
-				var operatingSystemStr:String = Capabilities.os;
-				
-				if (operatingSystemStr.search("Mac OS") != -1)
-				{
-					_os =  MAC_OS;
-				}
-				else if (operatingSystemStr.search("Windows") != -1)
-				{
-					_os = WINDOWS_OS;
-				}
-				else
-				{
-					log(_constants.ERROR_UNSUPPORTED_OPERATING_SYSTEM);
-				}
-			}
+			installerAppPath = files.(@name == 'SDKInstallerApp').@path.toString();
+			installerAppFileName = files.(@name == 'SDKInstallerApp').@file.toString();
 			
-			protected function main():void
-			{
-			    // Log the Installer version to help with any support issues that arise.
-			    log("Version" + " " + 
-			        INSTALLER_VERSION + "." + INSTALLER_BUILD_NUMBER + " (" + _os + ")",0);
-				checkVersion();
-				initiateInstallStepsActivity();
-				initializeOptionInstallsDataProvider();
-			}
+			_mirrorURLCGI = files.(@name == 'MirrorURLCGI').@file.toString();
 			
-			protected function checkVersion():void
-			{
-				copyOrDownload(VERSION_URL,handleVersionResult,null,handleVersionError);
-			}
+			APACHE_FLEX_BIN_DISTRO_FILE = files.(@name == 'ApacheFlexSDK').@file.toString();
+			APACHE_FLEX_BIN_DISTRO_PATH = files.(@name == 'ApacheFlexSDK').@path.toString();
 			
-			protected function handleVersionResult(e:Event):void
+			if (!APACHE_FLEX_BIN_DISTRO_FILE || !APACHE_FLEX_BIN_DISTRO_PATH)
 			{
-				//Version available
-				var versionXML:XML = XML(e.target.data);
-				var availableVersion:String = versionXML.version.toString();
-				
-				//Current version
-				var applicationDescriptor:XML = NativeApplication.nativeApplication.applicationDescriptor;
-				var xmlns:Namespace = new Namespace(applicationDescriptor.namespace());
-				var currentVersion:String = applicationDescriptor.xmlns::versionNumber.toString();
-				
-				if(isNewerVersion(availableVersion,currentVersion))
-				{
-					showUpdateDialog(versionXML);
-				}
+				log(_viewResourceConstants.ERROR_INVALID_SDK_URL);
+				keepGoing = false;
 			}
 			
-			protected function isNewerVersion(available:String, current:String):Boolean
+			ADOBE_AIR_SDK_WIN_FILE = files.(@name == 'AdobeAIRSDKWin').@file.toString();
+			ADOBE_AIR_SDK_WIN_URL = files.(@name == 'AdobeAIRSDKWin').@path.toString();
+			if (_os == WINDOWS_OS && (!ADOBE_AIR_SDK_WIN_FILE || !ADOBE_AIR_SDK_WIN_URL))
 			{
-				var availBuildNumbers:Array = available.split(".");
-				var currentBuildNumbers:Array = current.split(".");
-				for (var i:int=0; i<currentBuildNumbers.length; i++)
-				{
-					if(parseInt(availBuildNumbers[i]) > parseInt(currentBuildNumbers[i]))
-					{
-						return true;
-					}
-				}
-				return false;
+				log(_viewResourceConstants.ERROR_INVALID_AIR_SDK_URL_WINDOWS);
+				keepGoing = false;
 			}
+			ADOBE_AIR_SDK_WIN_URL += ADOBE_AIR_SDK_WIN_FILE;
 			
-			protected function showUpdateDialog(versionXML:XML):void
+			ADOBE_AIR_SDK_MAC_FILE = files.(@name == 'AdobeAIRSDKMac').@file.toString();
+			ADOBE_AIR_SDK_MAC_URL = files.(@name == 'AdobeAIRSDKMac').@path.toString();
+			if (_os == MAC_OS && (!ADOBE_AIR_SDK_MAC_FILE || !ADOBE_AIR_SDK_MAC_URL))
 			{
-				var updaterDialog:UpdaterDialog = UpdaterDialog(PopUpManager.createPopUp(this,UpdaterDialog,true));
-				updaterDialog.versionXML = versionXML;
-				PopUpManager.centerPopUp(updaterDialog);
-				updaterDialog.addEventListener("close",handleUpdaterDialogClose);
+				log(_viewResourceConstants.ERROR_INVALID_AIR_SDK_URL_MAC);
+				keepGoing = false;
 			}
+			ADOBE_AIR_SDK_MAC_URL += ADOBE_AIR_SDK_MAC_FILE;
 			
-			protected function handleUpdaterDialogClose(event:Event):void
+			ADOBE_FB_GLOBALPLAYER_SWC_FILE =  files.(@name == 'FlashPlayer').@file.toString();
+			ADOBE_FB_GLOBALPLAYER_SWC_URL = files.(@name == 'FlashPlayer').@path.toString();
+			if (!ADOBE_FB_GLOBALPLAYER_SWC_FILE || !ADOBE_FB_GLOBALPLAYER_SWC_URL)
 			{
-				PopUpManager.removePopUp(IFlexDisplayObject(event.target));
+				log(_viewResourceConstants.ERROR_INVALID_FLASH_PLAYER_SWC_URL);
+				keepGoing = false;
 			}
+			ADOBE_FB_GLOBALPLAYER_SWC_URL += ADOBE_FB_GLOBALPLAYER_SWC_FILE;
 			
-			protected function handleVersionError(e:Event):void
-			{
-				trace();
-			}
+			OSMF_FILE = files.(@name == 'OSMF').@file.toString();
+			OSMF_URL = files.(@name == 'OSMF').@path.toString();
 			
-			protected function handleInstallBtnClick(event:MouseEvent):void
-			{
-				if (flexSDKTxtInput.text == "")
-				{
-					log(_constants.INFO_ENTER_VALID_FLEX_SDK_PATH);
-				}
-				else
-				{
-					_langSelect.enabled = false;
-					_flexHome = flexSDKTxtInput.text;
-					resetInstallStepsActivity();
-					addOptionalComponentsToInstallSteps();
-					this.currentState = "installState";
-					install();
-				}
-			}
+			TLF_FILE = files.(@name == 'TLF').@file.toString();
+			TLF_URL = files.(@name == 'TLF').@path.toString();
 			
-			protected function handleFirstStepNextBtnClick(event:MouseEvent):void
-			{
-				currentState = "optionsState";
-			}
+			BLAZEDS_FILE = files.(@name == 'BlazeDS').@file.toString();
+			BLAZEDS_URL = files.(@name == 'BlazeDS').@path.toString();
 			
-			protected function initiateInstallStepsActivity():void
-			{
-				_installationSteps.addItem(new StepItem(_constants.STEP_CREATE_DIRECTORIES));
-				_installationSteps.addItem(new StepItem(_constants.STEP_DOWNLOAD_FLEX_SDK));
-				_installationSteps.addItem(new StepItem(_constants.STEP_VERIFY_FLEX_SDK));
-				_installationSteps.addItem(new StepItem(_constants.STEP_UNZIP_FLEX_SDK));
-				_installationSteps.addItem(new StepItem(_constants.STEP_DOWNLOAD_AIR_RUNTIME_KIT));
-				_installationSteps.addItem(new StepItem(_constants.STEP_UNZIP_AIR_RUNTIME_KIT));
-				_installationSteps.addItem(new StepItem(_constants.STEP_DOWNLOAD_FLASHPLAYER_SWC));
-				_installationSteps.addItem(new StepItem(_constants.STEP_INSTALL_CONFIG_FILES));
-			}
+			AFE_FILE = files.(@name == 'afe').@file.toString();
+			AFE_URL = files.(@name == 'afe').@path.toString();
 			
-			protected function resetInstallStepsActivity():void
-			{
-				for each(var step:StepItem in _installationSteps)
-				{
-					step.status = StepItem.NORMAL;
-				}
-			}
-			
-			protected function addOptionalComponentsToInstallSteps():void
-			{
-				for each (var obj:OptionalComponentVO in _optionalInstallsDataProvider)
-				{
-					if(obj.selected)
-					{
-						_installationSteps.addItem(new StepItem(obj.label));
-					}
-				}
-			}
+			AGLJ40_FILE = files.(@name == 'aglj40').@file.toString();
+			AGLJ40_URL = files.(@name == 'aglj40').@path.toString();
 			
-			protected function initializeOptionInstallsDataProvider():void{
-				_optionalInstallsDataProvider.addItem(new OptionalComponentVO(_constants.STEP_OPTIONAL_INSTALL_TLF,_constants.ASK_TLF,true));
-				_optionalInstallsDataProvider.addItem(new OptionalComponentVO(_constants.STEP_OPTIONAL_INSTALL_OSMF,_constants.ASK_OSMF,true));
-				_optionalInstallsDataProvider.addItem(new OptionalComponentVO(_constants.STEP_OPTIONAL_INSTALL_FONTSWF,_constants.ASK_FONTSWF,false));
-				_optionalInstallsDataProvider.addItem(new OptionalComponentVO(_constants.STEP_OPTIONAL_INSTALL_BLAZEDS,_constants.ASK_BLAZEDS,false));
-			}
+			FLEX_FONTKIT_FILE = files.(@name == 'flex-fontkit').@file.toString();
+			FLEX_FONTKIT_URL = files.(@name == 'flex-fontkit').@path.toString();
 			
-			protected function install():void
-			{
-				createDirectories();
-			}
+			RIDEAU_FILE = files.(@name == 'rideau').@file.toString();
+			RIDEAU_URL = files.(@name == 'rideau').@path.toString();
 			
+			return keepGoing;
+		}
+		
+		protected function setOSSpecificVariables():void
+		{
+			var operatingSystemStr:String = Capabilities.os;
 			
-			protected function setCommandLineState():void
+			if (operatingSystemStr.search("Mac OS") != -1)
 			{
-				currentState = "commandLineState";
+				_os =  MAC_OS;
 			}
-			
-			protected function setGUIState():void
+			else if (operatingSystemStr.search("Windows") != -1)
 			{
-				currentState = "guiState";
+				_os = WINDOWS_OS;
 			}
-			
-			// TODO Scan for Apache SDKs installed and check if allready modified?
-			protected function browseForSDK(event:MouseEvent):void
+			else
 			{
-				var file:File = new File(); 
-				
-				file.addEventListener(Event.SELECT, flexSDKDirSelected,false,0,true); 
-				file.browseForDirectory(_constants.INFO_SELECT_DIRECTORY); 
+				log(_viewResourceConstants.ERROR_UNSUPPORTED_OPERATING_SYSTEM);
 			}
-			
-			protected function flexSDKDirSelected(event:Event):void
+		}
+		
+		private function getMirrorURLResultHandler():void
+		{
+			var logMessages:ArrayCollection = ILog(_mirrorURLUtil).log;
+			var i:int;
+			var n:int = logMessages.length;
+			for (i = 0; i < n; i++)
 			{
-				var selectedDir:File =  File(event.target);
-				
-				if (isDirectoryEmpty(selectedDir))
-				{
-					_flexHome = selectedDir.nativePath;
-					flexSDKTxtInput.text = _flexHome;
-					nextBtn.enabled = true;
-					_langSelect.enabled = true;
-					flexSDKTxtInput.errorString = "";
-				}
-				else
-				{
-					nextBtn.enabled = false;
-					flexSDKTxtInput.errorString = _constants.ERROR_DIRECTORY_NOT_EMPTY;
-				}
+				log(String(logMessages.getItemAt(i)));
 			}
 			
-			protected function validApacheSDK(flexPath:String):Boolean
+			if (_mirrorURLUtil.errorOccurred)
 			{
-				var valid:Boolean = true;
-				var descriptionFile:String = flexPath + File.separator + "flex-sdk-description.xml";
-				var file:File = new File(descriptionFile);
-				
-				// Check flex SDK diretory has flex description file
-				if (!file.exists)
-				{
-					valid = false;
-					flexSDKTxtInput.errorString = _constants.ERROR_INVALID_FLEX_SDK_DIRECTORY;
-				}
-				
-				// TODO Check is Apache not Adobe SDK
-				
-				return valid;
+				abortInstallation();
 			}
-			
-			protected function SDKNotPackaged(flexPath:String):Boolean
+			else
 			{
-				var unpackaged:Boolean = true;
-				var playerFile:String = flexPath + File.separator + "frameworks" + File.separator + "libs" + File.separator
-					+ "player" + File.separator + "11.1" + File.separator + "playerglobal.swc"; 
-				var file:File = new File(playerFile);
+				APACHE_FLEX_BIN_DISTRO_URL = _mirrorURLUtil.mirrorURL + 
+					APACHE_FLEX_BIN_DISTRO_PATH + APACHE_FLEX_BIN_DISTRO_FILE;
 				
-				// check for existance of  player global
-				if (file.exists)
+				if (installerAppPath.substr(0, Constants.URL_PREFIX.length) != Constants.URL_PREFIX)
 				{
-					unpackaged = false;
-					flexSDKTxtInput.errorString = _constants.ERROR_INVALID_FLEX_SDK_DIRECTORY;
+					installerAppPath = _mirrorURLUtil.mirrorURL + installerAppPath;
 				}
-				
-				return unpackaged;
 			}
 			
-			protected function handleFlexSDXTxtInputChange(event:TextOperationEvent):void
-			{
-				var tempDir:File;
-				var path:String = flexSDKTxtInput.text;
-				
-				try
-				{
-					tempDir = new File(path);
-					
-					if (SDKNotPackaged(path))
-					{
-						flexSDKTxtInput.errorString = "";
-						_flexHome = path;
-						nextBtn.enabled = true;
-						_langSelect.enabled = true;
-					}
-					else
-					{
-						flexSDKTxtInput.errorString = _constants.ERROR_INVALID_FLEX_SDK_DIRECTORY;
-						nextBtn.enabled = false;
-					}
-				}
-				catch (e:Error)
-				{
-					flexSDKTxtInput.errorString = _constants.ERROR_INVALID_FLEX_SDK_DIRECTORY;
-					nextBtn.enabled = false;
-				}
-			}
+			main();
+		}
+		
+		protected function main():void
+		{
+		    // Log the Installer version to help with any support issues that arise.
+		    log("Version" + " " + INSTALLER_VERSION + "." + INSTALLER_BUILD_NUMBER + " (" + _os + ")",0);
 			
-			protected function createDirectories():void
-			{
-				updateActivityStep(_constants.STEP_CREATE_DIRECTORIES, StepItem.ACTIVE);
-				
-				try
-				{
-					log(_constants.INFO_CREATING_FLEX_HOME);
-					_flexHomeDir = createFolder(_flexHome);
-					log(_constants.INFO_CREATING_TEMP_DIR);
-					_flexTemp = _flexHome + File.separator + "temp";
-					_flexTempDir = createFolder(_flexTemp);
-					updateActivityStep(_constants.STEP_CREATE_DIRECTORIES, StepItem.COMPLETE);
-					downloadApacheFlexSDK();
-				}
-				catch (e:Error)
-				{
-					updateActivityStep(_constants.STEP_CREATE_DIRECTORIES, StepItem.ERROR);
-					log(_constants.ERROR_UNABLE_TO_CREATE_TEMP_DIRECTORY);
-					abortInstallation();
-				}
-			}
+			initiateInstallStepsActivity();
+			initializeOptionInstallsDataProvider();
 			
-			protected function downloadApacheFlexSDK():void
-			{
-				updateActivityStep(_constants.STEP_DOWNLOAD_FLEX_SDK, StepItem.ACTIVE);
-				
-				try
-				{
-					log(_constants.INFO_DOWNLOADING_APACHE_FLEX_SDK + APACHE_FLEX_BIN_DISTRO_URL);
-					_apacheFlexSDKZipFile = File.userDirectory.resolvePath(_flexTemp + File.separator + APACHE_FLEX_BIN_DISTRO_FILE); 
-					copyOrDownload(APACHE_FLEX_BIN_DISTRO_URL, handleApacheFlexSDKDownload, _apacheFlexSDKZipFile, handleApacheFlexSDKDownloadError);
-				}
-				catch (e:Error)
-				{
-					updateActivityStep(_constants.STEP_DOWNLOAD_FLEX_SDK, StepItem.ERROR);
-					abortInstallation();
+			checkVersion();
+		}
+		
+		protected function checkVersion():void
+		{
+			//Current version
+			var applicationDescriptor:XML = NativeApplication.nativeApplication.applicationDescriptor;
+			var xmlns:Namespace = new Namespace(applicationDescriptor.namespace());
+			var currentVersion:String = applicationDescriptor.xmlns::versionNumber.toString();
+			
+			var availBuildNumbers:Array = _latestVersion.split(".");
+			var currentBuildNumbers:Array = currentVersion.split(".");
+			for (var i:int=0; i < currentBuildNumbers.length; i++)
+			{
+				if (parseInt(availBuildNumbers[i]) > parseInt(currentBuildNumbers[i]))
+				{
+					var updaterDialog:UpdaterDialog = UpdaterDialog(PopUpManager.createPopUp(this,UpdaterDialog,true));
+					updaterDialog.addEventListener("close",handleUpdaterDialogClose);
+					updaterDialog.latestVersion = _latestVersion;
+					
+					PopUpManager.centerPopUp(updaterDialog);
 				}
-				
 			}
-			
-			protected function handleApacheFlexSDKDownload(event:Event):void
-			{
-				try
-				{
-					writeFileToDirectory(_apacheFlexSDKZipFile, event.target.data);
-				}
-				catch (e:Error)
-				{
-					updateActivityStep(_constants.STEP_DOWNLOAD_FLEX_SDK, StepItem.ERROR);
-					abortInstallation();
-				}
-				
-				updateActivityStep(_constants.STEP_DOWNLOAD_FLEX_SDK, StepItem.COMPLETE);
-				
-				updateActivityStep(_constants.STEP_VERIFY_FLEX_SDK, StepItem.ACTIVE);
-
-				log(_constants.STEP_VERIFY_FLEX_SDK);
-				
-				_md5CompareUtil.addEventListener(ProgressEvent.PROGRESS, md5VerificationProgressHandler);
-				_md5CompareUtil.verifyMD5(
-					_apacheFlexSDKZipFile, 
-					APACHE_FLEX_BIN_DISTRO_PATH + APACHE_FLEX_BIN_DISTRO_FILE, 
-					unzipApacheFlexSDK);
+		}
+		
+		protected function handleUpdaterDialogClose(event:Event):void
+		{
+			PopUpManager.removePopUp(IFlexDisplayObject(event.target));
+		}
+		
+		protected function handleInstallBtnClick(event:MouseEvent):void
+		{
+			if (flexSDKTxtInput.text == "")
+			{
+				log(_viewResourceConstants.INFO_ENTER_VALID_FLEX_SDK_PATH);
+			}
+			else
+			{
+				_langSelect.enabled = false;
+				_flexHome = flexSDKTxtInput.text;
+				resetInstallStepsActivity();
+				addOptionalComponentsToInstallSteps();
+				this.currentState = "installState";
+				install();
 			}
-			
-			protected function md5VerificationProgressHandler(event:ProgressEvent):void
+		}
+		
+		protected function handleFirstStepNextBtnClick(event:MouseEvent):void
+		{
+			currentState = "optionsState";
+		}
+		
+		protected function initiateInstallStepsActivity():void
+		{
+			_installationSteps = new ArrayCollection();
+			
+			_installationSteps.addItem(new StepItem(_viewResourceConstants.STEP_CREATE_DIRECTORIES));
+			_installationSteps.addItem(new StepItem(_viewResourceConstants.STEP_DOWNLOAD_FLEX_SDK));
+			_installationSteps.addItem(new StepItem(_viewResourceConstants.STEP_VERIFY_FLEX_SDK));
+			_installationSteps.addItem(new StepItem(_viewResourceConstants.STEP_UNZIP_FLEX_SDK));
+			_installationSteps.addItem(new StepItem(_viewResourceConstants.STEP_DOWNLOAD_AIR_RUNTIME_KIT));
+			_installationSteps.addItem(new StepItem(_viewResourceConstants.STEP_UNZIP_AIR_RUNTIME_KIT));
+			_installationSteps.addItem(new StepItem(_viewResourceConstants.STEP_DOWNLOAD_FLASHPLAYER_SWC));
+			_installationSteps.addItem(new StepItem(_viewResourceConstants.STEP_INSTALL_CONFIG_FILES));
+		}
+		
+		protected function resetInstallStepsActivity():void
+		{
+			for each(var step:StepItem in _installationSteps)
 			{
-				progressBar.percent = Math.round((event.bytesLoaded / event.bytesTotal) * 100);
+				step.status = StepItem.NORMAL;
 			}
-			
-			protected function handleApacheFlexSDKDownloadError(event:*=null):void{
-				updateActivityStep(_constants.STEP_DOWNLOAD_FLEX_SDK, StepItem.ERROR);
-				log(_constants.ERROR_UNABLE_TO_DOWNLOAD_FLEX_SDK);
-				abortInstallation();
-			}
-			
-			protected function unzipApacheFlexSDK():void
+		}
+		
+		protected function addOptionalComponentsToInstallSteps():void
+		{
+			for each (var obj:OptionalComponentVO in _optionalInstallsDataProvider)
 			{
-				if (!_md5CompareUtil.fileIsVerified)
+				if(obj.selected)
 				{
-					updateActivityStep(_constants.STEP_VERIFY_FLEX_SDK, StepItem.ERROR);
-					
-					log(_constants.ERROR_VERIFY_FLEX_SDK);
-					
-					abortInstallation();
-					return;
-				}
-				else
-				{
-					updateActivityStep(_constants.STEP_VERIFY_FLEX_SDK, StepItem.COMPLETE);
-					
-					log(_constants.INFO_VERIFY_FLEX_SDK_DONE);
-				} 
-
-				updateActivityStep(_constants.STEP_UNZIP_FLEX_SDK, StepItem.ACTIVE);
-				
-				try
-				{
-					log(_constants.INFO_UNZIPPING + _apacheFlexSDKZipFile.nativePath);
-					unzip(_apacheFlexSDKZipFile, handleApacheFlexSDKZipFileUnzipComplete, handleApacheFlexSDKZipFileUnzipError);
-				}
-				catch (e:Error)
-				{
-					updateActivityStep(_constants.STEP_UNZIP_FLEX_SDK, StepItem.ERROR);
-					abortInstallation();
+					_installationSteps.addItem(new StepItem(obj.label));
 				}
 			}
+		}
+		
+		protected function initializeOptionInstallsDataProvider():void
+		{
+			_optionalInstallsDataProvider = new ArrayCollection();
+			
+			_optionalInstallsDataProvider.addItem(
+				new OptionalComponentVO(_viewResourceConstants.STEP_OPTIONAL_INSTALL_TLF,
+					_viewResourceConstants.ASK_TLF, true));
+			_optionalInstallsDataProvider.addItem(
+				new OptionalComponentVO(_viewResourceConstants.STEP_OPTIONAL_INSTALL_OSMF,
+					_viewResourceConstants.ASK_OSMF, true));
+			_optionalInstallsDataProvider.addItem(
+				new OptionalComponentVO(_viewResourceConstants.STEP_OPTIONAL_INSTALL_FONTSWF,
+					_viewResourceConstants.ASK_FONTSWF, false));
+			_optionalInstallsDataProvider.addItem(
+				new OptionalComponentVO(_viewResourceConstants.STEP_OPTIONAL_INSTALL_BLAZEDS,
+					_viewResourceConstants.ASK_BLAZEDS, false));
+		}
+		
+		protected function install():void
+		{
+			createDirectories();
+		}
+		
+		
+		protected function setCommandLineState():void
+		{
+			currentState = "commandLineState";
+		}
+		
+		protected function setGUIState():void
+		{
+			currentState = "guiState";
+		}
+		
+		// TODO Scan for Apache SDKs installed and check if allready modified?
+		protected function browseForSDK(event:MouseEvent):void
+		{
+			var file:File = new File(); 
+			
+			file.addEventListener(Event.SELECT, flexSDKDirSelected,false,0,true); 
+			file.browseForDirectory(_viewResourceConstants.INFO_SELECT_DIRECTORY); 
+		}
+		
+		protected function flexSDKDirSelected(event:Event):void
+		{
+			var selectedDir:File =  File(event.target);
 			
-			protected function handleApacheFlexSDKZipFileUnzipComplete(event:Event):void
+			if (isDirectoryEmpty(selectedDir))
 			{
-				log(_constants.INFO_FINISHED_UNZIPPING + _apacheFlexSDKZipFile.nativePath);
-				updateActivityStep(_constants.STEP_UNZIP_FLEX_SDK, StepItem.COMPLETE);
-				
-				if (_os == WINDOWS_OS)
-				{
-					downloadAIRRuntimeKitForWindows();
-				}
-				else if (_os == MAC_OS)
-				{ 
-					downloadAIRRuntimeKitForMac();
-				}
+				_flexHome = selectedDir.nativePath;
+				flexSDKTxtInput.text = _flexHome;
+				nextBtn.enabled = true;
+				_langSelect.enabled = true;
+				flexSDKTxtInput.errorString = "";
 			}
-			
-			protected function handleApacheFlexSDKZipFileUnzipError(error:ErrorEvent=null):void
+			else
 			{
-				updateActivityStep(_constants.STEP_UNZIP_FLEX_SDK, StepItem.ERROR);
-				abortInstallation();
+				nextBtn.enabled = false;
+				flexSDKTxtInput.errorString = _viewResourceConstants.ERROR_DIR_NOT_EMPTY;
 			}
+		}
+		
+		protected function validApacheSDK(flexPath:String):Boolean
+		{
+			var valid:Boolean = true;
+			var descriptionFile:String = flexPath + File.separator + "flex-sdk-description.xml";
+			var file:File = new File(descriptionFile);
 			
-			protected function downloadAIRRuntimeKitForWindows():void
+			// Check flex SDK diretory has flex description file
+			if (!file.exists)
 			{
-				updateActivityStep(_constants.STEP_DOWNLOAD_AIR_RUNTIME_KIT, StepItem.ACTIVE);
-				
-				try
-				{
-					log(_constants.INFO_DOWLOADING_AIR_RUNTIME_KIT_WINDOWS + ADOBE_AIR_SDK_WIN_URL);
-					_adobeAIRSDKZipFile = File.userDirectory.resolvePath(_flexTemp + File.separator + ADOBE_AIR_SDK_WIN_FILE);
-					copyOrDownload(ADOBE_AIR_SDK_WIN_URL, handleAIRSDKDownload, _adobeAIRSDKZipFile, handleAIRSDKDownloadError);
-				}
-				catch (e:Error)
-				{
-					updateActivityStep(_constants.STEP_DOWNLOAD_AIR_RUNTIME_KIT, StepItem.ERROR);
-					abortInstallation();
-				}
+				valid = false;
+				flexSDKTxtInput.errorString = _viewResourceConstants.ERROR_INVALID_FLEX_SDK_DIRECTORY;
 			}
 			
-			protected function downloadAIRRuntimeKitForMac():void
-			{
-				updateActivityStep(_constants.STEP_DOWNLOAD_AIR_RUNTIME_KIT, StepItem.ACTIVE);
-				
-				try
-				{
-					log(_constants.INFO_DOWLOADING_AIR_RUNTIME_KIT_MAC + ADOBE_AIR_SDK_MAC_URL);
-					_adobeAIRSDKZipFile = File.userDirectory.resolvePath(_flexTemp + File.separator + ADOBE_AIR_SDK_MAC_FILE);
-					copyOrDownload(ADOBE_AIR_SDK_MAC_URL, handleAIRSDKDownload, _adobeAIRSDKZipFile, handleAIRSDKDownloadError);
-				}
-				catch (e:Error)
-				{
-					updateActivityStep(_constants.STEP_DOWNLOAD_AIR_RUNTIME_KIT, StepItem.ERROR);
-					abortInstallation();
-				}
-			}
+			// TODO Check is Apache not Adobe SDK
 			
-			protected function handleAIRSDKDownload(event:Event):void
+			return valid;
+		}
+		
+		protected function SDKNotPackaged(flexPath:String):Boolean
+		{
+			var unpackaged:Boolean = true;
+			var playerFile:String = flexPath + File.separator + "frameworks" + File.separator + "libs" + File.separator
+				+ "player" + File.separator + "11.1" + File.separator + "playerglobal.swc"; 
+			var file:File = new File(playerFile);
+			
+			// check for existance of  player global
+			if (file.exists)
 			{
-				try
-				{
-					writeFileToDirectory(_adobeAIRSDKZipFile,event.target.data);
-				}
-				catch (e:Error)
-				{
-					updateActivityStep(_constants.STEP_DOWNLOAD_AIR_RUNTIME_KIT, StepItem.ERROR);
-					abortInstallation();
-				}
-				
-				updateActivityStep(_constants.STEP_DOWNLOAD_AIR_RUNTIME_KIT, StepItem.COMPLETE);
-				
-				unzipAdobeAIRSDK();
+				unpackaged = false;
+				flexSDKTxtInput.errorString = _viewResourceConstants.ERROR_INVALID_FLEX_SDK_DIRECTORY;
 			}
 			
-			protected function handleAIRSDKDownloadError(error:*=null):void
-			{
-				updateActivityStep(_constants.STEP_DOWNLOAD_AIR_RUNTIME_KIT, StepItem.ERROR);
-				log(_constants.ERROR_UNABLE_TO_DOWNLOAD_AIR_SDK);
-				abortInstallation();
-			}
+			return unpackaged;
+		}
+		
+		protected function handleFlexSDXTxtInputChange(event:TextOperationEvent):void
+		{
+			var tempDir:File;
+			var path:String = flexSDKTxtInput.text;
 			
-			protected function unzipAdobeAIRSDK():void
+			try
 			{
-				updateActivityStep(_constants.STEP_UNZIP_AIR_RUNTIME_KIT, StepItem.ACTIVE);
+				tempDir = new File(path);
 				
-				try
-				{
-					if (_os == WINDOWS_OS)
-					{
-						unzipAdobeAIRSDKWindows()
-					}
-					else if (_os == MAC_OS)
-					{
-						unzipAdobeAIRSDKMac();
-					}
-				}
-				catch (e:Error)
-				{
-					updateActivityStep(_constants.STEP_UNZIP_AIR_RUNTIME_KIT, StepItem.ERROR);
-					abortInstallation();
-				}
-			}
-			
-			protected function unzipAdobeAIRSDKWindows():void
-			{
-				log(_constants.INFO_UNZIPPING + _adobeAIRSDKZipFile.nativePath);
-				unzip(_adobeAIRSDKZipFile, handleAdobeAIRSDKWinZipFileUnzipComplete, handleAdobeAIRSDKWinZipFileUnzipError);
-			}
-			
-			protected function unzipAdobeAIRSDKMac():void
-			{
-				if (NativeProcess.isSupported)
+				if (SDKNotPackaged(path))
 				{
-					untar(_adobeAIRSDKZipFile, _flexHomeDir, handleAdobeAIRSDKMacUntarComplete, handleAdobeAIRSDKMacUntarError);
+					flexSDKTxtInput.errorString = "";
+					_flexHome = path;
+					nextBtn.enabled = true;
+					_langSelect.enabled = true;
 				}
 				else
 				{
-					log(_constants.ERROR_NATIVE_PROCESS_NOT_SUPPORTED);
-					updateActivityStep(_constants.STEP_UNZIP_AIR_RUNTIME_KIT, StepItem.ERROR);
+					flexSDKTxtInput.errorString = _viewResourceConstants.ERROR_INVALID_FLEX_SDK_DIRECTORY;
+					nextBtn.enabled = false;
 				}
 			}
-			
-			protected function handleAdobeAIRSDKMacUntarError(error:ProgressEvent=null):void{
-				updateActivityStep(_constants.STEP_UNZIP_AIR_RUNTIME_KIT, StepItem.ERROR);
-				abortInstallation();
-			}
-			
-			protected function handleAdobeAIRSDKMacUntarComplete(event:Event):void
-			{
-				updateActivityStep(_constants.STEP_UNZIP_AIR_RUNTIME_KIT, StepItem.COMPLETE);
-				log(_constants.INFO_FINISHED_UNTARING + _adobeAIRSDKZipFile.nativePath);
-				downloadPlayerGlobalSWC();
-			}
-			
-			protected function handleAdobeAIRSDKWinZipFileUnzipComplete(event:Event):void
+			catch (e:Error)
 			{
-				updateActivityStep(_constants.STEP_UNZIP_AIR_RUNTIME_KIT, StepItem.COMPLETE);
-				log(_constants.INFO_FINISHED_UNZIPPING + _adobeAIRSDKZipFile.nativePath);
-				downloadPlayerGlobalSWC();
-			}
-			
-			protected function handleAdobeAIRSDKWinZipFileUnzipError(error:ErrorEvent=null):void{
-				updateActivityStep(_constants.STEP_UNZIP_AIR_RUNTIME_KIT, StepItem.ERROR);
-			}
-			
-			protected function downloadPlayerGlobalSWC():void
-			{
-				updateActivityStep(_constants.STEP_DOWNLOAD_FLASHPLAYER_SWC, StepItem.ACTIVE);
-				
-				try
-				{
-					log(_constants.INFO_INSTALLING_PLAYERGLOBAL_SWC + ADOBE_FB_GLOBALPLAYER_SWC_URL);
-					_fbGlobalPlayerDir = createFolder(_flexHome + File.separator + "frameworks" + File.separator + "libs" + File.separator + "player" + File.separator + "11.1");
-					_fbGlobalPlayerFile = File.userDirectory.resolvePath(_fbGlobalPlayerDir.nativePath + File.separator + "playerglobal.swc");
-					copyOrDownload(ADOBE_FB_GLOBALPLAYER_SWC_URL, handlePlayerGlobalDownload, _fbGlobalPlayerFile, handlePlayerGlobalDownloadError);
-				}
-				catch (e:Error)
-				{
-					updateActivityStep(_constants.STEP_DOWNLOAD_FLASHPLAYER_SWC, StepItem.ERROR);
-					abortInstallation();
-				}
+				flexSDKTxtInput.errorString = _viewResourceConstants.ERROR_INVALID_FLEX_SDK_DIRECTORY;
+				nextBtn.enabled = false;
 			}
-			
-			protected function handlePlayerGlobalDownload(event:Event):void
-			{
-				try
-				{
-					var playerGlobalFile:File = File.userDirectory.resolvePath(_fbGlobalPlayerDir.nativePath + File.separator + "playerglobal.swc");
-					writeFileToDirectory(playerGlobalFile,event.target.data);
-				}
-				catch (e:Error)
-				{
-					updateActivityStep(_constants.STEP_DOWNLOAD_FLASHPLAYER_SWC, StepItem.ERROR);
-					abortInstallation();
-				}
-				updateActivityStep(_constants.STEP_DOWNLOAD_FLASHPLAYER_SWC, StepItem.COMPLETE);
-				copyConfigFiles();
+		}
+		
+		protected function createDirectories():void
+		{
+			updateActivityStep(_viewResourceConstants.STEP_CREATE_DIRECTORIES, StepItem.ACTIVE);
+			
+			try
+			{
+				log(_viewResourceConstants.INFO_CREATING_FLEX_HOME);
+				_flexHomeDir = createFolder(_flexHome);
+				log(_viewResourceConstants.INFO_CREATING_TEMP_DIR);
+				_flexTemp = _flexHome + File.separator + "temp";
+				_flexTempDir = createFolder(_flexTemp);
+				updateActivityStep(_viewResourceConstants.STEP_CREATE_DIRECTORIES, StepItem.COMPLETE);
+				downloadApacheFlexSDK();
 			}
-			
-			protected function handlePlayerGlobalDownloadError(event:ErrorEvent=null):void
+			catch (e:Error)
 			{
-				updateActivityStep(_constants.STEP_DOWNLOAD_FLASHPLAYER_SWC, StepItem.ERROR);
-				log(_constants.ERROR_UNABLE_TO_DOWNLOAD_FLASH_PLAYER_SWC);
+				updateActivityStep(_viewResourceConstants.STEP_CREATE_DIRECTORIES, StepItem.ERROR);
+				log(_viewResourceConstants.ERROR_UNABLE_TO_CREATE_TEMP_DIRECTORY);
 				abortInstallation();
 			}
+		}
+		
+		protected function downloadApacheFlexSDK():void
+		{
+			updateActivityStep(_viewResourceConstants.STEP_DOWNLOAD_FLEX_SDK, StepItem.ACTIVE);
 			
-			protected function copyConfigFiles():void
-			{
-				var aborted:Boolean = false;
-				
-				updateActivityStep(_constants.STEP_INSTALL_CONFIG_FILES, StepItem.ACTIVE);
-				
-				try
-				{
-					//Config files
-					var configFilesDir:File = File.userDirectory.resolvePath(_flexHome + File.separator + "ide" + File.separator + "flashbuilder" + File.separator + "config");
-					var configFiles:Array = configFilesDir.getDirectoryListing();
-					var flexHomeFrameworksDir:File = File.userDirectory.resolvePath(_flexHome + File.separator + "frameworks");
-					log(_constants.INFO_INSTALLING_CONFIG_FILES);
-					
-					for each (var file:File in configFiles)
-					{
-						if (isValidConfigFile(file))
-						{
-							var copyToFile:File = flexHomeFrameworksDir.resolvePath(file.name);
-							file.copyTo(copyToFile,true);
-						}
-					}
-				}
-				catch (e:Error)
-				{
-					updateActivityStep(_constants.STEP_INSTALL_CONFIG_FILES, StepItem.ERROR);
-					log(_constants.ERROR_UNABLE_TO_INSTALL_CONFIG_FILES);
-					abortInstallation();
-					aborted = true;
-				}
-				
-				
-				if (!aborted)
-				{
-					updateActivityStep(_constants.STEP_INSTALL_CONFIG_FILES, StepItem.COMPLETE);
-					//cleanup();
-					installNextOptionalComponent();
-				}
-			}
-			
-			protected function installNextOptionalComponent():void
-			{
-				for each (var obj:OptionalComponentVO in _optionalInstallsDataProvider)
-				{
-					if(obj.selected && !obj.installed && !obj.aborted)
-					{
-						switch(obj.label)
-						{
-							case _constants.STEP_OPTIONAL_INSTALL_BLAZEDS:
-							{
-								installBlazeDS();
-								return;
-								break;
-							}
-							case _constants.STEP_OPTIONAL_INSTALL_FONTSWF:
-							{
-								installFontSwf();
-								return;
-								break;
-							}
-							case _constants.STEP_OPTIONAL_INSTALL_OSMF:
-							{
-								installOSMF();
-								return;
-								break;
-							}
-							case _constants.STEP_OPTIONAL_INSTALL_TLF:
-							{
-								installTLF();
-								return;
-								break;
-							} 
-							default:
-							{
-								break;
-							}
-						}
-					}
-				}
-				checkAndHandleAllOptionalComponentsInstalled();
-			}
-			
-			protected function installBlazeDS():void
-			{
-				updateActivityStep(_constants.STEP_OPTIONAL_INSTALL_BLAZEDS, StepItem.ACTIVE);
-				log(StringUtil.substitute(_constants.INFO_DOWNLOADING_FILE_FROM,[BLAZEDS_FILE,BLAZEDS_URL]));
-				_blazeDSJarFile = File.userDirectory.resolvePath(_flexTemp + File.separator + BLAZEDS_FILE);
-				copyOrDownload(BLAZEDS_URL+BLAZEDS_FILE,handleBlazeDSDownloadComplete,null,handleBlazeDSInstallError);
-			}
-			
-			protected function handleBlazeDSDownloadComplete(event:Event):void
-			{
-				try
-				{
-					writeFileToDirectory(_blazeDSJarFile,event.target.data);
-					copyFileToOptionalLibDir(_blazeDSJarFile);
-					updateOptionalComponentInstallStatus(_constants.STEP_OPTIONAL_INSTALL_BLAZEDS,true);
-					updateOptionalComponentInstallStatusAborted(_constants.STEP_OPTIONAL_INSTALL_BLAZEDS,false);
-					updateActivityStep(_constants.STEP_OPTIONAL_INSTALL_BLAZEDS, StepItem.COMPLETE);
-					clearData(URLLoader(event.target));
-					installNextOptionalComponent();
-				}
-				catch (e:Error)
-				{
-					updateActivityStep(_constants.STEP_OPTIONAL_INSTALL_BLAZEDS, StepItem.ERROR);
-					updateOptionalComponentInstallStatusAborted(_constants.STEP_OPTIONAL_INSTALL_BLAZEDS,true);
-					installNextOptionalComponent();
-				}
-			}
-			
-			protected function installFontSwf():void
-			{
-				updateActivityStep(_constants.STEP_OPTIONAL_INSTALL_FONTSWF,StepItem.ACTIVE);
-				downloadFontSwfAFEFile();
-			}
-			
-			protected function downloadFontSwfAFEFile():void
-			{
-				log(StringUtil.substitute(_constants.INFO_DOWNLOADING_FILE_FROM,[AFE_FILE,AFE_URL]));
-				_afeJarFile = File.userDirectory.resolvePath(_flexTemp + File.separator + AFE_FILE);
-				copyOrDownload(AFE_URL+AFE_FILE,handleFontSWFAFEFileDownloaded,null,handleFontSWFInstallError);
-			}
-			
-			protected function handleFontSWFAFEFileDownloaded(event:Event):void
-			{
-				try
-				{
-					writeFileToDirectory(_afeJarFile, event.target.data);
-					copyFileToOptionalLibDir(_afeJarFile);
-					clearData(URLLoader(event.target));
-					
-					downloadFontSwfAGLFile();
-					
-				}
-				catch (e:Error)
-				{
-					updateActivityStep(_constants.STEP_OPTIONAL_INSTALL_FONTSWF, StepItem.ERROR);
-					updateOptionalComponentInstallStatusAborted(_constants.STEP_OPTIONAL_INSTALL_FONTSWF,true);
-					installNextOptionalComponent();
-				}
-			}
-			
-			protected function downloadFontSwfAGLFile():void
-			{
-				log(StringUtil.substitute(_constants.INFO_DOWNLOADING_FILE_FROM,[AGLJ40_FILE,AGLJ40_URL]));
-				_aglj40JarFile = File.userDirectory.resolvePath(_flexTemp + File.separator + AGLJ40_FILE);
-				copyOrDownload(AGLJ40_URL+AGLJ40_FILE,handleFontSWFAGLFileDownloaded,null,handleFontSWFInstallError);
-			}
-			
-			protected function handleFontSWFAGLFileDownloaded(event:Event):void
-			{
-				try
-				{
-					writeFileToDirectory(_aglj40JarFile, event.target.data);
-					copyFileToOptionalLibDir(_aglj40JarFile);
-					clearData(URLLoader(event.target));
-					
-					downloadFontSwfFlexFontKitFile();
-				}
-				catch (e:Error)
-				{
-					updateActivityStep(_constants.STEP_OPTIONAL_INSTALL_FONTSWF, StepItem.ERROR);
-					updateOptionalComponentInstallStatusAborted(_constants.STEP_OPTIONAL_INSTALL_FONTSWF,true);
-					installNextOptionalComponent();
-				}
-			}
-			
-			protected function downloadFontSwfFlexFontKitFile():void
+			try
 			{
-				log(StringUtil.substitute(_constants.INFO_DOWNLOADING_FILE_FROM,[FLEX_FONTKIT_FILE,FLEX_FONTKIT_URL]));
-				_flexFontKitJarFile = File.userDirectory.resolvePath(_flexTemp + File.separator + FLEX_FONTKIT_FILE);
-				copyOrDownload(FLEX_FONTKIT_URL+FLEX_FONTKIT_FILE,handleFontSWFFlexFontKitFileDownloaded,null,handleFontSWFInstallError);
+				log(_viewResourceConstants.INFO_DOWNLOADING_FLEX_SDK + APACHE_FLEX_BIN_DISTRO_URL);
+				_apacheFlexSDKZipFile = File.userDirectory.resolvePath(_flexTemp + File.separator + APACHE_FLEX_BIN_DISTRO_FILE); 
+				copyOrDownload(APACHE_FLEX_BIN_DISTRO_URL, handleApacheFlexSDKDownload, _apacheFlexSDKZipFile, handleApacheFlexSDKDownloadError);
 			}
-			
-			protected function handleFontSWFFlexFontKitFileDownloaded(event:Event):void
+			catch (e:Error)
 			{
-				try
-				{
-					writeFileToDirectory(_flexFontKitJarFile, event.target.data);
-					copyFileToOptionalLibDir(_flexFontKitJarFile);
-					clearData(URLLoader(event.target));
-					
-					downloadFontSwfRideauKitFile();
-				}
-				catch (e:Error)
-				{
-					updateActivityStep(_constants.STEP_OPTIONAL_INSTALL_FONTSWF, StepItem.ERROR);
-					updateOptionalComponentInstallStatusAborted(_constants.STEP_OPTIONAL_INSTALL_FONTSWF,true);
-					installNextOptionalComponent();
-				}
+				updateActivityStep(_viewResourceConstants.STEP_DOWNLOAD_FLEX_SDK, StepItem.ERROR);
+				log(_viewResourceConstants.ERROR_UNABLE_TO_CREATE_TEMP_DIRECTORY + "(error: " + e.message);
+				abortInstallation();
 			}
 			
-			protected function downloadFontSwfRideauKitFile():void
+		}
+		
+		protected function handleApacheFlexSDKDownload(event:Event):void
+		{
+			try
 			{
-				log(StringUtil.substitute(_constants.INFO_DOWNLOADING_FILE_FROM,[RIDEAU_FILE,RIDEAU_URL]));
-				_rideauJarFile = File.userDirectory.resolvePath(_flexTemp + File.separator + RIDEAU_FILE);
-				copyOrDownload(RIDEAU_URL+RIDEAU_FILE,handleFontSWFRideauFileDownloaded,null,handleFontSWFInstallError);
+				writeFileToDirectory(_apacheFlexSDKZipFile, event.target.data);
 			}
-			
-			protected function handleFontSWFRideauFileDownloaded(event:Event):void
+			catch (e:Error)
 			{
-				try
-				{
-					writeFileToDirectory(_rideauJarFile,event.target.data);
-					copyFileToOptionalLibDir(_rideauJarFile);
-					clearData(URLLoader(event.target));
-					
-					updateOptionalComponentInstallStatus(_constants.STEP_OPTIONAL_INSTALL_FONTSWF,true);
-					updateOptionalComponentInstallStatusAborted(_constants.STEP_OPTIONAL_INSTALL_FONTSWF,false);
-					updateActivityStep(_constants.STEP_OPTIONAL_INSTALL_FONTSWF, StepItem.COMPLETE);
-					installNextOptionalComponent(); 
-				}
-				catch (e:Error)
-				{
-					updateActivityStep(_constants.STEP_OPTIONAL_INSTALL_FONTSWF, StepItem.ERROR);
-					updateOptionalComponentInstallStatusAborted(_constants.STEP_OPTIONAL_INSTALL_FONTSWF,true);
-					installNextOptionalComponent();
-				}
+				updateActivityStep(_viewResourceConstants.STEP_DOWNLOAD_FLEX_SDK, StepItem.ERROR);
+				abortInstallation();
 			}
 			
-			protected function installOSMF():void
-			{
-				updateActivityStep(_constants.STEP_OPTIONAL_INSTALL_OSMF,StepItem.ACTIVE);
-				downloadOSMFFile();
-			}
+			updateActivityStep(_viewResourceConstants.STEP_DOWNLOAD_FLEX_SDK, StepItem.COMPLETE);
 			
-			protected function downloadOSMFFile():void
-			{
-				log(StringUtil.substitute(_constants.INFO_DOWNLOADING_FILE_FROM,[OSMF_FILE,OSMF_URL]));
-				_osmfFile = File.userDirectory.resolvePath(_flexTemp + File.separator + OSMF_FILE);
-				copyOrDownload(OSMF_URL+OSMF_FILE,handleOSMFFileDownloaded,null,handleOSMFInstallError);
-			}
+			updateActivityStep(_viewResourceConstants.STEP_VERIFY_FLEX_SDK, StepItem.ACTIVE);
+
+			log(_viewResourceConstants.STEP_VERIFY_FLEX_SDK);
 			
-			protected function handleOSMFFileDownloaded(event:Event):void
+			_md5CompareUtil.addEventListener(ProgressEvent.PROGRESS, md5VerificationProgressHandler);
+			_md5CompareUtil.verifyMD5(
+				_apacheFlexSDKZipFile, 
+				APACHE_FLEX_BIN_DISTRO_PATH + APACHE_FLEX_BIN_DISTRO_FILE, 
+				unzipApacheFlexSDK);
+		}
+		
+		protected function md5VerificationProgressHandler(event:ProgressEvent):void
+		{
+			progressBar.percent = Math.round((event.bytesLoaded / event.bytesTotal) * 100);
+		}
+		
+		protected function handleApacheFlexSDKDownloadError(event:*=null):void{
+			updateActivityStep(_viewResourceConstants.STEP_DOWNLOAD_FLEX_SDK, StepItem.ERROR);
+			log(_viewResourceConstants.ERROR_UNABLE_TO_DOWNLOAD_FLEX_SDK);
+			abortInstallation();
+		}
+		
+		protected function unzipApacheFlexSDK():void
+		{
+			if (!_md5CompareUtil.fileIsVerified)
 			{
-				try
-				{
-					writeFileToDirectory(_osmfFile, event.target.data);
-					copyFileToLibDir(_osmfFile);
-					clearData(URLLoader(event.target));
-					
-					updateOptionalComponentInstallStatus(_constants.STEP_OPTIONAL_INSTALL_OSMF,true);
-					updateOptionalComponentInstallStatusAborted(_constants.STEP_OPTIONAL_INSTALL_OSMF,false);
-					updateActivityStep(_constants.STEP_OPTIONAL_INSTALL_OSMF, StepItem.COMPLETE);
-					installNextOptionalComponent();
-				}
-				catch (e:Error)
-				{
-					updateActivityStep(_constants.STEP_OPTIONAL_INSTALL_OSMF, StepItem.ERROR);
-					updateOptionalComponentInstallStatusAborted(_constants.STEP_OPTIONAL_INSTALL_OSMF,true);
-					installNextOptionalComponent();
-				}
+				updateActivityStep(_viewResourceConstants.STEP_VERIFY_FLEX_SDK, StepItem.ERROR);
+				
+				log(_viewResourceConstants.ERROR_VERIFY_FLEX_SDK);
+				
+				abortInstallation();
+				return;
 			}
-			
-			protected function installTLF():void
+			else
 			{
-				updateActivityStep(_constants.STEP_OPTIONAL_INSTALL_TLF,StepItem.ACTIVE);
-				downloadTLFFile();
-			}
+				updateActivityStep(_viewResourceConstants.STEP_VERIFY_FLEX_SDK, StepItem.COMPLETE);
+				
+				log(_viewResourceConstants.INFO_VERIFY_FLEX_SDK_DONE);
+			} 
+
+			updateActivityStep(_viewResourceConstants.STEP_UNZIP_FLEX_SDK, StepItem.ACTIVE);
 			
-			protected function downloadTLFFile():void
+			try
 			{
-				log(StringUtil.substitute(_constants.INFO_DOWNLOADING_FILE_FROM,[TLF_FILE,TLF_URL]));
-				_tlfFile = File.userDirectory.resolvePath(_flexTemp + File.separator + TLF_FILE);
-				copyOrDownload(TLF_URL+TLF_FILE,handleTLFFileDownloaded,null,handleTLFInstallError);
+				log(_viewResourceConstants.INFO_UNZIPPING + _apacheFlexSDKZipFile.nativePath);
+				unzip(_apacheFlexSDKZipFile, handleApacheFlexSDKZipFileUnzipComplete, handleApacheFlexSDKZipFileUnzipError);
 			}
-			
-			protected function handleTLFFileDownloaded(event:Event):void
+			catch (e:Error)
 			{
-				try
-				{
-					writeFileToDirectory(_tlfFile, event.target.data);
-					copyFileToLibDir(_tlfFile);
-					clearData(URLLoader(event.target));
-					
-					updateOptionalComponentInstallStatus(_constants.STEP_OPTIONAL_INSTALL_TLF,true);
-					updateOptionalComponentInstallStatusAborted(_constants.STEP_OPTIONAL_INSTALL_TLF,false);
-					updateActivityStep(_constants.STEP_OPTIONAL_INSTALL_TLF, StepItem.COMPLETE);
-					installNextOptionalComponent();
-				}
-				catch (e:Error)
-				{
-					updateActivityStep(_constants.STEP_OPTIONAL_INSTALL_TLF, StepItem.ERROR);
-					updateOptionalComponentInstallStatusAborted(_constants.STEP_OPTIONAL_INSTALL_TLF,true);
-					installNextOptionalComponent();
-				}
-			}
-			
-			protected function copyFileToOptionalLibDir(file:File):void
-			{
-				//Copy to "${FLEX_HOME}/lib/external/optional"
-				var copyToFile:File = _flexHomeDir.resolvePath("lib" + File.separator + "external" + File.separator + "optional" + File.separator + file.name);
-				file.copyTo(copyToFile,true);
+				updateActivityStep(_viewResourceConstants.STEP_UNZIP_FLEX_SDK, StepItem.ERROR);
+				abortInstallation();
 			}
+		}
+		
+		protected function handleApacheFlexSDKZipFileUnzipComplete(event:Event):void
+		{
+			log(_viewResourceConstants.INFO_FINISHED_UNZIPPING + _apacheFlexSDKZipFile.nativePath);
+			updateActivityStep(_viewResourceConstants.STEP_UNZIP_FLEX_SDK, StepItem.COMPLETE);
 			
-			protected function copyFileToLibDir(file:File):void
+			if (_os == WINDOWS_OS)
 			{
-				//Copy to "${FLEX_HOME}/frameworks/libs/"
-				var copyToFile:File = _flexHomeDir.resolvePath("frameworks" + File.separator + "libs" + File.separator + file.name);
-				file.copyTo(copyToFile,true);
-			}
-			
-			protected function handleBlazeDSInstallError(event:*=null):void{
-				updateActivityStep(_constants.STEP_OPTIONAL_INSTALL_BLAZEDS, StepItem.ERROR);
-				updateOptionalComponentInstallStatusAborted(_constants.STEP_OPTIONAL_INSTALL_BLAZEDS,true);
-				log(StringUtil.substitute(_constants.ERROR_UNABLE_TO_DOWNLOAD_FILE,["BlazeDS"]));
-				installNextOptionalComponent();
-			}
-			
-			protected function handleFontSWFInstallError(event:*=null):void{
-				updateActivityStep(_constants.STEP_OPTIONAL_INSTALL_FONTSWF, StepItem.ERROR);
-				updateOptionalComponentInstallStatusAborted(_constants.STEP_OPTIONAL_INSTALL_FONTSWF,true);
-				log(StringUtil.substitute(_constants.ERROR_UNABLE_TO_DOWNLOAD_FILE,["FontSwf Utility"]));
-				installNextOptionalComponent();
-			}
-			
-			protected function handleOSMFInstallError(event:*=null):void{
-				updateActivityStep(_constants.STEP_OPTIONAL_INSTALL_OSMF, StepItem.ERROR);
-				updateOptionalComponentInstallStatusAborted(_constants.STEP_OPTIONAL_INSTALL_OSMF,true);
-				log(StringUtil.substitute(_constants.ERROR_UNABLE_TO_DOWNLOAD_FILE,["OSMF"]));
-				installNextOptionalComponent();
+				downloadAIRRuntimeKitForWindows();
 			}
-			
-			protected function handleTLFInstallError(event:*=null):void{
-				updateActivityStep(_constants.STEP_OPTIONAL_INSTALL_TLF, StepItem.ERROR);
-				updateOptionalComponentInstallStatusAborted(_constants.STEP_OPTIONAL_INSTALL_TLF,true);
-				log(StringUtil.substitute(_constants.ERROR_UNABLE_TO_DOWNLOAD_FILE,["TLF"]));
-				installNextOptionalComponent();
+			else if (_os == MAC_OS)
+			{ 
+				downloadAIRRuntimeKitForMac();
 			}
+		}
+		
+		protected function handleApacheFlexSDKZipFileUnzipError(error:ErrorEvent=null):void
+		{
+			updateActivityStep(_viewResourceConstants.STEP_UNZIP_FLEX_SDK, StepItem.ERROR);
+			abortInstallation();
+		}
+		
+		protected function downloadAIRRuntimeKitForWindows():void
+		{
+			updateActivityStep(_viewResourceConstants.STEP_DOWNLOAD_AIR_RUNTIME_KIT, StepItem.ACTIVE);
 			
-			protected function updateOptionalComponentInstallStatus(label:String,isInstalled:Boolean):void
+			try
 			{
-				for each (var obj:OptionalComponentVO in _optionalInstallsDataProvider)
-				{
-					if(obj.label == label)
-					{
-						obj.installed = isInstalled;
-					}
-				}
+				log(_viewResourceConstants.INFO_DOWNLOADING_AIR_RUNTIME_KIT_WINDOWS + ADOBE_AIR_SDK_WIN_URL);
+				_adobeAIRSDKZipFile = File.userDirectory.resolvePath(_flexTemp + File.separator + ADOBE_AIR_SDK_WIN_FILE);
+				copyOrDownload(ADOBE_AIR_SDK_WIN_URL, handleAIRSDKDownload, _adobeAIRSDKZipFile, handleAIRSDKDownloadError);
 			}
-			
-			protected function updateOptionalComponentInstallStatusAborted(label:String,isAborted:Boolean):void
+			catch (e:Error)
 			{
-				for each (var obj:OptionalComponentVO in _optionalInstallsDataProvider)
-				{
-					if(obj.label == label)
-					{
-						obj.aborted = isAborted;
-					}
-				}
+				updateActivityStep(_viewResourceConstants.STEP_DOWNLOAD_AIR_RUNTIME_KIT, StepItem.ERROR);
+				abortInstallation();
 			}
+		}
+		
+		protected function downloadAIRRuntimeKitForMac():void
+		{
+			updateActivityStep(_viewResourceConstants.STEP_DOWNLOAD_AIR_RUNTIME_KIT, StepItem.ACTIVE);
 			
-			protected function checkAndHandleAllOptionalComponentsInstalled():void
+			try
 			{
-				var allComponentsInstalled:Boolean = true;
-				for each (var obj:OptionalComponentVO in _optionalInstallsDataProvider)
-				{
-					if(obj.selected && !(obj.installed || obj.aborted))
-					{
-						allComponentsInstalled = false;
-					}
-				}
-				if(allComponentsInstalled)
-				{
-					cleanup(false);	
-				}
+				log(_viewResourceConstants.INFO_DOWNLOADING_AIR_RUNTIME_KIT_MAC + ADOBE_AIR_SDK_MAC_URL);
+				_adobeAIRSDKZipFile = File.userDirectory.resolvePath(_flexTemp + File.separator + ADOBE_AIR_SDK_MAC_FILE);
+				copyOrDownload(ADOBE_AIR_SDK_MAC_URL, handleAIRSDKDownload, _adobeAIRSDKZipFile, handleAIRSDKDownloadError);
 			}
-			
-			protected function cleanup(isAbort:Boolean=false):void
+			catch (e:Error)
 			{
-				try
-				{
-					_flexTempDir.deleteDirectory(true);
-				}
-				catch (e:Error)
-				{
-					log(_constants.ERROR_UNABLE_TO_DELETE_TEMP_DIRECTORY);	
-				}
-				
-				if (!isAbort)
-				{
-					log(_constants.INFO_INSTALLATION_COMPLETE);
-					updateUIHandleInstallationComplete();
-				}
+				updateActivityStep(_viewResourceConstants.STEP_DOWNLOAD_AIR_RUNTIME_KIT, StepItem.ERROR);
+				abortInstallation();
 			}
-			
-			protected function updateUIHandleInstallationComplete():void
+		}
+		
+		protected function handleAIRSDKDownload(event:Event):void
+		{
+			try
 			{
-				browseBtn.enabled = true;
-				openApacheFlexFolderBtn.visible = true;
-				openApacheFlexFolderBtn.includeInLayout = true;
-				progressBar.visible = false;
-				progressBar.includeInLayout = false;
-				thirdStepGroup.title = _constants.INFO_INSTALLATION_COMPLETE;
-			}
-			
-			protected function abortInstallation():void{
-				browseBtn.enabled = false;
-				installBtn.enabled = false;
-				cleanup(true);
-				log(_constants.INFO_ABORT_INSTALLATION);
-				firstStepGroup.title = secondStepGroup.title = thirdStepGroup.title = _constants.INFO_ABORT_INSTALLATION;
+				writeFileToDirectory(_adobeAIRSDKZipFile,event.target.data);
 			}
-			
-			protected function _langSelect_changeHandler(event:IndexChangeEvent):void
+			catch (e:Error)
 			{
-				if (_langSelect.selectedItem["data"] == _runtimeLocale.defaultLanguage)
-				{
-					resourceManager.localeChain = [_runtimeLocale.defaultLanguage];
-					resourceManager.update();
-				}
-				else
-				{
-					resourceManager.localeChain = [_langSelect.selectedItem["data"],_runtimeLocale.defaultLanguage];
-					resourceManager.update();	
-				}	
+				updateActivityStep(_viewResourceConstants.STEP_DOWNLOAD_AIR_RUNTIME_KIT, StepItem.ERROR);
+				abortInstallation();
 			}
 			
-			override protected function resourcesChanged():void
-			{
-				super.resourcesChanged();
-				
-				if (browseBtn)
-				{
-					browseBtn.label = _constants.BROWSE_BTN_LABEL;
-				}
-				if (installBtn)
-				{
-					installBtn.label = _constants.INSTALL_BTN_LABEL;
-				}
-				if (installLogBtn)
-				{
-					installLogBtn.label = _constants.INSTALL_LOG_BTN_LABEL;
-				}
-				if (closeBtn)
+			updateActivityStep(_viewResourceConstants.STEP_DOWNLOAD_AIR_RUNTIME_KIT, StepItem.COMPLETE);
+			
+			unzipAdobeAIRSDK();
+		}
+		
+		protected function handleAIRSDKDownloadError(error:*=null):void
+		{
+			updateActivityStep(_viewResourceConstants.STEP_DOWNLOAD_AIR_RUNTIME_KIT, StepItem.ERROR);
+			log(_viewResourceConstants.ERROR_UNABLE_TO_DOWNLOAD_AIR_SDK);
+			abortInstallation();
+		}
+		
+		protected function unzipAdobeAIRSDK():void
+		{
+			updateActivityStep(_viewResourceConstants.STEP_UNZIP_AIR_RUNTIME_KIT, StepItem.ACTIVE);
+			
+			try
+			{
+				if (_os == WINDOWS_OS)
 				{
-					closeBtn.label = _constants.CLOSE_BTN_LABEL;
+					unzipAdobeAIRSDKWindows()
 				}
-				if (flexSDKTxtInput)
+				else if (_os == MAC_OS)
 				{
-					flexSDKTxtInput.prompt = _constants.SELECT_PATH_PROMPT;
+					unzipAdobeAIRSDKMac();
 				}
 			}
-			
-			protected function placeFirstGroup():void
+			catch (e:Error)
 			{
-				firstStepGroup.x = this.width/2 - firstStepGroup.width/2;
+				updateActivityStep(_viewResourceConstants.STEP_UNZIP_AIR_RUNTIME_KIT, StepItem.ERROR);
+				abortInstallation();
 			}
-			
-			protected function placeSecondGroup():void
+		}
+		
+		protected function unzipAdobeAIRSDKWindows():void
+		{
+			log(_viewResourceConstants.INFO_UNZIPPING + _adobeAIRSDKZipFile.nativePath);
+			unzip(_adobeAIRSDKZipFile, handleAdobeAIRSDKWinZipFileUnzipComplete, handleAdobeAIRSDKWinZipFileUnzipError);
+		}
+		
+		protected function unzipAdobeAIRSDKMac():void
+		{
+			if (NativeProcess.isSupported)
 			{
-				secondStepGroup.x = this.width/2 - secondStepGroup.width/2;
+				untar(_adobeAIRSDKZipFile, _flexHomeDir, handleAdobeAIRSDKMacUntarComplete, handleAdobeAIRSDKMacUntarError);
 			}
-			
-			protected function placeThirdGroup():void
+			else
 			{
-				thirdStepGroup.x = this.width/2 - thirdStepGroup.width/2;
+				log(_viewResourceConstants.ERROR_NATIVE_PROCESS_NOT_SUPPORTED);
+				updateActivityStep(_viewResourceConstants.STEP_UNZIP_AIR_RUNTIME_KIT, StepItem.ERROR);
 			}
+		}
+		
+		protected function handleAdobeAIRSDKMacUntarError(error:ProgressEvent=null):void{
+			updateActivityStep(_viewResourceConstants.STEP_UNZIP_AIR_RUNTIME_KIT, StepItem.ERROR);
+			abortInstallation();
+		}
+		
+		protected function handleAdobeAIRSDKMacUntarComplete(event:Event):void
+		{
+			updateActivityStep(_viewResourceConstants.STEP_UNZIP_AIR_RUNTIME_KIT, StepItem.COMPLETE);
+			log(_viewResourceConstants.INFO_FINISHED_UNTARING + _adobeAIRSDKZipFile.nativePath);
+			downloadPlayerGlobalSWC();
+		}
+		
+		protected function handleAdobeAIRSDKWinZipFileUnzipComplete(event:Event):void
+		{
+			updateActivityStep(_viewResourceConstants.STEP_UNZIP_AIR_RUNTIME_KIT, StepItem.COMPLETE);
+			log(_viewResourceConstants.INFO_FINISHED_UNZIPPING + _adobeAIRSDKZipFile.nativePath);
+			downloadPlayerGlobalSWC();
+		}
+		
+		protected function handleAdobeAIRSDKWinZipFileUnzipError(error:ErrorEvent=null):void{
+			updateActivityStep(_viewResourceConstants.STEP_UNZIP_AIR_RUNTIME_KIT, StepItem.ERROR);
+		}
+		
+		protected function downloadPlayerGlobalSWC():void
+		{
+			updateActivityStep(_viewResourceConstants.STEP_DOWNLOAD_FLASHPLAYER_SWC, StepItem.ACTIVE);
 			
-			protected function handleOptionalInstallsChange(event:IndexChangeEvent):void
+			try
 			{
-				installRdBtn.visible = true;
-				dontInstallRdBtn.visible = true;
-				var selectedItem:OptionalComponentVO = OptionalComponentVO(event.target.selectedItem);
-				optionalInstallsTxtArea.text = selectedItem.message;
-				if(selectedItem.answered)
-				{
-					if(selectedItem.selected)
-					{
-						installPermissionRbtnGrp.selection = installRdBtn;
-					}
-					else
-					{
-						installPermissionRbtnGrp.selection = dontInstallRdBtn;	
-					}
-				}
-				else
-				{
-					installPermissionRbtnGrp.selection = null;
-				}
-				if(selectedItem.message == _constants.ASK_OSMF || selectedItem.message == _constants.ASK_TLF)
-				{
-					mplLicenseBtn.includeInLayout = mplLicenseBtn.visible = true;
-					adobeLicenseBtn.includeInLayout = adobeLicenseBtn.visible = false;
-					dontInstallRdBtn.includeInLayout = dontInstallRdBtn.visible = false; 
-				}
-				if(selectedItem.message == _constants.ASK_BLAZEDS || selectedItem.message == _constants.ASK_FONTSWF)
-				{
-					mplLicenseBtn.includeInLayout = mplLicenseBtn.visible = false;
-					adobeLicenseBtn.includeInLayout = adobeLicenseBtn.visible = true;
-					dontInstallRdBtn.includeInLayout = dontInstallRdBtn.visible = true; 
-				}
+				log(_viewResourceConstants.INFO_INSTALLING_PLAYERGLOBAL_SWC + ADOBE_FB_GLOBALPLAYER_SWC_URL);
+				_fbGlobalPlayerDir = createFolder(_flexHome + File.separator + "frameworks" + File.separator + "libs" + File.separator + "player" + File.separator + "11.1");
+				_fbGlobalPlayerFile = File.userDirectory.resolvePath(_fbGlobalPlayerDir.nativePath + File.separator + "playerglobal.swc");
+				copyOrDownload(ADOBE_FB_GLOBALPLAYER_SWC_URL, handlePlayerGlobalDownload, _fbGlobalPlayerFile, handlePlayerGlobalDownloadError);
 			}
-			
-			protected function handleInstallPermissionChange(event:Event):void
+			catch (e:Error)
 			{
-				optionalComponentsList.selectedItem.selected = (event.target.selectedValue==_constants.INSTALL)?true:false;
-				optionalComponentsList.selectedItem.answered = true;
-				checkIfAllRequiredComponentsPromptsAnswered();
+				updateActivityStep(_viewResourceConstants.STEP_DOWNLOAD_FLASHPLAYER_SWC, StepItem.ERROR);
+				abortInstallation();
+			}
+		}
+		
+		protected function handlePlayerGlobalDownload(event:Event):void
+		{
+			try
+			{
+				var playerGlobalFile:File = File.userDirectory.resolvePath(_fbGlobalPlayerDir.nativePath + File.separator + "playerglobal.swc");
+				writeFileToDirectory(playerGlobalFile,event.target.data);
 			}
+			catch (e:Error)
+			{
+				updateActivityStep(_viewResourceConstants.STEP_DOWNLOAD_FLASHPLAYER_SWC, StepItem.ERROR);
+				abortInstallation();
+			}
+			updateActivityStep(_viewResourceConstants.STEP_DOWNLOAD_FLASHPLAYER_SWC, StepItem.COMPLETE);
+			copyConfigFiles();
+		}
+		
+		protected function handlePlayerGlobalDownloadError(event:ErrorEvent=null):void
+		{
+			updateActivityStep(_viewResourceConstants.STEP_DOWNLOAD_FLASHPLAYER_SWC, StepItem.ERROR);
+			log(_viewResourceConstants.ERROR_UNABLE_TO_DOWNLOAD_FLASH_PLAYER_SWC);
+			abortInstallation();
+		}
+		
+		protected function copyConfigFiles():void
+		{
+			var aborted:Boolean = false;
+			
+			updateActivityStep(_viewResourceConstants.STEP_INSTALL_CONFIG_FILES, StepItem.ACTIVE);
 			
-			protected function checkIfAllRequiredComponentsPromptsAnswered():void
+			try
 			{
-				var success:Boolean = true;
-				for each (var obj:OptionalComponentVO in _optionalInstallsDataProvider)
+				//Config files
+				var configFilesDir:File = File.userDirectory.resolvePath(_flexHome + File.separator + "ide" + File.separator + "flashbuilder" + File.separator + "config");
+				var configFiles:Array = configFilesDir.getDirectoryListing();
+				var flexHomeFrameworksDir:File = File.userDirectory.resolvePath(_flexHome + File.separator + "frameworks");
+				log(_viewResourceConstants.INFO_INSTALLING_CONFIG_FILES);
+				
+				for each (var file:File in configFiles)
 				{
-					if(obj.required && !obj.selected)
+					if (isValidConfigFile(file))
 					{
-						success = false;
+						var copyToFile:File = flexHomeFrameworksDir.resolvePath(file.name);
+						file.copyTo(copyToFile,true);
 					}
 				}
-				installBtn.enabled = success;
+			}
+			catch (e:Error)
+			{
+				updateActivityStep(_viewResourceConstants.STEP_INSTALL_CONFIG_FILES, StepItem.ERROR);
+				log(_viewResourceConstants.ERROR_UNABLE_TO_INSTALL_CONFIG_FILES);
+				abortInstallation();
+				aborted = true;
 			}
 			
-			/************************ Utility methods *****************/
 			
-			private function createFolder(path:String):File
+			if (!aborted)
 			{
-				var dir:File = new File(path);
-				
-				dir.createDirectory();
-				
-				return dir;
+				updateActivityStep(_viewResourceConstants.STEP_INSTALL_CONFIG_FILES, StepItem.COMPLETE);
+				//cleanup();
+				installNextOptionalComponent();
 			}
-			
-			private function copyOrDownload(url:String, handlerFunction:Function, dest:File=null, errorFunction:Function=null):void
+		}
+		
+		protected function installNextOptionalComponent():void
+		{
+			for each (var obj:OptionalComponentVO in _optionalInstallsDataProvider)
 			{
-				if (url.search("http") == 0)
-				{
-					download(url, handlerFunction,errorFunction);
-				}
-				else
+				if(obj.selected && !obj.installed && !obj.aborted)
 				{
-					var source:File = new File(url);
-					
-					try
-					{
-						source.copyTo(dest, true);
-					}
-					catch (error:Error)
+					switch(obj.label)
 					{
-						if (errorFunction != null)
+						case _viewResourceConstants.STEP_OPTIONAL_INSTALL_BLAZEDS:
+						{
+							installBlazeDS();
+							return;
+							break;
+						}
+						case _viewResourceConstants.STEP_OPTIONAL_INSTALL_FONTSWF:
+						{
+							installFontSwf();
+							return;
+							break;
+						}
+						case _viewResourceConstants.STEP_OPTIONAL_INSTALL_OSMF:
+						{
+							installOSMF();
+							return;
+							break;
+						}
+						case _viewResourceConstants.STEP_OPTIONAL_INSTALL_TLF:
+						{
+							installTLF();
+							return;
+							break;
+						} 
+						default:
 						{
-							errorFunction.call(null);
+							break;
 						}
-						log(_constants.ERROR_UNABLE_TO_COPY_FILE + error.errorID + " " + error.message);
 					}
 				}
 			}
-			
-			private function download(url:String, handlerFunction:Function, errorFunction:Function=null):void
+			checkAndHandleAllOptionalComponentsInstalled();
+		}
+		
+		protected function installBlazeDS():void
+		{
+			updateActivityStep(_viewResourceConstants.STEP_OPTIONAL_INSTALL_BLAZEDS, StepItem.ACTIVE);
+			log(StringUtil.substitute(_viewResourceConstants.INFO_DOWNLOADING_FILE_FROM,[BLAZEDS_FILE,BLAZEDS_URL]));
+			_blazeDSJarFile = File.userDirectory.resolvePath(_flexTemp + File.separator + BLAZEDS_FILE);
+			copyOrDownload(BLAZEDS_URL+BLAZEDS_FILE,handleBlazeDSDownloadComplete,null,handleBlazeDSInstallError);
+		}
+		
+		protected function handleBlazeDSDownloadComplete(event:Event):void
+		{
+			try
+			{
+				writeFileToDirectory(_blazeDSJarFile,event.target.data);
+				copyFileToOptionalLibDir(_blazeDSJarFile);
+				updateOptionalComponentInstallStatus(_viewResourceConstants.STEP_OPTIONAL_INSTALL_BLAZEDS,true);
+				updateOptionalComponentInstallStatusAborted(_viewResourceConstants.STEP_OPTIONAL_INSTALL_BLAZEDS,false);
+				updateActivityStep(_viewResourceConstants.STEP_OPTIONAL_INSTALL_BLAZEDS, StepItem.COMPLETE);
+				clearData(URLLoader(event.target));
+				installNextOptionalComponent();
+			}
+			catch (e:Error)
+			{
+				updateActivityStep(_viewResourceConstants.STEP_OPTIONAL_INSTALL_BLAZEDS, StepItem.ERROR);
+				updateOptionalComponentInstallStatusAborted(_viewResourceConstants.STEP_OPTIONAL_INSTALL_BLAZEDS,true);
+				installNextOptionalComponent();
+			}
+		}
+		
+		protected function installFontSwf():void
+		{
+			updateActivityStep(_viewResourceConstants.STEP_OPTIONAL_INSTALL_FONTSWF,StepItem.ACTIVE);
+			downloadFontSwfAFEFile();
+		}
+		
+		protected function downloadFontSwfAFEFile():void
+		{
+			log(StringUtil.substitute(_viewResourceConstants.INFO_DOWNLOADING_FILE_FROM,[AFE_FILE,AFE_URL]));
+			_afeJarFile = File.userDirectory.resolvePath(_flexTemp + File.separator + AFE_FILE);
+			copyOrDownload(AFE_URL+AFE_FILE,handleFontSWFAFEFileDownloaded,null,handleFontSWFInstallError);
+		}
+		
+		protected function handleFontSWFAFEFileDownloaded(event:Event):void
+		{
+			try
 			{
-				var loader:URLLoader = new URLLoader();
-				var req:URLRequest = new URLRequest(url);
-				//Wait for 5 minutes before aborting download attempt.  Adobe download sites as well as some Apache mirrors are extremely slow.
-				req.idleTimeout = 300000; 
+				writeFileToDirectory(_afeJarFile, event.target.data);
+				copyFileToOptionalLibDir(_afeJarFile);
+				clearData(URLLoader(event.target));
 				
-				loader.dataFormat = URLLoaderDataFormat.BINARY; 
-				loader.addEventListener(Event.COMPLETE, handlerFunction,false,0,true);
-				loader.addEventListener(Event.COMPLETE, handleDownloadComplete,false,0,true);
-				progressBar.percent = 0;
+				downloadFontSwfAGLFile();
 				
-				if (errorFunction != null)
-				{
-					loader.addEventListener(ErrorEvent.ERROR,errorFunction,false,0,true);
-					loader.addEventListener(IOErrorEvent.IO_ERROR,errorFunction,false,0,true);
-				}
-				loader.addEventListener(ProgressEvent.PROGRESS, handleDownloadProgress,false,0,true);
+			}
+			catch (e:Error)
+			{
+				updateActivityStep(_viewResourceConstants.STEP_OPTIONAL_INSTALL_FONTSWF, StepItem.ERROR);
+				updateOptionalComponentInstallStatusAborted(_viewResourceConstants.STEP_OPTIONAL_INSTALL_FONTSWF,true);
+				installNextOptionalComponent();
+			}
+		}
+		
+		protected function downloadFontSwfAGLFile():void
+		{
+			log(StringUtil.substitute(_viewResourceConstants.INFO_DOWNLOADING_FILE_FROM,[AGLJ40_FILE,AGLJ40_URL]));
+			_aglj40JarFile = File.userDirectory.resolvePath(_flexTemp + File.separator + AGLJ40_FILE);
+			copyOrDownload(AGLJ40_URL+AGLJ40_FILE,handleFontSWFAGLFileDownloaded,null,handleFontSWFInstallError);
+		}
+		
+		protected function handleFontSWFAGLFileDownloaded(event:Event):void
+		{
+			try
+			{
+				writeFileToDirectory(_aglj40JarFile, event.target.data);
+				copyFileToOptionalLibDir(_aglj40JarFile);
+				clearData(URLLoader(event.target));
 				
-				loader.load(req);
+				downloadFontSwfFlexFontKitFile();
 			}
-			
-			private function handleDownloadProgress(event:ProgressEvent):void
+			catch (e:Error)
 			{
-				var bytesTotal:int = event.bytesTotal;
-				var bytesLoaded:int = event.bytesLoaded;
-				var percentLoaded:int = Math.round(bytesLoaded*100/bytesTotal);
+				updateActivityStep(_viewResourceConstants.STEP_OPTIONAL_INSTALL_FONTSWF, StepItem.ERROR);
+				updateOptionalComponentInstallStatusAborted(_viewResourceConstants.STEP_OPTIONAL_INSTALL_FONTSWF,true);
+				installNextOptionalComponent();
+			}
+		}
+		
+		protected function downloadFontSwfFlexFontKitFile():void
+		{
+			log(StringUtil.substitute(_viewResourceConstants.INFO_DOWNLOADING_FILE_FROM,[FLEX_FONTKIT_FILE,FLEX_FONTKIT_URL]));
+			_flexFontKitJarFile = File.userDirectory.resolvePath(_flexTemp + File.separator + FLEX_FONTKIT_FILE);
+			copyOrDownload(FLEX_FONTKIT_URL+FLEX_FONTKIT_FILE,handleFontSWFFlexFontKitFileDownloaded,null,handleFontSWFInstallError);
+		}
+		
+		protected function handleFontSWFFlexFontKitFileDownloaded(event:Event):void
+		{
+			try
+			{
+				writeFileToDirectory(_flexFontKitJarFile, event.target.data);
+				copyFileToOptionalLibDir(_flexFontKitJarFile);
+				clearData(URLLoader(event.target));
 				
-				progressBar.percent = percentLoaded;
+				downloadFontSwfRideauKitFile();
 			}
-			
-			private function handleDownloadComplete(event:Event):void
+			catch (e:Error)
+			{
+				updateActivityStep(_viewResourceConstants.STEP_OPTIONAL_INSTALL_FONTSWF, StepItem.ERROR);
+				updateOptionalComponentInstallStatusAborted(_viewResourceConstants.STEP_OPTIONAL_INSTALL_FONTSWF,true);
+				installNextOptionalComponent();
+			}
+		}
+		
+		protected function downloadFontSwfRideauKitFile():void
+		{
+			log(StringUtil.substitute(_viewResourceConstants.INFO_DOWNLOADING_FILE_FROM,[RIDEAU_FILE,RIDEAU_URL]));
+			_rideauJarFile = File.userDirectory.resolvePath(_flexTemp + File.separator + RIDEAU_FILE);
+			copyOrDownload(RIDEAU_URL+RIDEAU_FILE,handleFontSWFRideauFileDownloaded,null,handleFontSWFInstallError);
+		}
+		
+		protected function handleFontSWFRideauFileDownloaded(event:Event):void
+		{
+			try
 			{
-				_previousDisplayedPercent = 0;
+				writeFileToDirectory(_rideauJarFile,event.target.data);
+				copyFileToOptionalLibDir(_rideauJarFile);
 				clearData(URLLoader(event.target));
+				
+				updateOptionalComponentInstallStatus(_viewResourceConstants.STEP_OPTIONAL_INSTALL_FONTSWF,true);
+				updateOptionalComponentInstallStatusAborted(_viewResourceConstants.STEP_OPTIONAL_INSTALL_FONTSWF,false);
+				updateActivityStep(_viewResourceConstants.STEP_OPTIONAL_INSTALL_FONTSWF, StepItem.COMPLETE);
+				installNextOptionalComponent(); 
 			}
-			
-			private function clearData(v:URLLoader):void
+			catch (e:Error)
 			{
-				ByteArray(v.data).clear();
-				System.gc();
+				updateActivityStep(_viewResourceConstants.STEP_OPTIONAL_INSTALL_FONTSWF, StepItem.ERROR);
+				updateOptionalComponentInstallStatusAborted(_viewResourceConstants.STEP_OPTIONAL_INSTALL_FONTSWF,true);
+				installNextOptionalComponent();
 			}
-			
-			private function unzip(fileToUnzip:File, unzipCompleteFunction:Function, unzipErrorFunction:Function=null):void
+		}
+		
+		protected function installOSMF():void
+		{
+			updateActivityStep(_viewResourceConstants.STEP_OPTIONAL_INSTALL_OSMF,StepItem.ACTIVE);
+			downloadOSMFFile();
+		}
+		
+		protected function downloadOSMFFile():void
+		{
+			log(StringUtil.substitute(_viewResourceConstants.INFO_DOWNLOADING_FILE_FROM,[OSMF_FILE,OSMF_URL]));
+			_osmfFile = File.userDirectory.resolvePath(_flexTemp + File.separator + OSMF_FILE);
+			copyOrDownload(OSMF_URL+OSMF_FILE,handleOSMFFileDownloaded,null,handleOSMFInstallError);
+		}
+		
+		protected function handleOSMFFileDownloaded(event:Event):void
+		{
+			try
 			{
-				var zipFileBytes:ByteArray = new ByteArray();
-				var fs:FileStream = new FileStream();
-				var fzip:Zip = new Zip();
+				writeFileToDirectory(_osmfFile, event.target.data);
+				copyFileToLibDir(_osmfFile);
+				clearData(URLLoader(event.target));
 				
-				fs.open(fileToUnzip, FileMode.READ);
-				fs.readBytes(zipFileBytes);
-				fs.close();
+				updateOptionalComponentInstallStatus(_viewResourceConstants.STEP_OPTIONAL_INSTALL_OSMF,true);
+				updateOptionalComponentInstallStatusAborted(_viewResourceConstants.STEP_OPTIONAL_INSTALL_OSMF,false);
+				updateActivityStep(_viewResourceConstants.STEP_OPTIONAL_INSTALL_OSMF, StepItem.COMPLETE);
+				installNextOptionalComponent();
+			}
+			catch (e:Error)
+			{
+				updateActivityStep(_viewResourceConstants.STEP_OPTIONAL_INSTALL_OSMF, StepItem.ERROR);
+				updateOptionalComponentInstallStatusAborted(_viewResourceConstants.STEP_OPTIONAL_INSTALL_OSMF,true);
+				installNextOptionalComponent();
+			}
+		}
+		
+		protected function installTLF():void
+		{
+			updateActivityStep(_viewResourceConstants.STEP_OPTIONAL_INSTALL_TLF,StepItem.ACTIVE);
+			downloadTLFFile();
+		}
+		
+		protected function downloadTLFFile():void
+		{
+			log(StringUtil.substitute(_viewResourceConstants.INFO_DOWNLOADING_FILE_FROM,[TLF_FILE,TLF_URL]));
+			_tlfFile = File.userDirectory.resolvePath(_flexTemp + File.separator + TLF_FILE);
+			copyOrDownload(TLF_URL+TLF_FILE,handleTLFFileDownloaded,null,handleTLFInstallError);
+		}
+		
+		protected function handleTLFFileDownloaded(event:Event):void
+		{
+			try
+			{
+				writeFileToDirectory(_tlfFile, event.target.data);
+				copyFileToLibDir(_tlfFile);
+				clearData(URLLoader(event.target));
 				
-				fzip.addEventListener(ZipEvent.FILE_LOADED, onFileLoaded,false,0,true);
-				fzip.addEventListener(Event.COMPLETE, unzipCompleteFunction,false,0,true);
-				fzip.addEventListener(Event.COMPLETE, onUnzipComplete,false,0,true);
-				if (unzipErrorFunction != null)
+				updateOptionalComponentInstallStatus(_viewResourceConstants.STEP_OPTIONAL_INSTALL_TLF,true);
+				updateOptionalComponentInstallStatusAborted(_viewResourceConstants.STEP_OPTIONAL_INSTALL_TLF,false);
+				updateActivityStep(_viewResourceConstants.STEP_OPTIONAL_INSTALL_TLF, StepItem.COMPLETE);
+				installNextOptionalComponent();
+			}
+			catch (e:Error)
+			{
+				updateActivityStep(_viewResourceConstants.STEP_OPTIONAL_INSTALL_TLF, StepItem.ERROR);
+				updateOptionalComponentInstallStatusAborted(_viewResourceConstants.STEP_OPTIONAL_INSTALL_TLF,true);
+				installNextOptionalComponent();
+			}
+		}
+		

[... 798 lines stripped ...]


Mime
View raw message