optimized

This commit is contained in:
Gilles Lazures 2026-02-11 03:06:16 +01:00
parent 98b6cd681f
commit af469cfeb3
2 changed files with 26 additions and 3 deletions

View File

@ -32,6 +32,15 @@
<ExcludeFromSingleFile>false</ExcludeFromSingleFile>
</Content>
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="$(OutputPath)root.dat">
<LogicalName>root.dat</LogicalName>
<DependentUpon>PackRenderer</DependentUpon>
</EmbeddedResource>
</ItemGroup>
<PropertyGroup>
<IncludeNativeLibrariesForSelfExtract>true</IncludeNativeLibrariesForSelfExtract>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="BrikPackager" Version="0.0.1" GeneratePathProperty="true" />
<PackageReference Include="Photino.NET" Version="4.0.16" />

View File

@ -5,6 +5,7 @@ using BrikInstaller.Utils;
using BrikInstaller.Schemas;
using BrikInstaller.Services;
using System.Net.Http.Json;
using System.Reflection;
namespace BrikInstaller;
@ -15,11 +16,24 @@ class Program{
}
public static PhotinoWindow CreateMainWindow() {
var BrikPackagePath = Path.Combine(Constants.BaseDirectory, "root.dat");
string brikPackagePath;
if (Constants.Env == "PROD") {
BrikPackagePath = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "root.dat");
brikPackagePath = Path.Combine(Path.GetTempPath(), "brik_root.dat");
var assembly = Assembly.GetExecutingAssembly();
using (Stream? stream = assembly.GetManifestResourceStream("root.dat")) {
if (stream == null) throw new Exception("Ressource 'root.dat' introuvable.");
using (FileStream fs = new FileStream(brikPackagePath, FileMode.Create, FileAccess.Write)) {
stream.CopyTo(fs);
}
}
} else {
brikPackagePath = Path.Combine(Constants.BaseDirectory, "root.dat");
}
BrikPackage bpkg = new BrikPackage(BrikPackagePath, 66);
BrikPackage bpkg = new BrikPackage(brikPackagePath, 66);
List<string> entries = bpkg.ListEntries();
foreach (string entry in entries) {
Console.WriteLine($"[File] > {entry}");