Compare commits
3 Commits
Author | SHA1 | Date | |
---|---|---|---|
b0110a2ecb | |||
fd7c8b244f | |||
9669636a17 |
@@ -90,13 +90,13 @@
|
||||
<DependentUpon>App.xaml</DependentUpon>
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Objects\MD5File.cs" />
|
||||
<Compile Include="Models\MD5File.cs" />
|
||||
<Compile Include="Utils\DownloadUtil.cs" />
|
||||
<Compile Include="Utils\MD5Util.cs" />
|
||||
<Compile Include="Utils\ProcessUtil.cs" />
|
||||
<Compile Include="Utils\RegistryUtil.cs" />
|
||||
<Compile Include="Utils\ReleaseStreamUtil.cs" />
|
||||
<Compile Include="Objects\UpdateState.cs" />
|
||||
<Compile Include="Enums\UpdateState.cs" />
|
||||
<Compile Include="Utils\OsuUtil.cs" />
|
||||
<Compile Include="MainWindow.xaml.cs">
|
||||
<DependentUpon>MainWindow.xaml</DependentUpon>
|
||||
@@ -143,6 +143,9 @@
|
||||
<PackageReference Include="ModernWpfUI">
|
||||
<Version>0.9.4</Version>
|
||||
</PackageReference>
|
||||
<PackageReference Include="semver">
|
||||
<Version>2.0.6</Version>
|
||||
</PackageReference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Resource Include="circle_new.ico" />
|
||||
|
@@ -10,7 +10,7 @@
|
||||
ui:WindowHelper.UseModernWindowStyle="True" ResizeMode="CanMinimize" Icon="circle_new.ico" Topmost="True" WindowStartupLocation="CenterScreen">
|
||||
<ui:SimpleStackPanel Margin="12" Spacing="24">
|
||||
<CheckBox x:Name="linkFoldersCheckbox" Content="Link Song and Skins Folder" HorizontalAlignment="Stretch" Height="32" VerticalAlignment="Top" Margin="150,125,150,-125" IsChecked="True" />
|
||||
<TextBox x:Name="folderTextbox" HorizontalAlignment="Left" Height="32" TextWrapping="Wrap" Text="" VerticalAlignment="Top" Width="422" Margin="10,-27,0,-5" IsReadOnly="true"/>
|
||||
<TextBox x:Name="folderTextbox" HorizontalAlignment="Left" Height="32" TextWrapping="Wrap" Text="trying to locate osu! location..." VerticalAlignment="Top" Width="422" Margin="10,-27,0,-5" IsReadOnly="true"/>
|
||||
<Button x:Name="InstallButton" Content="Install" HorizontalAlignment="Stretch" Height="32" VerticalAlignment="Bottom" Margin="176,0,176,-114" Style="{StaticResource AccentButtonStyle}" Click="Install_Click"/>
|
||||
<Button x:Name="BrowseButton" Content="..." HorizontalAlignment="Stretch" Height="32" VerticalAlignment="Top" Margin="437,-75,10,0" Click="Browse_Click"/>
|
||||
<Button x:Name="Uninstall_Button" Content="Uninstall" HorizontalAlignment="Stretch" Height="31" VerticalAlignment="Bottom" Margin="176,0,176,-100" Click="Uninstall_Button_Click" Foreground="White" Visibility="Hidden" IsCancel="True"/>
|
||||
|
@@ -5,21 +5,18 @@ using System.Threading.Tasks;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Windows;
|
||||
using System.Windows.Navigation;
|
||||
using System.Windows.Shapes;
|
||||
using System.IO;
|
||||
using System.Net;
|
||||
using System.Globalization;
|
||||
using ModernWpf.Controls;
|
||||
using System.Windows.Forms;
|
||||
using System.Media;
|
||||
using System.Runtime.InteropServices.ComTypes;
|
||||
using Path = System.Windows.Shapes.Path;
|
||||
using Path = System.IO.Path;
|
||||
using File = System.IO.File;
|
||||
using EZPPClient_Installer.Utils;
|
||||
using Microsoft.Win32;
|
||||
using System.Windows.Controls;
|
||||
using System.Threading;
|
||||
using IWshRuntimeLibrary;
|
||||
using System.Windows.Forms.VisualStyles;
|
||||
using Semver;
|
||||
|
||||
#if DEBUG
|
||||
using MessageBox = System.Windows.MessageBox;
|
||||
@@ -38,7 +35,7 @@ namespace EZPPClient_Installer
|
||||
[DllImport("kernel32.dll")]
|
||||
private static extern bool CreateSymbolicLink(string lpSymlinkFileName, string lpTargetFileName, SymbolicLink dwFlags);
|
||||
|
||||
private static double VERSION = 1.6;
|
||||
private static SemVersion VERSION = new SemVersion(1, 1, 1);
|
||||
|
||||
public static string RELEASESTREAM;
|
||||
|
||||
@@ -81,6 +78,9 @@ namespace EZPPClient_Installer
|
||||
bool isValidFolder = await isValidOsuFolder(osuPath);
|
||||
UpdateInstallButton(!string.IsNullOrEmpty(osuPath));
|
||||
|
||||
if(string.IsNullOrEmpty(osuPath))
|
||||
folderTextbox.Text = "";
|
||||
|
||||
if (!string.IsNullOrEmpty(osuPath) && isValidFolder)
|
||||
{
|
||||
bool foundInstall = isEZPPClientInstallationFound(osuPath);
|
||||
@@ -139,16 +139,19 @@ namespace EZPPClient_Installer
|
||||
{
|
||||
client.Headers.Add("user-agent", "EZPPClientInstaller");
|
||||
string newVersionString = await client.DownloadStringTaskAsync("https://new.ez-pp.farm/ezppclient?version");
|
||||
double ver = 0;
|
||||
SemVersion newVersion = new SemVersion(9, 9, 9);
|
||||
|
||||
try
|
||||
{
|
||||
ver = double.Parse(newVersionString, CultureInfo.InvariantCulture);
|
||||
newVersion = SemVersion.Parse(newVersionString);
|
||||
}
|
||||
catch (FormatException)
|
||||
{
|
||||
catch (Exception e){
|
||||
ShowErrorDialog(e.Message);
|
||||
}
|
||||
|
||||
if (ver > VERSION)
|
||||
int versionsBehind = newVersion.CompareTo(VERSION);
|
||||
|
||||
if (versionsBehind > 0)
|
||||
return UpdateState.UpdateFound;
|
||||
}
|
||||
}
|
||||
@@ -417,18 +420,18 @@ namespace EZPPClient_Installer
|
||||
if (type.Equals("Install"))
|
||||
{
|
||||
string desktopPath = Environment.GetFolderPath(Environment.SpecialFolder.DesktopDirectory);
|
||||
string desktopLinkFile = System.IO.Path.Combine(desktopPath, "Start EZPPClient.lnk");
|
||||
string desktopLinkFile = Path.Combine(desktopPath, "Start EZPPClient.lnk");
|
||||
|
||||
string startMenuPath = Environment.GetFolderPath(Environment.SpecialFolder.StartMenu);
|
||||
string startMenuPathPrograms = System.IO.Path.Combine(startMenuPath, "Programs");
|
||||
string startMenuLinkFile = System.IO.Path.Combine(startMenuPathPrograms, "Start EZPPClient.lnk");
|
||||
string startMenuPathPrograms = Path.Combine(startMenuPath, "Programs");
|
||||
string startMenuLinkFile = Path.Combine(startMenuPathPrograms, "Start EZPPClient.lnk");
|
||||
|
||||
if (!File.Exists(desktopLinkFile))
|
||||
{
|
||||
WshShell shell = new WshShell();
|
||||
IWshShortcut shortcut = (IWshShortcut)shell.CreateShortcut(desktopLinkFile);
|
||||
shortcut.Description = $"Starts the EZPPClient";
|
||||
shortcut.TargetPath = System.IO.Path.Combine(EZPPFolder, "EZPPClient.exe");
|
||||
shortcut.TargetPath = Path.Combine(EZPPFolder, "EZPPClient.exe");
|
||||
shortcut.Save();
|
||||
}
|
||||
|
||||
@@ -437,7 +440,7 @@ namespace EZPPClient_Installer
|
||||
WshShell shell = new WshShell();
|
||||
IWshShortcut shortcut = (IWshShortcut)shell.CreateShortcut(startMenuLinkFile);
|
||||
shortcut.Description = $"Starts the EZPPClient";
|
||||
shortcut.TargetPath = System.IO.Path.Combine(EZPPFolder, "EZPPClient.exe");
|
||||
shortcut.TargetPath = Path.Combine(EZPPFolder, "EZPPClient.exe");
|
||||
shortcut.Save();
|
||||
}
|
||||
}
|
||||
@@ -598,13 +601,13 @@ namespace EZPPClient_Installer
|
||||
|
||||
|
||||
string desktopPath = Environment.GetFolderPath(Environment.SpecialFolder.DesktopDirectory);
|
||||
string linkFile = System.IO.Path.Combine(desktopPath, "Start EZPPClient.lnk");
|
||||
string linkFile = Path.Combine(desktopPath, "Start EZPPClient.lnk");
|
||||
if (File.Exists(linkFile))
|
||||
File.Delete(linkFile);
|
||||
|
||||
string startMenuPath = Environment.GetFolderPath(Environment.SpecialFolder.StartMenu);
|
||||
string startMenuPathPrograms = System.IO.Path.Combine(startMenuPath, "Programs");
|
||||
string startMenuLinkFile = System.IO.Path.Combine(startMenuPathPrograms, "Start EZPPClient.lnk");
|
||||
string startMenuPathPrograms = Path.Combine(startMenuPath, "Programs");
|
||||
string startMenuLinkFile = Path.Combine(startMenuPathPrograms, "Start EZPPClient.lnk");
|
||||
if (File.Exists(startMenuLinkFile))
|
||||
File.Delete(startMenuLinkFile);
|
||||
|
||||
|
@@ -3,9 +3,7 @@ using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Net;
|
||||
using System.Security.Cryptography;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace EZPPClient_Installer
|
||||
{
|
||||
|
@@ -1,11 +1,6 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Security.Cryptography;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace EZPPClient_Installer
|
||||
{
|
||||
class MD5Util
|
||||
|
@@ -1,10 +1,4 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using Path = System.IO.Path;
|
||||
using File = System.IO.File;
|
||||
using Path = System.IO.Path;
|
||||
using Microsoft.Win32;
|
||||
|
||||
namespace EZPPClient_Installer
|
||||
|
@@ -1,10 +1,6 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace EZPPClient_Installer
|
||||
{
|
||||
|
@@ -1,9 +1,5 @@
|
||||
using Microsoft.Win32;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace EZPPClient_Installer.Utils
|
||||
{
|
||||
|
@@ -1,9 +1,6 @@
|
||||
using ModernWpf.Controls;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Net;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace EZPPClient_Installer
|
||||
|
Reference in New Issue
Block a user