Skip to content

Fix for CheckPlasticBranch option being cleared on app restart #120

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 11 commits into from
8 changes: 6 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ Handle all your Unity versions and Projects easily!
## Features
- Automagically Open Projects with Correct Unity Version
- Display Recent Projects list with last modified date and project version info
- List more than 40 recent projects!
- Quickly Explore Project Folders
- List installed Unity versions, can easily Run, Explore installation folder, View release notes
- Download Missing Unity Versions in Browser
Expand All @@ -33,7 +34,8 @@ https://forum.unity.com/threads/unity-launcher-launch-correct-unity-versions-for
https://github.com/unitycoder/UnityLauncherPro/wiki

### Development
See DEV branch for latest commits https://github.com/unitycoder/UnityLauncherPro/tree/dev
See DEV branch for latest commits https://github.com/unitycoder/UnityLauncherPro/tree/dev <br>
Pre-releases are sometimes available from dev branch: https://github.com/unitycoder/UnityLauncherPro/releases

### Screenshots

Expand All @@ -45,7 +47,7 @@ See DEV branch for latest commits https://github.com/unitycoder/UnityLauncherPro

![image](https://user-images.githubusercontent.com/5438317/154346224-8aa8d547-8495-47cf-baca-4cb31639344b.png)

![image](https://user-images.githubusercontent.com/5438317/154346049-4426f504-a437-4119-8d1c-f3d4d3fa434c.png)
![image](https://user-images.githubusercontent.com/5438317/193452933-02684483-a15e-481a-b09a-afe48d16a4f3.png)

### Perform tasks on selected project
![image](https://user-images.githubusercontent.com/5438317/120828528-4da59c80-c565-11eb-8b11-9cf739cde306.png)
Expand All @@ -62,6 +64,8 @@ See DEV branch for latest commits https://github.com/unitycoder/UnityLauncherPro
### View and Select current platform
![unitylauncherpro_platform](https://user-images.githubusercontent.com/5438317/132997691-5ed50f1d-e285-4c83-b356-46c1e3f431e4.gif)

### Rename Project title
![pro-rename](https://user-images.githubusercontent.com/5438317/193453048-aa5527c6-a345-4f93-b934-f68ac2524cac.gif)

<br>
Old (winforms) version is here: https://github.com/unitycoder/UnityLauncher
Expand Down
17 changes: 17 additions & 0 deletions UnityLauncherPro/GetUnityInstallations.cs
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,23 @@ public static List<UnityInstallation> Scan()
unity.IsPreferred = (version == MainWindow.preferredVersion);
unity.ProjectCount = GetProjectCountForUnityVersion(version);

if (Tools.IsLTS(version))
{
unity.ReleaseType = "LTS";
}
else if (Tools.IsAlpha(version))
{
unity.ReleaseType = "Alpha";
}
else if (Tools.IsBeta(version))
{
unity.ReleaseType = "Beta";
}
else
{
unity.ReleaseType = ""; // cannot be null for UnitysFilter to work properly
}

// get platforms, NOTE if this is slow, do it later, or skip for commandline
var platforms = GetPlatforms(dataFolder);
// this is for editor tab, show list of all platforms in cell
Expand Down
7 changes: 4 additions & 3 deletions UnityLauncherPro/MainWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -266,11 +266,12 @@
</DataGridTextColumn.ElementStyle>
</DataGridTextColumn>

<DataGridTextColumn Binding="{Binding Version}" ClipboardContentBinding="{x:Null}" Header="Version" IsReadOnly="True" MinWidth="123"/>
<DataGridTextColumn Binding="{Binding Path}" ClipboardContentBinding="{x:Null}" Header="Path" IsReadOnly="True"/>
<DataGridTextColumn Binding="{Binding Installed, StringFormat=\{0:dd/MM/yyyy HH:mm:ss\}}" ClipboardContentBinding="{x:Null}" Header="Installed" IsReadOnly="True"/>
<DataGridTextColumn Binding="{Binding Version}" ClipboardContentBinding="{x:Null}" Header="Version" IsReadOnly="True" MinWidth="90"/>
<DataGridTextColumn Header="Release" Binding="{Binding ReleaseType}" IsReadOnly="True" CanUserResize="False" MinWidth="50" />
<DataGridTextColumn Binding="{Binding PlatformsCombined}" ClipboardContentBinding="{x:Null}" Header="Platforms" IsReadOnly="True"/>
<DataGridTextColumn Binding="{Binding Installed, StringFormat=\{0:dd/MM/yyyy HH:mm:ss\}}" ClipboardContentBinding="{x:Null}" Header="Installed" IsReadOnly="True"/>
<DataGridTextColumn Binding="{Binding ProjectCount}" ClipboardContentBinding="{x:Null}" Header="Projects" IsReadOnly="True"/>
<DataGridTextColumn Binding="{Binding Path}" ClipboardContentBinding="{x:Null}" Header="Path" IsReadOnly="True"/>
</DataGrid.Columns>

<!-- right click context menu -->
Expand Down
38 changes: 13 additions & 25 deletions UnityLauncherPro/MainWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -128,8 +128,9 @@ void Start()
// clear updates grid
dataGridUpdates.Items.Clear();

// clear buildreport grid
// clear buildreport grids
gridBuildReport.Items.Clear();
gridBuildReportData.Items.Clear();

// build notifyicon (using windows.forms)
notifyIcon = new System.Windows.Forms.NotifyIcon();
Expand Down Expand Up @@ -334,7 +335,7 @@ private bool UpdatesFilter(object item)
private bool UnitysFilter(object item)
{
UnityInstallation unity = item as UnityInstallation;
return (unity.Version.IndexOf(_filterString, 0, StringComparison.CurrentCultureIgnoreCase) != -1);
return (unity.Version?.IndexOf(_filterString, 0, StringComparison.CurrentCultureIgnoreCase) != -1) || (unity.ReleaseType?.IndexOf(_filterString, 0, StringComparison.CurrentCultureIgnoreCase) != -1) || (unity.PlatformsCombined?.IndexOf(_filterString, 0, StringComparison.CurrentCultureIgnoreCase) != -1);
}

private bool BuildReportFilter(object item)
Expand All @@ -361,6 +362,7 @@ void LoadSettings()
chkQuitAfterOpen.IsChecked = Properties.Settings.Default.closeAfterProject;
chkShowLauncherArgumentsColumn.IsChecked = Properties.Settings.Default.showArgumentsColumn;
chkShowGitBranchColumn.IsChecked = Properties.Settings.Default.showGitBranchColumn;
chkCheckPlasticBranch.IsChecked = Properties.Settings.Default.checkPlasticBranch;
chkShowMissingFolderProjects.IsChecked = Properties.Settings.Default.showProjectsMissingFolder;
chkAllowSingleInstanceOnly.IsChecked = Properties.Settings.Default.AllowSingleInstanceOnly;
chkAskNameForQuickProject.IsChecked = Properties.Settings.Default.askNameForQuickProject;
Expand Down Expand Up @@ -906,7 +908,7 @@ private void OnWindowKeyDown(object sender, KeyEventArgs e)
}

break;
case 1: // Unitys
case 1: // Unitys/Editors

switch (e.Key)
{
Expand All @@ -916,6 +918,13 @@ private void OnWindowKeyDown(object sender, KeyEventArgs e)
case Key.Escape: // clear project search
txtSearchBoxUnity.Text = "";
break;
default:
if (txtSearchBoxUnity.IsFocused == false)
{
txtSearchBoxUnity.Focus();
txtSearchBoxUnity.Select(txtSearchBoxUnity.Text.Length, 0);
}
break;
}
break;

Expand Down Expand Up @@ -950,7 +959,7 @@ private void OnWindowKeyDown(object sender, KeyEventArgs e)
private async void OnTabSelectionChanged(object sender, SelectionChangedEventArgs e)
{
// if going into updates tab, fetch list (first time only)
if (((TabControl)sender).SelectedIndex == (int)Tabs.Updates)
if (tabControl.SelectedIndex == (int)Tabs.Updates)
{
// if we dont have previous results yet, TODO scan again if previous was 24hrs ago
if (updatesSource == null)
Expand Down Expand Up @@ -3350,27 +3359,6 @@ private void tabControl_PreviewKeyDown(object sender, KeyEventArgs e)
}
}





//private void BtnBrowseTemplateUnityPackagesFolder_Click(object sender, RoutedEventArgs e)
//{
// var folder = Tools.BrowseForOutputFolder("Select unitypackage Templates folder");
// if (string.IsNullOrEmpty(folder) == false)
// {
// txtTemplatePackagesFolder.Text = folder;
// Properties.Settings.Default.templatePackagesFolder = folder;
// Properties.Settings.Default.Save();
// }
//}

//private void TxtTemplatePackagesFolder_TextChanged(object sender, TextChangedEventArgs e)
//{
// Properties.Settings.Default.templatePackagesFolder = txtTemplatePackagesFolder.Text;
// Properties.Settings.Default.Save();
//}

} // class
} //namespace

21 changes: 2 additions & 19 deletions UnityLauncherPro/NewProject.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,29 +38,12 @@ public NewProject(string unityVersion, string suggestedName, string targetFolder
txtNewProjectName.Text = newName;
lblNewProjectFolder.Content = targetFolder;

// fill available versions
//// fill available versions
if (gridAvailableVersions.ItemsSource == null)
{
// get release type info (not done in mainwindow yet, to avoid doing extra stuff)
for (int i = 0, len = MainWindow.unityInstallationsSource.Count; i < len; i++)
{
var ver = MainWindow.unityInstallationsSource[i].Version;
if (Tools.IsLTS(ver))
{
MainWindow.unityInstallationsSource[i].ReleaseType = "LTS";
}
else if (Tools.IsAlpha(ver))
{
MainWindow.unityInstallationsSource[i].ReleaseType = "Alpha";
}
else if (Tools.IsBeta(ver))
{
MainWindow.unityInstallationsSource[i].ReleaseType = "Beta";
}
}

gridAvailableVersions.ItemsSource = MainWindow.unityInstallationsSource;
}

// we have that version installed
if (MainWindow.unityInstalledVersions.ContainsKey(unityVersion) == true)
{
Expand Down
16 changes: 13 additions & 3 deletions UnityLauncherPro/Tools.cs
Original file line number Diff line number Diff line change
Expand Up @@ -602,9 +602,19 @@ public static void DownloadAndInstall(string url, string version)
}
}

Process process = Process.Start(tempFile);
process.EnableRaisingEvents = true;
process.Exited += (sender, e) => DeleteTempFile(tempFile);
Process process;
// if user clicks NO to UAC, this fails (so added try-catch)
try
{
process = Process.Start(tempFile);
process.EnableRaisingEvents = true;
process.Exited += (sender, e) => DeleteTempFile(tempFile);
}
catch (Exception)
{
Console.WriteLine("Failed to run exe: " + tempFile);
DeleteTempFile(tempFile);
}
// TODO refresh upgrade dialog after installer finished
}
}
Expand Down
7 changes: 0 additions & 7 deletions appveyor.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
version: 1.0.{build}
branches:
only:
- dev
skip_tags: true
skip_branch_with_pr: true
image: Visual Studio 2022
configuration: Release
only_commits:
Expand All @@ -20,6 +16,3 @@ deploy:
auth_token:
secure: kmYSrl7Mx/PFDGcyC5gS/vpW2UJCVguEXZsQ0LtkfwmSzx+3noZOyPrbZQ8uWX2B
artifact: deploy
prerelease: true
on:
branch: dev