@@ -43,6 +43,7 @@ package services
4343 import org.robotlegs.starling.mvcs.Actor ;
4444
4545 import starling.events.Event ;
46+ import flash.utils.IDataInput ;
4647
4748 public class AcquireProductService extends Actor implements IAcquireProductService
4849 {
@@ -216,6 +217,7 @@ package services
216217 }
217218 if (this . _process )
218219 {
220+ this . _process . removeEventListener (NativeProcessExitEvent. EXIT , decompress_completeHandler);
219221 this . _process . closeInput();
220222 this . _process . exit (true );
221223 this . _process = null ;
@@ -243,7 +245,7 @@ package services
243245 {
244246 var executable: File = new File("C:\\ Windows\\ System32\\ WindowsPowerShell\\ v1.0\\ powershell.exe" );
245247 var startupInfo: NativeProcessStartupInfo = new NativeProcessStartupInfo();
246- var arguments : Vector .< String > = new Vector . <String > () ;
248+ var arguments : Vector .< String > = new < String >[ "-NoProfile" ] ;
247249
248250 var command: String = "& {" ;
249251 command += "Param([string]$zipPath,[string]$outPath)"
@@ -265,14 +267,6 @@ package services
265267 command += "\" " ;
266268 arguments . push ("-Command" );
267269 arguments . push (command);
268- /*//with PowerShell 5, the command is much simpler,
269- //but we need support for older versions of Windows
270- arguments.push("Expand-Archive");
271- arguments.push("-Path");
272- arguments.push(source.nativePath);
273- arguments.push("-DestinationPath");
274- arguments.push(this._destinationDirectory.nativePath);
275- arguments.push("-Force");*/
276270
277271 startupInfo. executable = executable;
278272 startupInfo. arguments = arguments ;
@@ -314,7 +308,7 @@ package services
314308
315309 private function decompress_completeHandler (event :NativeProcessExitEvent ):void
316310 {
317- if (! this . _destinationDirectory . exists || ! this . _destinationDirectory . isDirectory)
311+ if (! this . _destinationDirectory || ! this . _destinationDirectory . exists || ! this . _destinationDirectory . isDirectory)
318312 {
319313 this . cleanup();
320314 this . sdkManagerModel. log (BINARY_DISTRIBUTION_NOT_FOUND_ERROR );
@@ -346,6 +340,10 @@ package services
346340
347341 private function decompress_errorHandler (event :flash .events.Event):void
348342 {
343+ var output: IDataInput = this . _process . standardError;
344+ var data : String = output. readUTFBytes (output. bytesAvailable );
345+ this . sdkManagerModel. log (data );
346+
349347 this . cleanup();
350348 this . sdkManagerModel. log (DECOMPRESS_ERROR );
351349 this . dispatchWith(AcquireProductServiceEventType. ERROR , false , DECOMPRESS_ERROR );
0 commit comments