get known downloads folder
also update icon
This commit is contained in:
parent
faa581e2b4
commit
ed050ea820
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.Controls;
|
||||||
using Avalonia.Media;
|
using Avalonia.Media;
|
||||||
using Serilog;
|
using Serilog;
|
||||||
|
using SPTInstaller.Models;
|
||||||
using Color = System.Drawing.Color;
|
using Color = System.Drawing.Color;
|
||||||
|
|
||||||
namespace SPTInstaller.CustomControls.Dialogs;
|
namespace SPTInstaller.CustomControls.Dialogs;
|
||||||
@ -101,8 +102,7 @@ public partial class WhyCacheThoughDialog : UserControl
|
|||||||
switch (_movePatcherState)
|
switch (_movePatcherState)
|
||||||
{
|
{
|
||||||
case 0:
|
case 0:
|
||||||
var downloadsPath =
|
var downloadsPath = KnownFolders.GetPath(KnownFolder.Downloads);
|
||||||
Path.Join(Environment.GetFolderPath(Environment.SpecialFolder.UserProfile), "Downloads");
|
|
||||||
|
|
||||||
var downloadsFolder = new DirectoryInfo(downloadsPath);
|
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 System.Collections.Generic;
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
|
||||||
namespace SPTInstaller.Models.ReleaseInfo;
|
namespace SPTInstaller.Models.ReleaseInfo;
|
||||||
|
|
||||||
public class 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 string ClientVersion { get; set; }
|
||||||
public List<ReleaseInfoMirror> Mirrors { get; set; }
|
public List<ReleaseInfoMirror> Mirrors { get; set; }
|
||||||
}
|
}
|
@ -8,17 +8,17 @@
|
|||||||
<ApplicationManifest>app.manifest</ApplicationManifest>
|
<ApplicationManifest>app.manifest</ApplicationManifest>
|
||||||
<!-- TODO: To change -->
|
<!-- TODO: To change -->
|
||||||
<PackageIcon>icon.ico</PackageIcon>
|
<PackageIcon>icon.ico</PackageIcon>
|
||||||
<ApplicationIcon>Assets\icon.ico</ApplicationIcon>
|
<ApplicationIcon>Assets\spt_installer.ico</ApplicationIcon>
|
||||||
<Configurations>Debug;Release;TEST</Configurations>
|
<Configurations>Debug;Release;TEST</Configurations>
|
||||||
<AssemblyVersion>2.66</AssemblyVersion>
|
<AssemblyVersion>2.67</AssemblyVersion>
|
||||||
<FileVersion>2.66</FileVersion>
|
<FileVersion>2.67</FileVersion>
|
||||||
<Company>SPT</Company>
|
<Company>SPT</Company>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<AvaloniaResource Include="Assets\**"/>
|
<AvaloniaResource Include="Assets\**"/>
|
||||||
<None Remove=".gitignore"/>
|
<None Remove=".gitignore"/>
|
||||||
<None Remove="Assets\icon.ico"/>
|
<None Remove="Assets\spt_installer.ico"/>
|
||||||
<None Remove="Resources\update.ps1"/>
|
<None Remove="Resources\update.ps1"/>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
xmlns:dialogHost="clr-namespace:DialogHostAvalonia;assembly=DialogHost.Avalonia"
|
xmlns:dialogHost="clr-namespace:DialogHostAvalonia;assembly=DialogHost.Avalonia"
|
||||||
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
|
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
|
||||||
x:Class="SPTInstaller.Views.MainWindow"
|
x:Class="SPTInstaller.Views.MainWindow"
|
||||||
Icon="/Assets/icon.ico"
|
Icon="/Assets/spt_installer.ico"
|
||||||
Title="SPT Installer"
|
Title="SPT Installer"
|
||||||
Height="450" Width="750"
|
Height="450" Width="750"
|
||||||
WindowStartupLocation="CenterScreen"
|
WindowStartupLocation="CenterScreen"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user