Skip to content

Commit

Permalink
Initial app version
Browse files Browse the repository at this point in the history
  • Loading branch information
Drommedhar committed Sep 24, 2024
1 parent ff9e0ed commit e12a310
Show file tree
Hide file tree
Showing 76 changed files with 3,675 additions and 1 deletion.
15 changes: 15 additions & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# These are supported funding model platforms

github: # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2]
patreon: DlssUpdater
open_collective: # Replace with a single Open Collective username
ko_fi: # Replace with a single Ko-fi username
tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
liberapay: # Replace with a single Liberapay username
issuehunt: # Replace with a single IssueHunt username
lfx_crowdfunding: # Replace with a single LFX Crowdfunding project-name e.g., cloud-foundry
polar: # Replace with a single Polar username
buy_me_a_coffee: dlssupdater
thanks_dev: # Replace with a single thanks.dev username
custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2']
30 changes: 30 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
---
name: Bug report
about: Create a report to help us improve
title: ''
labels: bug
assignees: ''

---

**Describe the bug**
A clear and concise description of what the bug is.

**To Reproduce**
Steps to reproduce the behavior:
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error

**Expected behavior**
A clear and concise description of what you expected to happen.

**Screenshots**
If applicable, add screenshots to help explain your problem.

**Desktop (please complete the following information):**
- DlssUpdater version: Version [e.g. 0.1]

**Additional context**
Add any other context about the problem here.
20 changes: 20 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
name: Feature request
about: Suggest an idea for this project
title: ''
labels: feature
assignees: ''

---

**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

**Describe the solution you'd like**
A clear and concise description of what you want to happen.

**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.

**Additional context**
Add any other context or screenshots about the feature request here.
91 changes: 91 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
name: .NET Core Desktop

on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]

jobs:

build:

strategy:
matrix:
targetplatform: [x64]

runs-on: windows-latest # For a list of available runner types, refer to
# https://help.github.com/en/actions/reference/workflow-syntax-for-github-actions#jobsjob_idruns-on
permissions:
contents: "write"
packages: "write"
pull-requests: "read"

env:
Solution_Name: DLSSUpdater.sln # Replace with your solution name, i.e. MyWpfApp.sln.

steps:

- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0

# Install the .NET Core workload
- name: Install .NET Core
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.0.x

- name: Create the package
run: dotnet publish --configuration Release ${Solution_Name} --self-contained -p:PublishSingleFile=True -p:PublishReadyToRun=True --output bin\fire\out

- name: Zip Release
uses: vimtor/[email protected]
with:
files: bin\fire\out
recursive: true
dest: dlssupdater.zip

- name: Get version of the project
id: project-version
uses: 'euberdeveloper/ga-project-version@main'
with:
path: DlssUpdater\version.json

- name: Create Draft Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: v${{ steps.project-version.outputs.version }}
release_name: v${{ steps.project-version.outputs.version }}
draft: false
prerelease: false

- uses: actions/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./dlssupdater.zip
asset_name: dlssupdater.zip
asset_content_type: application/zip

- uses: actions/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./DlssUpdater/version.json
asset_name: version.json
asset_content_type: application/json

- uses: eregon/publish-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
release_id: ${{ steps.create_release.outputs.id }}


6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
.vs
bin
obj
DlssUpdater.csproj.user
.idea
act.exe
37 changes: 37 additions & 0 deletions DLSSUpdater.sln
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.9.34607.119
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DLSSUpdater", "DlssUpdater\DLSSUpdater.csproj", "{891674A2-74FE-4E71-A18E-859680E25E98}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Debug|x64 = Debug|x64
Debug|x86 = Debug|x86
Release|Any CPU = Release|Any CPU
Release|x64 = Release|x64
Release|x86 = Release|x86
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{891674A2-74FE-4E71-A18E-859680E25E98}.Debug|Any CPU.ActiveCfg = Debug|x64
{891674A2-74FE-4E71-A18E-859680E25E98}.Debug|Any CPU.Build.0 = Debug|x64
{891674A2-74FE-4E71-A18E-859680E25E98}.Debug|x64.ActiveCfg = Debug|x64
{891674A2-74FE-4E71-A18E-859680E25E98}.Debug|x64.Build.0 = Debug|x64
{891674A2-74FE-4E71-A18E-859680E25E98}.Debug|x86.ActiveCfg = Debug|x86
{891674A2-74FE-4E71-A18E-859680E25E98}.Debug|x86.Build.0 = Debug|x86
{891674A2-74FE-4E71-A18E-859680E25E98}.Release|Any CPU.ActiveCfg = Release|x64
{891674A2-74FE-4E71-A18E-859680E25E98}.Release|Any CPU.Build.0 = Release|x64
{891674A2-74FE-4E71-A18E-859680E25E98}.Release|x64.ActiveCfg = Release|x64
{891674A2-74FE-4E71-A18E-859680E25E98}.Release|x64.Build.0 = Release|x64
{891674A2-74FE-4E71-A18E-859680E25E98}.Release|x86.ActiveCfg = Release|x86
{891674A2-74FE-4E71-A18E-859680E25E98}.Release|x86.Build.0 = Release|x86
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {733C89D2-0184-4715-B6A6-846CE34E1685}
EndGlobalSection
EndGlobal
17 changes: 17 additions & 0 deletions DlssUpdater/App.xaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<Application
x:Class="DlssUpdater.App"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:ui="http://schemas.lepo.co/wpfui/2022/xaml"
DispatcherUnhandledException="OnDispatcherUnhandledException"
Exit="OnExit"
Startup="OnStartup">
<Application.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ui:ThemesDictionary Theme="Light" />
<ui:ControlsDictionary />
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
</Application.Resources>
</Application>
113 changes: 113 additions & 0 deletions DlssUpdater/App.xaml.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,113 @@
using System.IO;
using System.Reflection;
using System.Windows.Threading;
using DlssUpdater.Services;
using DlssUpdater.Singletons;
using DlssUpdater.Singletons.AntiCheatChecker;
using DlssUpdater.ViewModels.Pages;
using DlssUpdater.ViewModels.Windows;
using DlssUpdater.Views.Pages;
using DlssUpdater.Views.Windows;
using DlssUpdater.Windows.Splashscreen;
using DLSSUpdater.Singletons;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;
using Wpf.Ui;
using WpfBindingErrors;

namespace DlssUpdater;

/// <summary>
/// Interaction logic for App.xaml
/// </summary>
public partial class App
{
// The.NET Generic Host provides dependency injection, configuration, logging, and other services.
// https://docs.microsoft.com/dotnet/core/extensions/generic-host
// https://docs.microsoft.com/dotnet/core/extensions/dependency-injection
// https://docs.microsoft.com/dotnet/core/extensions/configuration
// https://docs.microsoft.com/dotnet/core/extensions/logging
private static readonly IHost _host = Host
.CreateDefaultBuilder()
.ConfigureAppConfiguration(
c => { c.SetBasePath(Path.GetDirectoryName(AppContext.BaseDirectory)!); })
.ConfigureServices((context, services) =>
{
services.AddHostedService<ApplicationHostService>();

// Page resolver service
services.AddSingleton<IPageService, PageService>();

// Theme manipulation
services.AddSingleton<IThemeService, ThemeService>();

// TaskBar manipulation
services.AddSingleton<ITaskBarService, TaskBarService>();


// Service containing navigation, same as INavigationWindow... but without window
services.AddSingleton<INavigationService, NavigationService>();

// Main window with navigation
services.AddSingleton<MainWindowViewModel>();
services.AddSingleton<MainWindow>();
services.AddSingleton<Splashscreen>();
services.AddSingleton<GamesPage>();
services.AddSingleton<GamesViewModel>();
services.AddSingleton<DLSSPage>();
services.AddSingleton<DLSSViewModel>();
services.AddSingleton<SettingsPage>();
services.AddSingleton<SettingsViewModel>();

services.AddSingleton<Settings>();
services.AddSingleton<DllUpdater>();
services.AddSingleton<GameContainer>();
services.AddSingleton<AntiCheatChecker>();
services.AddSingleton<VersionUpdater>();

services.AddSingleton<ISnackbarService, SnackbarService>();
}).Build();

/// <summary>
/// Gets registered service.
/// </summary>
/// <typeparam name="T">Type of the service to get.</typeparam>
/// <returns>Instance of the service or <see langword="null" />.</returns>
public static T GetService<T>()
where T : class
{
return _host.Services.GetService(typeof(T)) as T;

Check warning on line 80 in DlssUpdater/App.xaml.cs

View workflow job for this annotation

GitHub Actions / build (x64)

Possible null reference return.
}

/// <summary>
/// Occurs when the application is loading.
/// </summary>
private void OnStartup(object sender, StartupEventArgs e)
{
_host.Start();

// Start listening for WPF binding error.
// After that line, a BindingException will be thrown each time
// a binding error occurs.
BindingExceptionThrower.Attach();
}

/// <summary>
/// Occurs when the application is closing.
/// </summary>
private async void OnExit(object sender, ExitEventArgs e)
{
await _host.StopAsync();

_host.Dispose();
}

/// <summary>
/// Occurs when an exception is thrown by an application but not handled.
/// </summary>
private void OnDispatcherUnhandledException(object sender, DispatcherUnhandledExceptionEventArgs e)
{
// For more info see https://docs.microsoft.com/en-us/dotnet/api/system.windows.application.dispatcherunhandledexception?view=windowsdesktop-6.0
}
}
8 changes: 8 additions & 0 deletions DlssUpdater/AssemblyInfo.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
[assembly: ThemeInfo(
ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located
//(used if a resource is not found in the page,
// or application resource dictionaries)
ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located
//(used if a resource is not found in the page,
// app, or any theme specific resource dictionaries)
)]
Binary file added DlssUpdater/Assets/wpfui-icon-1024.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added DlssUpdater/Assets/wpfui-icon-256.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
22 changes: 22 additions & 0 deletions DlssUpdater/Controls/DownloadButton.xaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<UserControl x:Class="DlssUpdater.Controls.DownloadButton"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:ui="http://schemas.lepo.co/wpfui/2022/xaml"
x:Name="downloadButton"
Loaded="downloadButton_Loaded">
<Grid
Width="{Binding ActualWidth,
RelativeSource = {RelativeSource AncestorType = {x:Type UserControl}}}"
Height="{Binding ActualHeight,
RelativeSource ={RelativeSource AncestorType = {x:Type UserControl}}}"
Background="{DynamicResource ApplicationBackgroundBrush}">
<ProgressBar x:Name="prgDownload" Grid.Row="2" VerticalAlignment="Bottom"
Height="{Binding ActualHeight, ElementName=downloadButton}" Foreground="Black" />
<ui:TextBlock Grid.Column="0" Grid.Row="1" Text="{Binding VersionText, ElementName=downloadButton}"
Foreground="{DynamicResource TextFillColorPrimaryBrush}" VerticalAlignment="Center"
HorizontalAlignment="Left" Margin="5,0,0,0" />
<ui:Button x:Name="btnAction" Grid.Column="1" Grid.Row="1" HorizontalAlignment="Right"
VerticalAlignment="Center" Icon="{Binding ButtonIcon, ElementName=downloadButton}" Height="50"
Width="50" Margin="0,0,25,0" Click="Button_Click" />
</Grid>
</UserControl>
Loading

0 comments on commit e12a310

Please sign in to comment.