@@ -184,10 +184,7 @@ void LoadSettings()
184
184
/// <returns></returns>
185
185
bool HaveExactVersionInstalled ( string version )
186
186
{
187
- //Console.WriteLine("checking: '" + version + "'");
188
- var installedExact = unityList . ContainsKey ( version ) ;
189
- //Console.WriteLine("have exact:" + installedExact);
190
- return installedExact ;
187
+ return string . IsNullOrEmpty ( version ) == false && unityList . ContainsKey ( version ) ;
191
188
}
192
189
193
190
@@ -545,7 +542,6 @@ string GetDownloadUrlForUnityVersion(string releaseUrl)
545
542
if ( match . Success == true )
546
543
{
547
544
url = match . Groups [ 0 ] . Captures [ 0 ] . Value ;
548
- // Console.WriteLine(url);
549
545
}
550
546
else
551
547
{
@@ -559,7 +555,7 @@ string GetDownloadUrlForUnityVersion(string releaseUrl)
559
555
/// launches browser to download installer
560
556
/// </summary>
561
557
/// <param name="url">full url to installer</param>
562
- void DownloadInBrowser ( string url )
558
+ void DownloadInBrowser ( string url , string version )
563
559
{
564
560
string exeURL = GetDownloadUrlForUnityVersion ( url ) ;
565
561
if ( string . IsNullOrEmpty ( exeURL ) == false )
@@ -571,7 +567,7 @@ void DownloadInBrowser(string url)
571
567
{
572
568
SetStatus ( "Error> Cannot find installer executable ... opening website instead" ) ;
573
569
url = "https://unity3d.com/get-unity/download/archive" ;
574
- Process . Start ( url + "#installer-exe- not-found" ) ;
570
+ Process . Start ( url + "#installer-not-found---version-" + version ) ;
575
571
}
576
572
}
577
573
@@ -584,7 +580,7 @@ string[] GetUnityInstallationsRootFolder()
584
580
string [ ] rootFolders = null ;
585
581
try
586
582
{
587
- // if settings exists, use that
583
+ // if settings exists, use that value
588
584
rootFolders = new string [ Properties . Settings . Default . rootFolders . Count ] ;
589
585
Properties . Settings . Default . rootFolders . CopyTo ( rootFolders , 0 ) ;
590
586
}
@@ -622,6 +618,7 @@ void LaunchSelectedProject(bool openProject = true)
622
618
{
623
619
var projectPath = gridRecent . Rows [ ( int ) selected ] . Cells [ "_path" ] . Value . ToString ( ) ;
624
620
var version = Tools . GetProjectVersion ( projectPath ) ;
621
+ Console . WriteLine ( "version: '" + version + "'" ) ;
625
622
LaunchProject ( projectPath , version , openProject ) ;
626
623
SetStatus ( "Ready" ) ;
627
624
}
@@ -631,7 +628,7 @@ void LaunchSelectedProject(bool openProject = true)
631
628
632
629
void LaunchSelectedUnity ( )
633
630
{
634
-
631
+
635
632
var selected = gridUnityList ? . CurrentCell ? . RowIndex ;
636
633
if ( selected . HasValue && selected > - 1 )
637
634
{
@@ -719,7 +716,7 @@ private void btnLaunchUnity_Click(object sender, EventArgs e)
719
716
720
717
private void btnExploreUnity_Click ( object sender , EventArgs e )
721
718
{
722
-
719
+
723
720
var selected = gridUnityList ? . CurrentCell ? . RowIndex ;
724
721
if ( selected . HasValue && selected > - 1 )
725
722
{
@@ -1141,7 +1138,7 @@ void DisplayUpgradeDialog(string currentVersion, string projectPath, bool launch
1141
1138
string url = Tools . GetUnityReleaseURL ( currentVersion ) ;
1142
1139
if ( string . IsNullOrEmpty ( url ) == false )
1143
1140
{
1144
- DownloadInBrowser ( url ) ;
1141
+ DownloadInBrowser ( url , currentVersion ) ;
1145
1142
}
1146
1143
else
1147
1144
{
@@ -1218,31 +1215,27 @@ void BrowseForExistingProjectFolder()
1218
1215
folderBrowserDialog1 . Description = "Select existing project folder" ;
1219
1216
var d = folderBrowserDialog1 . ShowDialog ( ) ;
1220
1217
var projectPath = folderBrowserDialog1 . SelectedPath ;
1218
+
1219
+ // NOTE: if user didnt click enter or deselect-select newly created folder, this fails as it returns "new folder" instead of actual name
1220
+ // https://social.msdn.microsoft.com/Forums/vstudio/en-US/cc7f1d54-c1a0-45de-9611-7f69873f32df/folderbrowserdialog-bug-when-click-ok-while-modify-new-folders-name?forum=netfxbcl
1221
+
1221
1222
if ( String . IsNullOrWhiteSpace ( projectPath ) == false && Directory . Exists ( projectPath ) == true )
1222
1223
{
1223
-
1224
1224
// TODO: remove duplicate code (from UpdateRecentList())
1225
-
1226
1225
string projectName = "" ;
1227
1226
1228
- Console . WriteLine ( Path . DirectorySeparatorChar ) ;
1229
- Console . WriteLine ( Path . AltDirectorySeparatorChar ) ;
1230
-
1231
1227
// get project name from full path
1232
1228
if ( projectPath . IndexOf ( Path . DirectorySeparatorChar ) > - 1 )
1233
1229
{
1234
1230
projectName = projectPath . Substring ( projectPath . LastIndexOf ( Path . DirectorySeparatorChar ) + 1 ) ;
1235
- Console . WriteLine ( "1" ) ;
1236
1231
}
1237
1232
else if ( projectPath . IndexOf ( Path . AltDirectorySeparatorChar ) > - 1 )
1238
1233
{
1239
1234
projectName = projectPath . Substring ( projectPath . LastIndexOf ( Path . AltDirectorySeparatorChar ) + 1 ) ;
1240
- Console . WriteLine ( "2" ) ;
1241
1235
}
1242
1236
else // no path separator found
1243
1237
{
1244
1238
projectName = projectPath ;
1245
- Console . WriteLine ( "3" ) ;
1246
1239
}
1247
1240
1248
1241
string csprojFile = Path . Combine ( projectPath , projectName + ".csproj" ) ;
@@ -1332,5 +1325,23 @@ void FixSelectedRow()
1332
1325
}
1333
1326
}
1334
1327
1328
+ private void btnOpenLogcatCmd_Click ( object sender , EventArgs e )
1329
+ {
1330
+ try
1331
+ {
1332
+ Process myProcess = new Process ( ) ;
1333
+ var cmd = "cmd.exe" ;
1334
+ myProcess . StartInfo . FileName = cmd ;
1335
+ // NOTE windows 10 cmd line supports ansi colors, otherwise remove -v color
1336
+ var pars = " /c adb logcat -s Unity ActivityManager PackageManager dalvikvm DEBUG -v color" ;
1337
+ myProcess . StartInfo . Arguments = pars ;
1338
+ myProcess . Start ( ) ;
1339
+ }
1340
+ catch ( Exception ex )
1341
+ {
1342
+ Console . WriteLine ( ex ) ;
1343
+ }
1344
+ }
1345
+
1335
1346
} // class Form
1336
1347
} // namespace
0 commit comments