@@ -350,7 +350,11 @@ public int ConfigureMaya(string mayaPath)
350
350
myProcess . StartInfo . WindowStyle = System . Diagnostics . ProcessWindowStyle . Hidden ;
351
351
myProcess . StartInfo . CreateNoWindow = true ;
352
352
myProcess . StartInfo . UseShellExecute = false ;
353
- myProcess . StartInfo . RedirectStandardError = true ;
353
+
354
+ if ( ! ExportSettings . instance . LaunchAfterInstallation )
355
+ {
356
+ myProcess . StartInfo . RedirectStandardError = true ;
357
+ }
354
358
355
359
string commandString ;
356
360
@@ -381,14 +385,14 @@ public int ConfigureMaya(string mayaPath)
381
385
382
386
if ( ! ExportSettings . instance . LaunchAfterInstallation )
383
387
{
388
+ string stderr = myProcess . StandardError . ReadToEnd ( ) ;
384
389
myProcess . WaitForExit ( ) ;
385
390
ExitCode = myProcess . ExitCode ;
386
391
Debug . Log ( string . Format ( "Ran maya: [{0}]\n With args [{1}]\n Result {2}" ,
387
392
mayaPath , myProcess . StartInfo . Arguments , ExitCode ) ) ;
388
393
389
394
// see if we got any error messages
390
395
if ( ExitCode != 0 ) {
391
- string stderr = myProcess . StandardError . ReadToEnd ( ) ;
392
396
if ( ! string . IsNullOrEmpty ( stderr ) ) {
393
397
Debug . LogError ( string . Format ( "Maya installation error (exit code: {0}): {1}" , ExitCode , stderr ) ) ;
394
398
}
@@ -645,6 +649,7 @@ public static int InstallMaxPlugin(string maxExe){
645
649
646
650
myProcess . EnableRaisingEvents = true ;
647
651
myProcess . Start ( ) ;
652
+ string stderr = myProcess . StandardOutput . ReadToEnd ( ) ;
648
653
myProcess . WaitForExit ( ) ;
649
654
ExitCode = myProcess . ExitCode ;
650
655
@@ -661,7 +666,6 @@ public static int InstallMaxPlugin(string maxExe){
661
666
662
667
// print any errors
663
668
if ( ExitCode != 0 ) {
664
- string stderr = myProcess . StandardOutput . ReadToEnd ( ) ;
665
669
if ( ! string . IsNullOrEmpty ( stderr ) ) {
666
670
Debug . LogError ( string . Format ( "3ds Max installation error (exit code: {0}): {1}" , ExitCode , stderr ) ) ;
667
671
}
0 commit comments