3 Commits

Author SHA1 Message Date
b0110a2ecb changed version to 1.1.1 2021-05-27 14:32:52 +02:00
fd7c8b244f using Semver as versioning 2021-05-27 14:27:59 +02:00
9669636a17 removed unused imports 2021-05-27 13:19:44 +02:00
9 changed files with 30 additions and 48 deletions

View File

@@ -90,13 +90,13 @@
<DependentUpon>App.xaml</DependentUpon> <DependentUpon>App.xaml</DependentUpon>
<SubType>Code</SubType> <SubType>Code</SubType>
</Compile> </Compile>
<Compile Include="Objects\MD5File.cs" /> <Compile Include="Models\MD5File.cs" />
<Compile Include="Utils\DownloadUtil.cs" /> <Compile Include="Utils\DownloadUtil.cs" />
<Compile Include="Utils\MD5Util.cs" /> <Compile Include="Utils\MD5Util.cs" />
<Compile Include="Utils\ProcessUtil.cs" /> <Compile Include="Utils\ProcessUtil.cs" />
<Compile Include="Utils\RegistryUtil.cs" /> <Compile Include="Utils\RegistryUtil.cs" />
<Compile Include="Utils\ReleaseStreamUtil.cs" /> <Compile Include="Utils\ReleaseStreamUtil.cs" />
<Compile Include="Objects\UpdateState.cs" /> <Compile Include="Enums\UpdateState.cs" />
<Compile Include="Utils\OsuUtil.cs" /> <Compile Include="Utils\OsuUtil.cs" />
<Compile Include="MainWindow.xaml.cs"> <Compile Include="MainWindow.xaml.cs">
<DependentUpon>MainWindow.xaml</DependentUpon> <DependentUpon>MainWindow.xaml</DependentUpon>
@@ -143,6 +143,9 @@
<PackageReference Include="ModernWpfUI"> <PackageReference Include="ModernWpfUI">
<Version>0.9.4</Version> <Version>0.9.4</Version>
</PackageReference> </PackageReference>
<PackageReference Include="semver">
<Version>2.0.6</Version>
</PackageReference>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Resource Include="circle_new.ico" /> <Resource Include="circle_new.ico" />

View File

@@ -10,7 +10,7 @@
ui:WindowHelper.UseModernWindowStyle="True" ResizeMode="CanMinimize" Icon="circle_new.ico" Topmost="True" WindowStartupLocation="CenterScreen"> ui:WindowHelper.UseModernWindowStyle="True" ResizeMode="CanMinimize" Icon="circle_new.ico" Topmost="True" WindowStartupLocation="CenterScreen">
<ui:SimpleStackPanel Margin="12" Spacing="24"> <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" /> <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="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="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"/> <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"/>

View File

@@ -5,21 +5,18 @@ using System.Threading.Tasks;
using System.Runtime.InteropServices; using System.Runtime.InteropServices;
using System.Windows; using System.Windows;
using System.Windows.Navigation; using System.Windows.Navigation;
using System.Windows.Shapes;
using System.IO; using System.IO;
using System.Net; using System.Net;
using System.Globalization; using System.Globalization;
using ModernWpf.Controls; using ModernWpf.Controls;
using System.Windows.Forms; using System.Windows.Forms;
using System.Media; using System.Media;
using System.Runtime.InteropServices.ComTypes; using Path = System.IO.Path;
using Path = System.Windows.Shapes.Path;
using File = System.IO.File; using File = System.IO.File;
using EZPPClient_Installer.Utils; using EZPPClient_Installer.Utils;
using Microsoft.Win32;
using System.Windows.Controls;
using System.Threading;
using IWshRuntimeLibrary; using IWshRuntimeLibrary;
using System.Windows.Forms.VisualStyles;
using Semver;
#if DEBUG #if DEBUG
using MessageBox = System.Windows.MessageBox; using MessageBox = System.Windows.MessageBox;
@@ -38,7 +35,7 @@ namespace EZPPClient_Installer
[DllImport("kernel32.dll")] [DllImport("kernel32.dll")]
private static extern bool CreateSymbolicLink(string lpSymlinkFileName, string lpTargetFileName, SymbolicLink dwFlags); 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; public static string RELEASESTREAM;
@@ -81,6 +78,9 @@ namespace EZPPClient_Installer
bool isValidFolder = await isValidOsuFolder(osuPath); bool isValidFolder = await isValidOsuFolder(osuPath);
UpdateInstallButton(!string.IsNullOrEmpty(osuPath)); UpdateInstallButton(!string.IsNullOrEmpty(osuPath));
if(string.IsNullOrEmpty(osuPath))
folderTextbox.Text = "";
if (!string.IsNullOrEmpty(osuPath) && isValidFolder) if (!string.IsNullOrEmpty(osuPath) && isValidFolder)
{ {
bool foundInstall = isEZPPClientInstallationFound(osuPath); bool foundInstall = isEZPPClientInstallationFound(osuPath);
@@ -139,16 +139,19 @@ namespace EZPPClient_Installer
{ {
client.Headers.Add("user-agent", "EZPPClientInstaller"); client.Headers.Add("user-agent", "EZPPClientInstaller");
string newVersionString = await client.DownloadStringTaskAsync("https://new.ez-pp.farm/ezppclient?version"); string newVersionString = await client.DownloadStringTaskAsync("https://new.ez-pp.farm/ezppclient?version");
double ver = 0; SemVersion newVersion = new SemVersion(9, 9, 9);
try 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; return UpdateState.UpdateFound;
} }
} }
@@ -417,18 +420,18 @@ namespace EZPPClient_Installer
if (type.Equals("Install")) if (type.Equals("Install"))
{ {
string desktopPath = Environment.GetFolderPath(Environment.SpecialFolder.DesktopDirectory); 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 startMenuPath = Environment.GetFolderPath(Environment.SpecialFolder.StartMenu);
string startMenuPathPrograms = System.IO.Path.Combine(startMenuPath, "Programs"); string startMenuPathPrograms = Path.Combine(startMenuPath, "Programs");
string startMenuLinkFile = System.IO.Path.Combine(startMenuPathPrograms, "Start EZPPClient.lnk"); string startMenuLinkFile = Path.Combine(startMenuPathPrograms, "Start EZPPClient.lnk");
if (!File.Exists(desktopLinkFile)) if (!File.Exists(desktopLinkFile))
{ {
WshShell shell = new WshShell(); WshShell shell = new WshShell();
IWshShortcut shortcut = (IWshShortcut)shell.CreateShortcut(desktopLinkFile); IWshShortcut shortcut = (IWshShortcut)shell.CreateShortcut(desktopLinkFile);
shortcut.Description = $"Starts the EZPPClient"; shortcut.Description = $"Starts the EZPPClient";
shortcut.TargetPath = System.IO.Path.Combine(EZPPFolder, "EZPPClient.exe"); shortcut.TargetPath = Path.Combine(EZPPFolder, "EZPPClient.exe");
shortcut.Save(); shortcut.Save();
} }
@@ -437,7 +440,7 @@ namespace EZPPClient_Installer
WshShell shell = new WshShell(); WshShell shell = new WshShell();
IWshShortcut shortcut = (IWshShortcut)shell.CreateShortcut(startMenuLinkFile); IWshShortcut shortcut = (IWshShortcut)shell.CreateShortcut(startMenuLinkFile);
shortcut.Description = $"Starts the EZPPClient"; shortcut.Description = $"Starts the EZPPClient";
shortcut.TargetPath = System.IO.Path.Combine(EZPPFolder, "EZPPClient.exe"); shortcut.TargetPath = Path.Combine(EZPPFolder, "EZPPClient.exe");
shortcut.Save(); shortcut.Save();
} }
} }
@@ -598,13 +601,13 @@ namespace EZPPClient_Installer
string desktopPath = Environment.GetFolderPath(Environment.SpecialFolder.DesktopDirectory); 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)) if (File.Exists(linkFile))
File.Delete(linkFile); File.Delete(linkFile);
string startMenuPath = Environment.GetFolderPath(Environment.SpecialFolder.StartMenu); string startMenuPath = Environment.GetFolderPath(Environment.SpecialFolder.StartMenu);
string startMenuPathPrograms = System.IO.Path.Combine(startMenuPath, "Programs"); string startMenuPathPrograms = Path.Combine(startMenuPath, "Programs");
string startMenuLinkFile = System.IO.Path.Combine(startMenuPathPrograms, "Start EZPPClient.lnk"); string startMenuLinkFile = Path.Combine(startMenuPathPrograms, "Start EZPPClient.lnk");
if (File.Exists(startMenuLinkFile)) if (File.Exists(startMenuLinkFile))
File.Delete(startMenuLinkFile); File.Delete(startMenuLinkFile);

View File

@@ -3,9 +3,7 @@ using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.IO; using System.IO;
using System.Net; using System.Net;
using System.Security.Cryptography;
using System.Threading.Tasks; using System.Threading.Tasks;
using System.Windows.Forms;
namespace EZPPClient_Installer namespace EZPPClient_Installer
{ {

View File

@@ -1,11 +1,6 @@
using System; using System;
using System.Collections.Generic;
using System.IO; using System.IO;
using System.Linq;
using System.Security.Cryptography; using System.Security.Cryptography;
using System.Text;
using System.Threading.Tasks;
namespace EZPPClient_Installer namespace EZPPClient_Installer
{ {
class MD5Util class MD5Util

View File

@@ -1,10 +1,4 @@
using System; using Path = System.IO.Path;
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 Microsoft.Win32; using Microsoft.Win32;
namespace EZPPClient_Installer namespace EZPPClient_Installer

View File

@@ -1,10 +1,6 @@
using System; using System;
using System.Collections.Generic;
using System.Diagnostics; using System.Diagnostics;
using System.IO; using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace EZPPClient_Installer namespace EZPPClient_Installer
{ {

View File

@@ -1,9 +1,5 @@
using Microsoft.Win32; using Microsoft.Win32;
using System; using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace EZPPClient_Installer.Utils namespace EZPPClient_Installer.Utils
{ {

View File

@@ -1,9 +1,6 @@
using ModernWpf.Controls; using ModernWpf.Controls;
using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq;
using System.Net; using System.Net;
using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
namespace EZPPClient_Installer namespace EZPPClient_Installer