Compare commits

..

No commits in common. "2dc472c85a13edcedda0daeb77fa372922bbc715" and "5e439ee8d5f80233d1b2753fad745a41d0681222" have entirely different histories.

10 changed files with 14 additions and 43 deletions

View File

@ -27,9 +27,9 @@ public record Config
new() { name = "Mojang", url = "https://piston-meta.mojang.com/mc/game/version_manifest_v2.json" }, new() { name = "Mojang", url = "https://piston-meta.mojang.com/mc/game/version_manifest_v2.json" },
]; ];
public UpdateHelper.GiteaConfig gitea { get; set; } = new() public UpdateHelper.GiteaConfig gitea { get; set; } = new UpdateHelper.GiteaConfig
{ {
serverUrl = "https://timerix.ddns.net/git/", serverUrl = "https://timerix.ddns.net:3322",
user = "Timerix", user = "Timerix",
repo = "mlaumcherb", repo = "mlaumcherb",
}; };

View File

@ -5,7 +5,7 @@ public class LauncherLogger : ILogger
private CompositeLogger _compositeLogger; private CompositeLogger _compositeLogger;
private FileLogger _fileLogger; private FileLogger _fileLogger;
public static readonly IOPath LogsDirectory = "launcher_logs"; public static readonly IOPath LogsDirectory = "launcher_logs";
public IOPath LogFilePath => _fileLogger.LogfileName; public IOPath LogfileName => _fileLogger.LogfileName;
public LauncherLogger() public LauncherLogger()
{ {

View File

@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk"> <Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup> <PropertyGroup>
<Version>1.1.1</Version> <Version>1.1.0</Version>
<OutputType Condition="'$(Configuration)' == 'Debug'">Exe</OutputType> <OutputType Condition="'$(Configuration)' == 'Debug'">Exe</OutputType>
<OutputType Condition="'$(Configuration)' != 'Debug'">WinExe</OutputType> <OutputType Condition="'$(Configuration)' != 'Debug'">WinExe</OutputType>
<TargetFramework>net8.0</TargetFramework> <TargetFramework>net8.0</TargetFramework>

View File

@ -183,11 +183,7 @@ public partial class MainWindow : Window
{ {
try try
{ {
Launcher.LaunchDirectoryInfoAsync(new DirectoryInfo(Directory.GetCurrent().ToString()))
string workingDir = Directory.GetCurrent().ToString();
LauncherApp.Logger.LogDebug(nameof(MainWindow),
$"opening working directory: {workingDir}");
Launcher.LaunchDirectoryInfoAsync(new DirectoryInfo(workingDir))
.ConfigureAwait(false); .ConfigureAwait(false);
} }
catch (Exception ex) catch (Exception ex)
@ -200,10 +196,7 @@ public partial class MainWindow : Window
{ {
try try
{ {
string logFilePath = LauncherApp.Logger.LogFilePath.ToString(); Launcher.LaunchFileInfoAsync(new FileInfo(LauncherApp.Logger.LogfileName.ToString()))
LauncherApp.Logger.LogDebug(nameof(MainWindow),
$"opening log file: {logFilePath}");
Launcher.LaunchFileInfoAsync(new FileInfo(logFilePath))
.ConfigureAwait(false); .ConfigureAwait(false);
} }
catch (Exception ex) catch (Exception ex)
@ -216,10 +209,7 @@ public partial class MainWindow : Window
{ {
try try
{ {
var sourcesUri = new Uri(LauncherApp.Config.gitea.GetRepoUrl()); Launcher.LaunchUriAsync(new Uri("https://timerix.ddns.net:3322/Timerix/mlaumcherb"))
LauncherApp.Logger.LogDebug(nameof(MainWindow),
$"opening in web browser: {sourcesUri}");
Launcher.LaunchUriAsync(sourcesUri)
.ConfigureAwait(false); .ConfigureAwait(false);
} }
catch (Exception ex) catch (Exception ex)

View File

@ -32,7 +32,7 @@ public class GiteaClient(string ServerUrl)
{ {
public async Task<Release> GetLatestRelease(string user, string repo) public async Task<Release> GetLatestRelease(string user, string repo)
{ {
string url = $"{ServerUrl}/api/v1/repos/{user}/{repo}/releases/latest"; string url = $"{ServerUrl}//api/v1/repos/{user}/{repo}/releases/latest";
return await NetworkHelper.DownloadStringAndDeserialize<Release>(url); return await NetworkHelper.DownloadStringAndDeserialize<Release>(url);
} }
} }

View File

@ -10,17 +10,15 @@ public class UpdateHelper
private readonly IOPath executablePathOld; private readonly IOPath executablePathOld;
private readonly IOPath executablePathNew; private readonly IOPath executablePathNew;
private readonly GiteaConfig _giteaConfig;
public class GiteaConfig public class GiteaConfig
{ {
[JsonRequired] public required string serverUrl { get; set; } [JsonRequired] public required string serverUrl { get; set; }
[JsonRequired] public required string user { get; set; } [JsonRequired] public required string user { get; set; }
[JsonRequired] public required string repo { get; set; } [JsonRequired] public required string repo { get; set; }
public string GetRepoUrl() => $"{serverUrl}/{user}/{repo}";
} }
private GiteaConfig _giteaConfig;
public UpdateHelper(GiteaConfig giteaConfig) public UpdateHelper(GiteaConfig giteaConfig)
{ {

View File

@ -29,12 +29,11 @@ case "$mode" in
args="$args_selfcontained" args="$args_selfcontained"
;; ;;
*) *)
echo "ПОЛЬЗОВАНИЕ: ./build.sh [способ]" echo "ПОЛЬЗОВАНИЕ: ./собрать.sh [способ]"
echo " СПОСОБЫ:" echo " СПОСОБЫ:"
echo " aot, native, бинарное - компилирует промежуточный (управляемый) код в машинный вместе с рантаймом" echo " бинарное - компилирует промежуточный (управляемый) код в машинный вместе с рантаймом"
echo " self-contained, selfcontained, небинарное - приделывает промежуточный (управляемый) код к рантайму" echo " небинарное - приделывает промежуточный (управляемый) код к рантайму"
echo " Оба способа собирают программу в один файл, который не является 80-мегабайтовым умственно отсталым кубом.\ echo " Оба способа собирают программу в один файл, который не является 80-мегабайтовым умственно отсталым кубом. Он 20-мегабайтовый >w<"
Он 20-мегабайтовый >w<"
exit 1 exit 1
;; ;;
esac esac
@ -45,4 +44,4 @@ echo "$command"
$command $command
find "$outdir" -name '*.pdb' -delete -printf "deleted '%p'\n" find "$outdir" -name '*.pdb' -delete -printf "deleted '%p'\n"
tree -sh "$outdir" ls -shk "$outdir" | sort -h

View File

@ -1,14 +0,0 @@
# Mlaumcherb - a minecraft laumcherb
<img src="./images/cheems.png" alt="silly-dog-picture" style="width:200px;"/>
## Features
- Downloads minecraft from mojang server or any other
- Downloads java or uses whatever you specified in config
- Downloads modpacks of my custom format
- Automatic launcher updates from git releases
## How to build
```sh
./build.sh selfcontained
```

Binary file not shown.

Before

Width:  |  Height:  |  Size: 996 KiB

View File

@ -5,8 +5,6 @@ EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "SolutionFolder", "SolutionFolder", "{A3217C18-CC0D-4CE8-9C48-1BDEC1E1B333}" Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "SolutionFolder", "SolutionFolder", "{A3217C18-CC0D-4CE8-9C48-1BDEC1E1B333}"
ProjectSection(SolutionItems) = preProject ProjectSection(SolutionItems) = preProject
.gitignore = .gitignore .gitignore = .gitignore
README.md = README.md
build.sh = build.sh
EndProjectSection EndProjectSection
EndProject EndProject
Global Global