diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 1616923..d458f0a 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -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 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index d1b6036..e27a54a 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -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 '[^<]*' RHLauncher.csproj | sed 's///')" - - 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_self-contained/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 }} \ No newline at end of file diff --git a/README.md b/README.md index 6337c1f..91e76ed 100644 --- a/README.md +++ b/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. @@ -44,8 +42,9 @@ In order for the launcher to work it need to be conected to the api. To change t The default URL for the api can be changed on IniFile.cs ### Client region -The client region can be set on Service on Config.ini +The client region can be set on Config.ini or in the Config menu +* **Jpn** (SEGA) - Full api support * **usa** (PWE) - Full api support * **chn** (Xunlei) - Only launcher support @@ -73,36 +72,37 @@ If you want to add a new language create a LocalizedStrings..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. diff --git a/RHLauncher.Forms/ChangePwdForm.cs b/RHLauncher.Forms/ChangePwdForm.cs index 901afe3..173ec41 100644 --- a/RHLauncher.Forms/ChangePwdForm.cs +++ b/RHLauncher.Forms/ChangePwdForm.cs @@ -1,4 +1,5 @@ -using RHLauncher.RHLauncher.Helper; +using Newtonsoft.Json; +using RHLauncher.RHLauncher.Helper; using RHLauncher.RHLauncher.i8n; using System.Text.RegularExpressions; @@ -8,10 +9,10 @@ namespace RHLauncher { private RegistryHandler registryHandler = new(); - public string SendPasswordCodeUrl = Configuration.Default.SendPasswordCodeUrl; - public string VerifyCodeUrl = Configuration.Default.VerifyCodeUrl; - public string ChangePasswordUrl = Configuration.Default.ChangePasswordUrl; - public string Lang = Configuration.Default.Lang; + private readonly string SendPasswordCodeUrl = Configuration.Default.SendPasswordCodeUrl; + private readonly string VerifyCodeUrl = Configuration.Default.VerifyCodeUrl; + private readonly string ChangePasswordUrl = Configuration.Default.ChangePasswordUrl; + private readonly string Lang = Configuration.Default.Lang; private List