@@ -140,9 +140,7 @@ private static string MAYA_CONFIG_COMMAND { get {
140
140
} }
141
141
142
142
private static string MAYA_CLOSE_COMMAND { get {
143
- return string . Format ( "scriptJob -idleEvent quit;" ,
144
- ESCAPED_QUOTE , GetProjectPath ( ) , GetAppPath ( ) , GetTempSavePath ( ) ,
145
- GetExportSettingsPath ( ) , GetMayaInstructionPath ( ) , ( IsHeadlessInstall ( ) ? 1 : 0 ) ) ;
143
+ return string . Format ( "scriptJob -idleEvent quit;" ) ;
146
144
} }
147
145
private static Char [ ] FIELD_SEPARATORS = new Char [ ] { ':' } ;
148
146
@@ -329,41 +327,44 @@ public static int ConfigureMaya(string mayaPath)
329
327
myProcess . StartInfo . CreateNoWindow = true ;
330
328
myProcess . StartInfo . UseShellExecute = false ;
331
329
330
+ string commandString ;
331
+
332
332
switch ( Application . platform ) {
333
333
case RuntimePlatform . WindowsEditor :
334
- if ( EditorTools . ExportSettings . instance . launchAfterInstallation )
335
- {
336
- myProcess . StartInfo . Arguments = string . Format ( "-command \" {0}\" " , MAYA_CONFIG_COMMAND ) ;
337
- myProcess . StartInfo . WindowStyle = System . Diagnostics . ProcessWindowStyle . Normal ;
338
- myProcess . StartInfo . CreateNoWindow = false ;
339
- }
340
- else
341
- {
342
- myProcess . StartInfo . Arguments = string . Format ( "-command \" {0}\" " , MAYA_CONFIG_COMMAND + MAYA_CLOSE_COMMAND ) ;
343
- }
334
+ commandString = "-command \" {0}\" " ;
344
335
break ;
345
336
case RuntimePlatform . OSXEditor :
346
- if ( EditorTools . ExportSettings . instance . launchAfterInstallation )
347
- {
348
- myProcess . StartInfo . Arguments = string . Format ( @"-command '{0}'" , MAYA_CONFIG_COMMAND ) ;
349
- myProcess . StartInfo . WindowStyle = System . Diagnostics . ProcessWindowStyle . Normal ;
350
- myProcess . StartInfo . CreateNoWindow = false ;
351
- }
352
- else
353
- {
354
- myProcess . StartInfo . Arguments = string . Format ( @"-command '{0}'" , MAYA_CONFIG_COMMAND + MAYA_CLOSE_COMMAND ) ;
355
- }
337
+ commandString = @"-command '{0}'" ;
356
338
break ;
357
339
default :
358
340
throw new NotImplementedException ( ) ;
359
341
}
360
342
343
+ if ( EditorTools . ExportSettings . instance . launchAfterInstallation )
344
+ {
345
+ myProcess . StartInfo . WindowStyle = System . Diagnostics . ProcessWindowStyle . Normal ;
346
+ myProcess . StartInfo . CreateNoWindow = false ;
347
+ myProcess . StartInfo . Arguments = string . Format ( commandString , MAYA_CONFIG_COMMAND ) ;
348
+ }
349
+ else
350
+ {
351
+ myProcess . StartInfo . Arguments = string . Format ( commandString , MAYA_CONFIG_COMMAND + MAYA_CLOSE_COMMAND ) ;
352
+ }
353
+
361
354
myProcess . EnableRaisingEvents = true ;
362
355
myProcess . Start ( ) ;
363
- myProcess . WaitForExit ( ) ;
364
- ExitCode = myProcess . ExitCode ;
365
- Debug . Log ( string . Format ( "Ran maya: [{0}]\n With args [{1}]\n Result {2}" ,
366
- mayaPath , myProcess . StartInfo . Arguments , ExitCode ) ) ;
356
+
357
+ if ( ! EditorTools . ExportSettings . instance . launchAfterInstallation )
358
+ {
359
+ myProcess . WaitForExit ( ) ;
360
+ ExitCode = myProcess . ExitCode ;
361
+ Debug . Log ( string . Format ( "Ran maya: [{0}]\n With args [{1}]\n Result {2}" ,
362
+ mayaPath , myProcess . StartInfo . Arguments , ExitCode ) ) ;
363
+ }
364
+ else
365
+ {
366
+ ExitCode = 0 ;
367
+ }
367
368
}
368
369
catch ( Exception e )
369
370
{
0 commit comments