mirror of
https://github.com/JuniorDark/RustyHearts-Launcher.git
synced 2026-05-07 05:21:44 -04:00
Updated dependencies
Replaced deprecated DotNetZip with System.IO.Compression. Changed target framework to net 9.0. Removed DotNetZip package reference. Updated Microsoft.Web.WebView2 to 1.0.2903.40. Updated WindowsAPICodePack to 8.0.6.
This commit is contained in:
parent
3648b49bb3
commit
7849b2001a
8 changed files with 91 additions and 80 deletions
17
.github/workflows/build.yml
vendored
17
.github/workflows/build.yml
vendored
|
|
@ -6,19 +6,24 @@ on:
|
|||
jobs:
|
||||
build:
|
||||
runs-on: windows-latest
|
||||
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Setup .NET
|
||||
uses: actions/setup-dotnet@v4
|
||||
with:
|
||||
dotnet-version: '7.0.x'
|
||||
- name: Build
|
||||
run: dotnet publish --configuration Release --self-contained false --runtime win-x64 /p:PublishSingleFile=true
|
||||
- name: Zip output file
|
||||
run: Compress-Archive -Path ./bin/Release/net7.0-windows7.0/win-x64/publish/Launcher.exe -DestinationPath Launcher.zip
|
||||
dotnet-version: '9.0.x'
|
||||
|
||||
# Build with --self-contained false
|
||||
- name: Build Rusty Hearts Launcher (No Self-Contained)
|
||||
run: dotnet publish ./RHLauncher.sln --configuration Release --self-contained false --runtime win-x64 /p:PublishSingleFile=true /p:PublishDir=./publish/RustyHearts-Launcher_framework-dependent
|
||||
|
||||
- name: Zip output files (No Self-Contained)
|
||||
run: Compress-Archive -Path "./publish/RustyHearts-Launcher_framework-dependent" -DestinationPath RustyHearts-Launcher.zip
|
||||
- name: Upload Artifact
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: Launcher
|
||||
path: Launcher.zip
|
||||
path: RustyHearts-Launcher.zip
|
||||
|
|
|
|||
58
.github/workflows/release.yml
vendored
58
.github/workflows/release.yml
vendored
|
|
@ -3,42 +3,50 @@ on:
|
|||
workflow_dispatch:
|
||||
release:
|
||||
types: [created]
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: windows-latest
|
||||
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Setup .NET
|
||||
uses: actions/setup-dotnet@v4
|
||||
with:
|
||||
dotnet-version: '7.0.x'
|
||||
- name: Get version from .csproj file
|
||||
id: version
|
||||
dotnet-version: '9.0.x'
|
||||
|
||||
# Build with --self-contained false
|
||||
- name: Build Rusty Hearts Launcher (No Self-Contained)
|
||||
run: dotnet publish ./RHLauncher.sln --configuration Release --self-contained false --runtime win-x64 /p:PublishSingleFile=true /p:PublishDir=./publish/RustyHearts-Launcher_framework-dependent
|
||||
|
||||
- name: Zip output files (No Self-Contained)
|
||||
run: Compress-Archive -Path "./publish/RustyHearts-Launcher_framework-dependent" -DestinationPath RustyHearts-Launcher-Framework-Dependent.zip
|
||||
|
||||
# Build with --self-contained true
|
||||
- name: Build Rusty Hearts Launcher (Self-Contained)
|
||||
run: dotnet publish ./RHLauncher.sln --configuration Release --self-contained true --runtime win-x64 /p:PublishSingleFile=false /p:PublishDir=./publish/RustyHearts-Launcher_self-contained
|
||||
|
||||
- name: Zip output files (Self-Contained)
|
||||
run: Compress-Archive -Path "./publish/RustyHearts-Launcher_self-contained" -DestinationPath RustyHearts-Launcher-SelfContained.zip
|
||||
|
||||
- name: Get version from compiled assembly
|
||||
id: version
|
||||
run: |
|
||||
echo "::set-output name=version::$(grep -m1 -o '<FileVersion>[^<]*' RHLauncher.csproj | sed 's/<FileVersion>//')"
|
||||
- name: Build
|
||||
run: dotnet publish --configuration Release --self-contained false --runtime win-x64 /p:PublishSingleFile=true
|
||||
- name: Zip output file
|
||||
run: Compress-Archive -Path ./bin/Release/net7.0-windows7.0/win-x64/publish/Launcher.exe -DestinationPath Launcher.zip
|
||||
- name: Create Release
|
||||
id: create_release
|
||||
uses: actions/create-release@v1
|
||||
$version = (Get-Command "./publish/RustyHearts-Launcher_framework-dependent/Launcher.dll").FileVersionInfo.FileVersion
|
||||
echo "::set-output name=version::$version"
|
||||
|
||||
# Create Release and Upload Assets using softprops/action-gh-release
|
||||
- name: Create GitHub Release and Upload Assets
|
||||
uses: softprops/action-gh-release@v2
|
||||
with:
|
||||
tag_name: ${{ steps.version.outputs.version }}
|
||||
release_name: v${{ steps.version.outputs.version }}
|
||||
body: Automated release created by GitHub Actions.
|
||||
draft: false
|
||||
prerelease: false
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
- name: Upload Release Asset
|
||||
uses: actions/upload-release-asset@v1
|
||||
with:
|
||||
upload_url: ${{ steps.create_release.outputs.upload_url }}
|
||||
asset_path: ./Launcher.zip
|
||||
asset_name: Launcher.zip
|
||||
asset_content_type: application/zip
|
||||
tag_name: v${{ steps.version.outputs.version }}
|
||||
body: Automated pre-release created by GitHub Actions.
|
||||
draft: true
|
||||
prerelease: true
|
||||
files: |
|
||||
./RustyHearts-Launcher-Framework-Dependent.zip
|
||||
./RustyHearts-Launcher-SelfContained.zip
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
51
README.md
51
README.md
|
|
@ -23,10 +23,8 @@ Rusty Hearts Launcher is a custom launcher for the Rusty Hearts game client. It
|
|||
* [Prerequisites for Building Locally/Development](#prerequisites-for-building-locallydevelopment)
|
||||
* [System Requirements for Ready-to-use build](#system-requirements-for-ready-to-use-build)
|
||||
* [License](#license)
|
||||
* [Contributing](#contributing)
|
||||
* [FAQ](#faq)
|
||||
* [Building](#building)
|
||||
* [Credits](#credits)
|
||||
* [Support](#support)
|
||||
|
||||
## Features
|
||||
* Game Download: The launcher can download and install the client.
|
||||
|
|
@ -73,36 +71,37 @@ If you want to add a new language create a LocalizedStrings.<language>.resx with
|
|||
|
||||
If you want to change the text on the buttons/images used in the launcher you can use the Photoshop .psd files included in the PSD Resources.rar
|
||||
|
||||
## Prerequisites for Building Locally/Development
|
||||
The launcher is built in .NET 7 and as such, the packages listed below are required to create a local and development build of the launcher. Furthermore, it uses many submodules and packages outside of this, which will automatically be loaded when the user sets up a local environment of the application.
|
||||
* Visual Studio 2022 (Any Edition - 17.4 or later)
|
||||
* Windows 10 SDK (10.0.19043.0) or Windows 11 SDK (10.0.22000.0) via Visual Studio Installer
|
||||
* .NET: [.NET Core 7 SDK (7.0.100 or later)](https://dotnet.microsoft.com/en-us/download/dotnet/7.0)
|
||||
## Prerequisites for Development
|
||||
* Visual Studio 2022 (Any Edition - 17.12 or later)
|
||||
* Windows 10 SDK or Windows 11 SDK via Visual Studio Installer
|
||||
* .NET Core 9 SDK (9.0.100 or later)
|
||||
|
||||
## System Requirements for Ready-to-use build
|
||||
* OS: Windows 10 1809 Update (build 17763) or later / Windows 11 (Any builds)
|
||||
* Architecture: x64/AMD64
|
||||
## Building
|
||||
|
||||
If you wish to build the project yourself, follow these steps:
|
||||
|
||||
### Step 1
|
||||
|
||||
Install the [.NET 9.0 (or higher) SDK](https://dotnet.microsoft.com/download/dotnet/9.0).
|
||||
Make sure your SDK version is higher or equal to the required version specified.
|
||||
|
||||
### Step 2
|
||||
|
||||
Either use `git clone https://github.com/JuniorDark/RustyHearts-Launcher` on the command line to clone the repository or use Code --> Download zip button to get the files.
|
||||
|
||||
### Step 3
|
||||
|
||||
To build Rusty Hearts Launcher, open a command prompt inside the project directory.
|
||||
You can quickly access it on Windows by holding shift in File Explorer, then right clicking and selecting `Open command window here`.
|
||||
Then type the following command: `dotnet build -c Release`.
|
||||
|
||||
The built files will be found in the newly created `bin` build directory.
|
||||
|
||||
## License
|
||||
This project is licensed under the terms found in [`LICENSE-0BSD`](LICENSE).
|
||||
|
||||
## Contributing
|
||||
Contributions from the community are welcome! If you encounter a bug or have a feature request, please submit an issue on GitHub. If you would like to contribute code, please fork the repository and submit a pull request.
|
||||
|
||||
## FAQ
|
||||
* Q: How do I report a bug?
|
||||
* A: Please submit an issue on GitHub with a detailed description of the bug and steps to reproduce it.
|
||||
* Q: How do I request a new feature?
|
||||
* A: Please submit an issue on GitHub with a detailed description of the feature and why it would be useful.
|
||||
* Q: How do I contribute code?
|
||||
* A: Please fork the repository, make your changes, and submit a pull request.
|
||||
|
||||
## Credits
|
||||
The following third-party libraries, tools, and resources are used in this project:
|
||||
* [DotNetZip](https://www.nuget.org/packages/DotNetZip)
|
||||
* [Microsoft.Web.WebView2](https://www.nuget.org/packages/Microsoft.Web.WebView2)
|
||||
* [Newtonsoft.Json](https://www.nuget.org/packages/Newtonsoft.Json)
|
||||
* [WindowsAPICodePack](https://www.nuget.org/packages/WindowsAPICodePack)
|
||||
|
||||
## Support
|
||||
If you need help with the launcher, please submit an issue on GitHub.
|
||||
|
|
|
|||
|
|
@ -81,7 +81,7 @@ namespace RHLauncher
|
|||
{
|
||||
if (languageChanged)
|
||||
{
|
||||
string? selectedLanguage = cbLauncherLanguage.SelectedItem.ToString();
|
||||
string? selectedLanguage = cbLauncherLanguage.SelectedItem?.ToString();
|
||||
string languageCode = GetLanguageCode(selectedLanguage);
|
||||
|
||||
if (languageCode != null)
|
||||
|
|
|
|||
|
|
@ -1,9 +1,11 @@
|
|||
using RHLauncher.RHLauncher.i8n;
|
||||
using System.ComponentModel;
|
||||
|
||||
namespace RHLauncher
|
||||
{
|
||||
public partial class MsgBoxForm : Form
|
||||
{
|
||||
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
|
||||
public new DialogResult DialogResult { get; private set; }
|
||||
|
||||
public MsgBoxForm()
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
using Ionic.Zip;
|
||||
using System.IO.Compression;
|
||||
using RHLauncher.RHLauncher.Helper;
|
||||
using RHLauncher.RHLauncher.i8n;
|
||||
using System.Diagnostics;
|
||||
|
|
@ -51,10 +51,10 @@ namespace RHLauncher.RHLauncher.Http
|
|||
Directory.CreateDirectory(downloadDir);
|
||||
}
|
||||
|
||||
List<string> filesToBeDownloaded = new();
|
||||
List<string> filesToBeDownloaded = [];
|
||||
long totalBytesToDownload = 0L;
|
||||
|
||||
List<string> lines = filelistText.Split(new[] { '\r', '\n' }, StringSplitOptions.RemoveEmptyEntries).ToList();
|
||||
List<string> lines = [.. filelistText.Split(['\r', '\n'], StringSplitOptions.RemoveEmptyEntries)];
|
||||
int totalLines = lines.Count;
|
||||
int checkedFiles = 0;
|
||||
|
||||
|
|
@ -146,14 +146,14 @@ namespace RHLauncher.RHLauncher.Http
|
|||
|
||||
private static async Task<string> UnzipFilesAsync(string sourceDirectory, string destinationDirectory, IProgress<ProgressReport> progress, CancellationToken cancellationToken)
|
||||
{
|
||||
string[] fileEntries = Directory.GetFiles(sourceDirectory, "*.zip.*").OrderBy(f => f).ToArray();
|
||||
string[] fileEntries = [.. Directory.GetFiles(sourceDirectory, "*.zip.*").OrderBy(f => f)];
|
||||
string rhExeDirectoryPath = "";
|
||||
|
||||
// Calculate total uncompressed size of all files in all zip archives
|
||||
long totalUncompressedSize = fileEntries.Sum(file =>
|
||||
{
|
||||
using ZipFile zip = ZipFile.Read(file);
|
||||
return zip.Entries.Sum(entry => entry.UncompressedSize);
|
||||
using ZipArchive zip = ZipFile.OpenRead(file);
|
||||
return zip.Entries.Sum(entry => entry.Length);
|
||||
});
|
||||
long totalExtracted = 0;
|
||||
|
||||
|
|
@ -163,26 +163,26 @@ namespace RHLauncher.RHLauncher.Http
|
|||
{
|
||||
await Task.Run(() =>
|
||||
{
|
||||
using ZipFile zip = ZipFile.Read(file);
|
||||
foreach (var entry in zip)
|
||||
using ZipArchive zip = ZipFile.OpenRead(file);
|
||||
foreach (var entry in zip.Entries)
|
||||
{
|
||||
cancellationToken.ThrowIfCancellationRequested();
|
||||
|
||||
string destinationPath = Path.Combine(destinationDirectory, entry.FileName);
|
||||
string destinationPath = Path.Combine(destinationDirectory, entry.FullName);
|
||||
string? directoryPath = Path.GetDirectoryName(destinationPath);
|
||||
if (!string.IsNullOrEmpty(directoryPath) && !Directory.Exists(directoryPath))
|
||||
{
|
||||
Directory.CreateDirectory(directoryPath);
|
||||
}
|
||||
|
||||
entry.Extract(destinationDirectory, ExtractExistingFileAction.OverwriteSilently);
|
||||
totalExtracted += entry.UncompressedSize;
|
||||
entry.ExtractToFile(destinationPath, true);
|
||||
totalExtracted += entry.Length;
|
||||
cancellationToken.ThrowIfCancellationRequested();
|
||||
|
||||
ProgressReporter.ReportUnzipProgress(progress, totalExtracted, totalUncompressedSize, cancellationToken);
|
||||
|
||||
// Check if the current entry is "rustyhearts.exe" and store its directory path
|
||||
if (entry.FileName.EndsWith("rustyhearts.exe", StringComparison.OrdinalIgnoreCase))
|
||||
if (entry.FullName.EndsWith("rustyhearts.exe", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
rhExeDirectoryPath = Path.GetDirectoryName(destinationPath) ?? "";
|
||||
}
|
||||
|
|
@ -217,7 +217,5 @@ namespace RHLauncher.RHLauncher.Http
|
|||
throw new FileNotFoundException($"{LocalizedStrings.ClientFolderExeErrorMessage}");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
using Ionic.Zlib;
|
||||
using System.IO.Compression;
|
||||
using RHLauncher.RHLauncher.Helper;
|
||||
using System.Text;
|
||||
|
||||
|
|
@ -35,7 +35,7 @@ namespace RHLauncher.RHLauncher.PCK
|
|||
try
|
||||
{
|
||||
using MemoryStream compressedStream = new(compressedBytes);
|
||||
using ZlibStream deflateStream = new(compressedStream, CompressionMode.Decompress);
|
||||
using ZLibStream deflateStream = new(compressedStream, CompressionMode.Decompress);
|
||||
using MemoryStream decompressedStream = new();
|
||||
deflateStream.CopyTo(decompressedStream);
|
||||
decompressedStream.Seek(0, SeekOrigin.Begin);
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@
|
|||
|
||||
<PropertyGroup>
|
||||
<OutputType>WinExe</OutputType>
|
||||
<TargetFramework>net7.0-windows7.0</TargetFramework>
|
||||
<TargetFramework>net9.0-windows</TargetFramework>
|
||||
<SatelliteResourceLanguages>en</SatelliteResourceLanguages>
|
||||
<Nullable>enable</Nullable>
|
||||
<UseWindowsForms>true</UseWindowsForms>
|
||||
|
|
@ -19,8 +19,8 @@
|
|||
<AssemblyName>Launcher</AssemblyName>
|
||||
<Description>Rusty Hearts Launcher</Description>
|
||||
<PlatformTarget>x64</PlatformTarget>
|
||||
<AssemblyVersion>1.2.0</AssemblyVersion>
|
||||
<FileVersion>1.2.0</FileVersion>
|
||||
<AssemblyVersion>1.3.0</AssemblyVersion>
|
||||
<FileVersion>1.3.0</FileVersion>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
|
||||
|
|
@ -36,10 +36,9 @@
|
|||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="DotNetZip" Version="1.16.0" />
|
||||
<PackageReference Include="Microsoft.Web.WebView2" Version="1.0.2535.41" />
|
||||
<PackageReference Include="Microsoft.Web.WebView2" Version="1.0.2903.40" />
|
||||
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
|
||||
<PackageReference Include="WindowsAPICodePack" Version="8.0.4" />
|
||||
<PackageReference Include="WindowsAPICodePack" Version="8.0.6" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue