diff --git a/SPTInstaller/Assets/icon.ico b/SPTInstaller/Assets/icon.ico deleted file mode 100644 index 63e68d0..0000000 Binary files a/SPTInstaller/Assets/icon.ico and /dev/null differ diff --git a/SPTInstaller/Assets/spt_installer.ico b/SPTInstaller/Assets/spt_installer.ico new file mode 100644 index 0000000..cad3e27 Binary files /dev/null and b/SPTInstaller/Assets/spt_installer.ico differ diff --git a/SPTInstaller/CustomControls/Dialogs/WhyCacheThoughDialog.axaml.cs b/SPTInstaller/CustomControls/Dialogs/WhyCacheThoughDialog.axaml.cs index 4bc4f94..994d353 100644 --- a/SPTInstaller/CustomControls/Dialogs/WhyCacheThoughDialog.axaml.cs +++ b/SPTInstaller/CustomControls/Dialogs/WhyCacheThoughDialog.axaml.cs @@ -5,6 +5,7 @@ using Avalonia; using Avalonia.Controls; using Avalonia.Media; using Serilog; +using SPTInstaller.Models; using Color = System.Drawing.Color; namespace SPTInstaller.CustomControls.Dialogs; @@ -101,8 +102,7 @@ public partial class WhyCacheThoughDialog : UserControl switch (_movePatcherState) { case 0: - var downloadsPath = - Path.Join(Environment.GetFolderPath(Environment.SpecialFolder.UserProfile), "Downloads"); + var downloadsPath = KnownFolders.GetPath(KnownFolder.Downloads); var downloadsFolder = new DirectoryInfo(downloadsPath); diff --git a/SPTInstaller/Models/KnownFolders.cs b/SPTInstaller/Models/KnownFolders.cs new file mode 100644 index 0000000..bd1faac --- /dev/null +++ b/SPTInstaller/Models/KnownFolders.cs @@ -0,0 +1,38 @@ +using System.Collections.Generic; +using System.Runtime.InteropServices; + +namespace SPTInstaller.Models; + +public enum KnownFolder +{ + Contacts, + Downloads, + Favorites, + Links, + SavedGames, + SavedSearches +} + +public static class KnownFolders +{ + private static readonly Dictionary _guids = new() + { + [KnownFolder.Contacts] = new("56784854-C6CB-462B-8169-88E350ACB882"), + [KnownFolder.Downloads] = new("374DE290-123F-4565-9164-39C4925E467B"), + [KnownFolder.Favorites] = new("1777F761-68AD-4D8A-87BD-30B759FA33DD"), + [KnownFolder.Links] = new("BFB9D5E0-C6A9-404C-B2B2-AE6DB6AF4968"), + [KnownFolder.SavedGames] = new("4C5C32FF-BB9D-43B0-B5B4-2D72E54EAAA4"), + [KnownFolder.SavedSearches] = new("7D1D3A04-DEBB-4115-95CF-2F29DA2920DA") + }; + + public static string GetPath(KnownFolder knownFolder) + { + return SHGetKnownFolderPath(_guids[knownFolder], 0); + } + + [DllImport("shell32", + CharSet = CharSet.Unicode, ExactSpelling = true, PreserveSig = false)] + private static extern string SHGetKnownFolderPath( + [MarshalAs(UnmanagedType.LPStruct)] Guid rfid, uint dwFlags, + nint hToken = 0); +} \ No newline at end of file diff --git a/SPTInstaller/Models/ReleaseInfo/ReleaseInfo.cs b/SPTInstaller/Models/ReleaseInfo/ReleaseInfo.cs index f252882..deacdb3 100644 --- a/SPTInstaller/Models/ReleaseInfo/ReleaseInfo.cs +++ b/SPTInstaller/Models/ReleaseInfo/ReleaseInfo.cs @@ -1,10 +1,12 @@ using System.Collections.Generic; +using Newtonsoft.Json; namespace SPTInstaller.Models.ReleaseInfo; public class ReleaseInfo { - public string AkiVersion { get; set; } // TODO: Change this and what gets uploaded to SPTVersion + [JsonProperty("AkiVersion")] // TODO: Change this and what gets uploaded to SPTVersion + public string SPTVersion { get; set; } public string ClientVersion { get; set; } public List Mirrors { get; set; } } \ No newline at end of file diff --git a/SPTInstaller/SPTInstaller.csproj b/SPTInstaller/SPTInstaller.csproj index 4b97e46..6448645 100644 --- a/SPTInstaller/SPTInstaller.csproj +++ b/SPTInstaller/SPTInstaller.csproj @@ -8,17 +8,17 @@ app.manifest icon.ico - Assets\icon.ico + Assets\spt_installer.ico Debug;Release;TEST - 2.66 - 2.66 + 2.67 + 2.67 SPT - + diff --git a/SPTInstaller/Views/MainWindow.axaml b/SPTInstaller/Views/MainWindow.axaml index 922e1af..170d3d0 100644 --- a/SPTInstaller/Views/MainWindow.axaml +++ b/SPTInstaller/Views/MainWindow.axaml @@ -8,7 +8,7 @@ xmlns:dialogHost="clr-namespace:DialogHostAvalonia;assembly=DialogHost.Avalonia" mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450" x:Class="SPTInstaller.Views.MainWindow" - Icon="/Assets/icon.ico" + Icon="/Assets/spt_installer.ico" Title="SPT Installer" Height="450" Width="750" WindowStartupLocation="CenterScreen"