Skip to content

Commit 6dee66d

Browse files
committed
add context menu: copy update url, #build
1 parent f2e2a45 commit 6dee66d

File tree

3 files changed

+12
-1
lines changed

3 files changed

+12
-1
lines changed

Diff for: UnityLauncherPro/MainWindow.xaml

+1
Original file line numberDiff line numberDiff line change
@@ -732,6 +732,7 @@
732732
<DataGrid.ContextMenu>
733733
<ContextMenu>
734734
<MenuItem x:Name="menuItemCopyUpdatesVersion" Header="Copy Unity Version" Click="MenuItemCopyVersion_Click" />
735+
<MenuItem x:Name="menuItemCopyUpdateDownloadURL" Header="Copy Download URL" Click="MenuItemCopyUpdateDownloadURL_Click" />
735736
</ContextMenu>
736737
</DataGrid.ContextMenu>
737738
<local:Updates ReleaseDate="2020-10-10" Version="5000.1.2.3"/>

Diff for: UnityLauncherPro/MainWindow.xaml.cs

+10
Original file line numberDiff line numberDiff line change
@@ -715,6 +715,16 @@ private void MenuItemCopyVersion_Click(object sender, RoutedEventArgs e)
715715
if (copy != null) Clipboard.SetText(copy);
716716
}
717717

718+
// get download url for selected update version
719+
private void MenuItemCopyUpdateDownloadURL_Click(object sender, RoutedEventArgs e)
720+
{
721+
string copy = null;
722+
var unity = GetSelectedUpdate();
723+
copy = unity?.Version;https://unity3d.com/get-unity/download?thank-you=update&download_nid=65083&os=Win
724+
string exeURL = Tools.ParseDownloadURLFromWebpage(copy);
725+
if (exeURL != null) Clipboard.SetText(exeURL);
726+
}
727+
718728
private void BtnRefreshProjectList_Click(object sender, RoutedEventArgs e)
719729
{
720730
// we want to refresh unity installs also, to make sure version colors are correct

Diff for: UnityLauncherPro/Tools.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -430,7 +430,7 @@ public static void DownloadInBrowser(string url, string version)
430430

431431
// parse Unity installer exe from release page
432432
// thanks to https://github.com/softfruit
433-
static string ParseDownloadURLFromWebpage(string version)
433+
public static string ParseDownloadURLFromWebpage(string version)
434434
{
435435
string url = "";
436436

0 commit comments

Comments
 (0)