Skip to content

Commit

Permalink
Elden ring compatibility and major refactoring, built install 1.0.25
Browse files Browse the repository at this point in the history
  • Loading branch information
ScottyDoesKnow committed Jul 16, 2024
1 parent 5a2dcee commit 9a6fd29
Show file tree
Hide file tree
Showing 25 changed files with 576 additions and 519 deletions.
6 changes: 3 additions & 3 deletions DS3Backup/App.config
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8" ?>
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" />
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.8"/>
</startup>
</configuration>
</configuration>
2 changes: 1 addition & 1 deletion DS3Backup/App.xaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<Application x:Class="DSBackup.App"
<Application x:Class="Net.ScottyDoesKnow.DsBackup.App"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<Application.Resources>
Expand Down
13 changes: 7 additions & 6 deletions DS3Backup/App.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,15 @@
using System.Linq;
using System.Threading.Tasks;
using System.Windows;
using Net.ScottyDoesKnow.DsBackup.ViewModels;
using Net.ScottyDoesKnow.DsBackup.Views;

namespace DSBackup
namespace Net.ScottyDoesKnow.DsBackup
{
/// <summary>
/// Interaction logic for App.xaml
/// </summary>
public partial class App : Application
{
public const string ApplicationName = "Dark Souls Save Backup Tool";

protected override void OnStartup(StartupEventArgs e)
{
try
Expand All @@ -24,8 +25,8 @@ protected override void OnStartup(StartupEventArgs e)
}
catch (Exception ex)
{
MessageBox.Show(ex.Message + Environment.NewLine + Environment.NewLine + ex.StackTrace, "Error", MessageBoxButton.OK, MessageBoxImage.Error);
Current.Shutdown(); // Why is this needed??
MessageBox.Show($"{ex.Message}{Environment.NewLine}{Environment.NewLine}{ex.StackTrace}", ApplicationName, MessageBoxButton.OK, MessageBoxImage.Error);
Current.Shutdown();
}
}
}
Expand Down
32 changes: 0 additions & 32 deletions DS3Backup/BindingProxy.cs

This file was deleted.

38 changes: 24 additions & 14 deletions DS3Backup/DSBackup.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,13 @@
<ProjectGuid>{47BB7F23-CF26-4CDF-BD93-A997234189F3}</ProjectGuid>
<OutputType>WinExe</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>DSBackup</RootNamespace>
<RootNamespace>Net.ScottyDoesKnow.DsBackup</RootNamespace>
<AssemblyName>DSBackup</AssemblyName>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<ProjectTypeGuids>{60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<WarningLevel>4</WarningLevel>
<TargetFrameworkProfile />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
Expand All @@ -34,17 +35,20 @@
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup>
<ApplicationIcon>DarkSouls.ico</ApplicationIcon>
<ApplicationIcon>EldenRing.ico</ApplicationIcon>
</PropertyGroup>
<ItemGroup>
<Reference Include="Hardcodet.Wpf.TaskbarNotification">
<HintPath>..\packages\Hardcodet.NotifyIcon.Wpf.1.0.8\lib\net45\Hardcodet.Wpf.TaskbarNotification.dll</HintPath>
<Reference Include="Hardcodet.NotifyIcon.Wpf, Version=1.1.0.0, Culture=neutral, PublicKeyToken=682384a853a08aad, processorArchitecture=MSIL">
<HintPath>..\packages\Hardcodet.NotifyIcon.Wpf.1.1.0\lib\net472\Hardcodet.NotifyIcon.Wpf.dll</HintPath>
</Reference>
<Reference Include="Ookii.Dialogs.Wpf">
<HintPath>..\packages\Ookii.Dialogs.1.0\lib\net35\Ookii.Dialogs.Wpf.dll</HintPath>
<Reference Include="Ookii.Dialogs.Wpf, Version=5.0.0.0, Culture=neutral, PublicKeyToken=66aa232afad40158, processorArchitecture=MSIL">
<HintPath>..\packages\Ookii.Dialogs.Wpf.5.0.1\lib\net462\Ookii.Dialogs.Wpf.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Data" />
<Reference Include="System.Design" />
<Reference Include="System.Drawing" />
<Reference Include="System.Security" />
<Reference Include="System.Xml" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Core" />
Expand All @@ -62,25 +66,27 @@
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</ApplicationDefinition>
<Compile Include="BackupLocation.cs" />
<Compile Include="BindingProxy.cs" />
<Compile Include="ViewModel.cs" />
<Compile Include="XmlHelper.cs" />
<Page Include="MainWindow.xaml">
<Compile Include="Helpers\FileHelper.cs" />
<Compile Include="ViewModels\BackupLocation.cs" />
<Compile Include="Views\BindingProxy.cs" />
<Compile Include="ViewModels\ViewModel.cs" />
<Compile Include="Helpers\XmlHelper.cs" />
<Compile Include="Views\MainWindowViewModelBindingProxy.cs" />
<Page Include="Views\MainWindow.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Compile Include="App.xaml.cs">
<DependentUpon>App.xaml</DependentUpon>
<SubType>Code</SubType>
</Compile>
<Compile Include="MainWindow.xaml.cs">
<Compile Include="Views\MainWindow.xaml.cs">
<DependentUpon>MainWindow.xaml</DependentUpon>
<SubType>Code</SubType>
</Compile>
</ItemGroup>
<ItemGroup>
<Compile Include="MainWindowViewModel.cs" />
<Compile Include="ViewModels\MainWindowViewModel.cs" />
<Compile Include="Properties\AssemblyInfo.cs">
<SubType>Code</SubType>
</Compile>
Expand Down Expand Up @@ -114,6 +120,10 @@
<ItemGroup>
<Resource Include="DarkSouls.ico" />
</ItemGroup>
<ItemGroup>
<Resource Include="EldenRing.ico" />
</ItemGroup>
<ItemGroup />
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Import Project="$(ProjectDir)\Microsoft.VersionNumber.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Expand Down
Binary file added DS3Backup/EldenRing.ico
Binary file not shown.
35 changes: 35 additions & 0 deletions DS3Backup/Helpers/FileHelper.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Net.ScottyDoesKnow.DsBackup.Helpers
{
internal static class FileHelper
{
// https://msdn.microsoft.com/en-us/library/bb762914(v=vs.110).aspx
public static void CopyDirectory(string sourceDir, string destinationDir, bool recursive)
{
var dir = new DirectoryInfo(sourceDir);
if (!dir.Exists)
throw new DirectoryNotFoundException($"Source directory not found: {dir.FullName}");

Directory.CreateDirectory(destinationDir);

foreach (var file in dir.GetFiles())
file.CopyTo(Path.Combine(destinationDir, file.Name));

if (!recursive)
return;

var subDirs = dir.GetDirectories();
foreach (var subDir in subDirs)
{
var newDestinationDir = Path.Combine(destinationDir, subDir.Name);
CopyDirectory(subDir.FullName, newDestinationDir, true);
}
}
}
}
16 changes: 8 additions & 8 deletions DS3Backup/XmlHelper.cs → DS3Backup/Helpers/XmlHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,24 +6,24 @@
using System.Threading.Tasks;
using System.Xml.Serialization;

namespace DSBackup
namespace Net.ScottyDoesKnow.DsBackup.Helpers
{
public static class XmlHelper
internal static class XmlHelper
{
public static T FromXML<T>(string xml)
public static T FromXml<T>(string xml)
{
using (StringReader stringReader = new StringReader(xml))
using (var stringReader = new StringReader(xml))
{
XmlSerializer serializer = new XmlSerializer(typeof(T));
var serializer = new XmlSerializer(typeof(T));
return (T)serializer.Deserialize(stringReader);
}
}

public static string ToXML<T>(T obj)
public static string ToXml<T>(T obj)
{
using (StringWriter stringWriter = new StringWriter(new StringBuilder()))
using (var stringWriter = new StringWriter(new StringBuilder()))
{
XmlSerializer xmlSerializer = new XmlSerializer(typeof(T));
var xmlSerializer = new XmlSerializer(typeof(T));
xmlSerializer.Serialize(stringWriter, obj);
return stringWriter.ToString();
}
Expand Down
38 changes: 0 additions & 38 deletions DS3Backup/MainWindow.xaml

This file was deleted.

Loading

0 comments on commit 9a6fd29

Please sign in to comment.