diff --git a/BrikInstaller.csproj b/BrikInstaller.csproj
index f38a49c..d900cc5 100644
--- a/BrikInstaller.csproj
+++ b/BrikInstaller.csproj
@@ -8,6 +8,10 @@
enable
false
src/resources/build/icon.ico
+ true
+ true
+ true
+ true
@@ -20,9 +24,13 @@
-
- PreserveNewest
-
+
+ true
+ Included
+ Always
+ PreserveNewest
+ false
+
diff --git a/src/main/Constants.cs b/src/main/Constants.cs
index 7aedf55..306cae7 100644
--- a/src/main/Constants.cs
+++ b/src/main/Constants.cs
@@ -10,7 +10,7 @@ public class Constants {
public static readonly string Os = OsHelper.getOperatingSystem();
public static readonly string Arch = OsHelper.getArchitecture();
- public static readonly string Env = "DEV";
+ public static readonly string Env = "PROD";
public static readonly string BaseDirectory = AppDomain.CurrentDomain.BaseDirectory;
public static readonly string CurrentWorkingDirectory = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location)!;
diff --git a/src/main/Program.cs b/src/main/Program.cs
index ff06973..a208b52 100644
--- a/src/main/Program.cs
+++ b/src/main/Program.cs
@@ -4,9 +4,7 @@ using System.Text.Json;
using BrikInstaller.Utils;
using BrikInstaller.Schemas;
using BrikInstaller.Services;
-using System.Security.Cryptography.X509Certificates;
using System.Net.Http.Json;
-using System.Reflection.Metadata;
namespace BrikInstaller;
@@ -16,11 +14,15 @@ class Program{
CreateMainWindow().WaitForClose();
}
- public static PhotinoWindow CreateMainWindow() {
- BrikPackage bpkg = new BrikPackage(Path.Combine(Constants.CurrentWorkingDirectory, "root.dat"), 66);
+ public static PhotinoWindow CreateMainWindow() {
+ var BrikPackagePath = Path.Combine(Constants.BaseDirectory, "root.dat");
+ if (Constants.Env == "PROD") {
+ BrikPackagePath = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "root.dat");
+ }
+ BrikPackage bpkg = new BrikPackage(BrikPackagePath, 66);
List entries = bpkg.ListEntries();
foreach (string entry in entries) {
- Console.WriteLine($"[File] > entry");
+ Console.WriteLine($"[File] > {entry}");
}
var window = new PhotinoWindow()
.SetTitle("Brik Installer")
@@ -52,7 +54,7 @@ class Program{
window.Center();
};
- LoadPage(window, "index.html");
+ LoadPage(window, "index.html");
return window;
}
@@ -142,7 +144,6 @@ class Program{
HttpMethod httpMethod = HttpMethod.Get;
var response = await HttpHelper.FetchAsync(Constants.URLs.Endpoints.Configuration(Constants.ProductMetadata.Name, Constants.Os, Constants.Arch), httpMethod);
var productConfig = await response.Content.ReadFromJsonAsync(Constants._jsonOptions);
- Console.WriteLine(productConfig!.Executable);
InstallationFinish installationFinish = jsonPayload.Deserialize(Constants._jsonOptions)!;
if (installationFinish.CreateShortcut) {
ShortcutService.CreateShortcut(Constants.ProductMetadata.Name, Path.Combine(Constants.ProductMetadata.InstallPath, productConfig.Executable!));
@@ -164,7 +165,6 @@ class Program{
HttpMethod httpMethod = HttpMethod.Get;
var response = await HttpHelper.FetchAsync(Constants.URLs.Endpoints.Metadata(), httpMethod);
string content = await response.Content.ReadAsStringAsync();
- Console.WriteLine(content);
responsePayload = new { success = true, content = content.ToString() };
} catch (Exception) {
responsePayload = new { success = false };