@@ -191,7 +191,7 @@ public static void AddProjectToHistory(string projectPath)
191
191
{
192
192
// fix backslashes
193
193
projectPath = projectPath . Replace ( '\\ ' , '/' ) ;
194
-
194
+
195
195
if ( Properties . Settings . Default . projectPaths . Contains ( projectPath ) == false )
196
196
{
197
197
// TODO do we need to add as first?
@@ -767,6 +767,18 @@ public static void HandleDataGridScrollKeys(object sender, KeyEventArgs e)
767
767
*/
768
768
}
769
769
770
+ // NOTE this doesnt modify the 2nd line in ProjectVersion.txt
771
+ static void SaveProjectVersion ( Project proj )
772
+ {
773
+ var settingsPath = Path . Combine ( proj . Path , "ProjectSettings" , "ProjectVersion.txt" ) ;
774
+ if ( File . Exists ( settingsPath ) )
775
+ {
776
+ var versionRows = File . ReadAllLines ( settingsPath ) ;
777
+ versionRows [ 0 ] = "m_EditorVersion: " + proj . Version ;
778
+ File . WriteAllLines ( settingsPath , versionRows ) ;
779
+ }
780
+ }
781
+
770
782
public static void DisplayUpgradeDialog ( Project proj , MainWindow owner , bool useInitScript = false )
771
783
{
772
784
UpgradeWindow modalWindow = new UpgradeWindow ( proj . Version , proj . Path , proj . Arguments ) ;
@@ -786,9 +798,12 @@ public static void DisplayUpgradeDialog(Project proj, MainWindow owner, bool use
786
798
// get selected version to upgrade for
787
799
Console . WriteLine ( "Upgrade to " + upgradeToVersion ) ;
788
800
789
- // inject new version for this item
801
+ // inject new version for this item, TODO inject version to ProjectSettings file, so then no alert from unity wrong version dialog
790
802
proj . Version = upgradeToVersion ;
791
- var proc = LaunchProject ( proj , null , false ) ;
803
+ SaveProjectVersion ( proj ) ;
804
+ var proc = LaunchProject ( proj , dataGridRef : null , useInitScript : false , upgrade : true ) ;
805
+
806
+ // TODO update datagrid row for new version
792
807
}
793
808
else
794
809
{
0 commit comments