Merge pull request 'get known downloads folder' (#87) from waffle.lord/Installer:fix/get-known-folders into master
Reviewed-on: SPT/Installer#87
This commit is contained in:
commit
67492b834f
Binary file not shown.
Before Width: | Height: | Size: 110 KiB |
BIN
SPTInstaller/Assets/spt_installer.ico
Normal file
BIN
SPTInstaller/Assets/spt_installer.ico
Normal file
Binary file not shown.
After Width: | Height: | Size: 9.2 KiB |
@ -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);
|
||||
|
||||
|
38
SPTInstaller/Models/KnownFolders.cs
Normal file
38
SPTInstaller/Models/KnownFolders.cs
Normal file
@ -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<KnownFolder, Guid> _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);
|
||||
}
|
@ -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<ReleaseInfoMirror> Mirrors { get; set; }
|
||||
}
|
@ -8,17 +8,17 @@
|
||||
<ApplicationManifest>app.manifest</ApplicationManifest>
|
||||
<!-- TODO: To change -->
|
||||
<PackageIcon>icon.ico</PackageIcon>
|
||||
<ApplicationIcon>Assets\icon.ico</ApplicationIcon>
|
||||
<ApplicationIcon>Assets\spt_installer.ico</ApplicationIcon>
|
||||
<Configurations>Debug;Release;TEST</Configurations>
|
||||
<AssemblyVersion>2.66</AssemblyVersion>
|
||||
<FileVersion>2.66</FileVersion>
|
||||
<AssemblyVersion>2.67</AssemblyVersion>
|
||||
<FileVersion>2.67</FileVersion>
|
||||
<Company>SPT</Company>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<AvaloniaResource Include="Assets\**"/>
|
||||
<None Remove=".gitignore"/>
|
||||
<None Remove="Assets\icon.ico"/>
|
||||
<None Remove="Assets\spt_installer.ico"/>
|
||||
<None Remove="Resources\update.ps1"/>
|
||||
</ItemGroup>
|
||||
|
||||
|
@ -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"
|
||||
|
Loading…
x
Reference in New Issue
Block a user