@@ -64,8 +64,11 @@ void Start()
6464 {
6565 SetStatus ( "Launching from commandline.." ) ;
6666
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 ) ;
6972 SetStatus ( "Ready" ) ;
7073
7174 // quit after launch if enabled in settings
@@ -287,13 +290,13 @@ void UpdateRecentProjectsList()
287290 }
288291 }
289292
290- void LaunchProject ( string pathArg = null , bool openProject = true )
293+ void LaunchProject ( string projectPath , string version , bool openProject = true )
291294 {
292- if ( Directory . Exists ( pathArg ) == true )
295+ if ( Directory . Exists ( projectPath ) == true )
293296 {
294- if ( Directory . Exists ( Path . Combine ( pathArg , "Assets" ) ) )
297+ if ( Directory . Exists ( Path . Combine ( projectPath , "Assets" ) ) )
295298 {
296- var version = GetProjectVersion ( pathArg ) ;
299+ // var version = GetProjectVersion(projectPath );
297300 //Console.WriteLine("Detected project version: " + version);
298301
299302 bool haveExactVersion = HaveExactVersionInstalled ( version ) ;
@@ -309,7 +312,7 @@ void LaunchProject(string pathArg = null, bool openProject = true)
309312 myProcess . StartInfo . FileName = cmd ;
310313 if ( openProject == true )
311314 {
312- var pars = " -projectPath " + "\" " + pathArg + "\" " ;
315+ var pars = " -projectPath " + "\" " + projectPath + "\" " ;
313316 myProcess . StartInfo . Arguments = pars ;
314317 }
315318 myProcess . Start ( ) ;
@@ -350,12 +353,12 @@ void LaunchProject(string pathArg = null, bool openProject = true)
350353 }
351354 else
352355 {
353- SetStatus ( "No Assets folder founded in: " + pathArg ) ;
356+ SetStatus ( "No Assets folder founded in: " + projectPath ) ;
354357 }
355358 }
356359 else // given path doesnt exists, strange
357360 {
358- SetStatus ( "Invalid Path:" + pathArg ) ;
361+ SetStatus ( "Invalid Path: " + projectPath ) ;
359362 }
360363 }
361364
@@ -498,7 +501,9 @@ void LaunchSelectedProject(bool openProject = true)
498501 if ( selected > - 1 )
499502 {
500503 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 ) ;
502507 SetStatus ( "Ready" ) ;
503508 }
504509 }
@@ -862,7 +867,7 @@ private static string FindNearestVersionFromSimilarVersions(string version, IEnu
862867 if ( ! stripped . ContainsKey ( comparableVersion ) )
863868 {
864869 stripped . Add ( comparableVersion , version ) ;
865- Console . WriteLine ( comparableVersion + " : " + version ) ;
870+ // Console.WriteLine(comparableVersion + " : " + version);
866871 }
867872
868873 var comparables = stripped . Keys . OrderBy ( x => x ) . ToList ( ) ;
@@ -894,10 +899,14 @@ void UpgradeProject()
894899 if ( upgradeDialog . ShowDialog ( this ) == DialogResult . OK )
895900 {
896901 // yes, upgrade
902+ SetStatus ( "Upgrading project to " + Form2 . currentVersion ) ;
903+ var projectPath = gridRecent . Rows [ selected ] . Cells [ "_path" ] . Value . ToString ( ) ;
904+ LaunchProject ( projectPath , Form2 . currentVersion ) ;
897905 }
898906 else
899907 {
900908 // cancelled
909+ SetStatus ( "Cancelled project upgrade" ) ;
901910 }
902911 upgradeDialog . Close ( ) ;
903912
0 commit comments