generated from azures04/Photino-Boilerplate
optimized
This commit is contained in:
parent
98b6cd681f
commit
af469cfeb3
@ -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" />
|
||||
|
||||
@ -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}");
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user