@@ -64,8 +64,11 @@ void Start()
64
64
{
65
65
SetStatus ( "Launching from commandline.." ) ;
66
66
67
- var pathArg = args [ 2 ] ;
68
- LaunchProject ( pathArg , true ) ;
67
+ var projectPathArgument = args [ 2 ] ;
68
+
69
+ var version = GetProjectVersion ( projectPathArgument ) ;
70
+
71
+ LaunchProject ( projectPathArgument , version , true ) ;
69
72
SetStatus ( "Ready" ) ;
70
73
71
74
// quit after launch if enabled in settings
@@ -287,13 +290,13 @@ void UpdateRecentProjectsList()
287
290
}
288
291
}
289
292
290
- void LaunchProject ( string pathArg = null , bool openProject = true )
293
+ void LaunchProject ( string projectPath , string version , bool openProject = true )
291
294
{
292
- if ( Directory . Exists ( pathArg ) == true )
295
+ if ( Directory . Exists ( projectPath ) == true )
293
296
{
294
- if ( Directory . Exists ( Path . Combine ( pathArg , "Assets" ) ) )
297
+ if ( Directory . Exists ( Path . Combine ( projectPath , "Assets" ) ) )
295
298
{
296
- var version = GetProjectVersion ( pathArg ) ;
299
+ // var version = GetProjectVersion(projectPath );
297
300
//Console.WriteLine("Detected project version: " + version);
298
301
299
302
bool haveExactVersion = HaveExactVersionInstalled ( version ) ;
@@ -309,7 +312,7 @@ void LaunchProject(string pathArg = null, bool openProject = true)
309
312
myProcess . StartInfo . FileName = cmd ;
310
313
if ( openProject == true )
311
314
{
312
- var pars = " -projectPath " + "\" " + pathArg + "\" " ;
315
+ var pars = " -projectPath " + "\" " + projectPath + "\" " ;
313
316
myProcess . StartInfo . Arguments = pars ;
314
317
}
315
318
myProcess . Start ( ) ;
@@ -350,12 +353,12 @@ void LaunchProject(string pathArg = null, bool openProject = true)
350
353
}
351
354
else
352
355
{
353
- SetStatus ( "No Assets folder founded in: " + pathArg ) ;
356
+ SetStatus ( "No Assets folder founded in: " + projectPath ) ;
354
357
}
355
358
}
356
359
else // given path doesnt exists, strange
357
360
{
358
- SetStatus ( "Invalid Path:" + pathArg ) ;
361
+ SetStatus ( "Invalid Path: " + projectPath ) ;
359
362
}
360
363
}
361
364
@@ -498,7 +501,9 @@ void LaunchSelectedProject(bool openProject = true)
498
501
if ( selected > - 1 )
499
502
{
500
503
SetStatus ( "Launching project.." ) ;
501
- LaunchProject ( gridRecent . Rows [ selected ] . Cells [ "_path" ] . Value . ToString ( ) , openProject ) ;
504
+ var projectPath = gridRecent . Rows [ selected ] . Cells [ "_path" ] . Value . ToString ( ) ;
505
+ var version = GetProjectVersion ( projectPath ) ;
506
+ LaunchProject ( projectPath , version , openProject ) ;
502
507
SetStatus ( "Ready" ) ;
503
508
}
504
509
}
@@ -862,7 +867,7 @@ private static string FindNearestVersionFromSimilarVersions(string version, IEnu
862
867
if ( ! stripped . ContainsKey ( comparableVersion ) )
863
868
{
864
869
stripped . Add ( comparableVersion , version ) ;
865
- Console . WriteLine ( comparableVersion + " : " + version ) ;
870
+ // Console.WriteLine(comparableVersion + " : " + version);
866
871
}
867
872
868
873
var comparables = stripped . Keys . OrderBy ( x => x ) . ToList ( ) ;
@@ -894,10 +899,14 @@ void UpgradeProject()
894
899
if ( upgradeDialog . ShowDialog ( this ) == DialogResult . OK )
895
900
{
896
901
// yes, upgrade
902
+ SetStatus ( "Upgrading project to " + Form2 . currentVersion ) ;
903
+ var projectPath = gridRecent . Rows [ selected ] . Cells [ "_path" ] . Value . ToString ( ) ;
904
+ LaunchProject ( projectPath , Form2 . currentVersion ) ;
897
905
}
898
906
else
899
907
{
900
908
// cancelled
909
+ SetStatus ( "Cancelled project upgrade" ) ;
901
910
}
902
911
upgradeDialog . Close ( ) ;
903
912
0 commit comments