Skip to content

Commit db743e9

Browse files
Fixed wrong 7z library detection for self-contained applications.
1 parent c9e4a5b commit db743e9

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

DazContentInstaller/Views/MainWindow.axaml.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
using System;
22
using System.IO;
33
using System.Linq;
4+
using System.Reflection;
45
using System.Threading.Tasks;
56
using Avalonia;
67
using Avalonia.Controls;
@@ -15,6 +16,7 @@
1516
using MsBox.Avalonia.Dto;
1617
using MsBox.Avalonia.Enums;
1718
using MsBox.Avalonia.Models;
19+
using SharpSevenZip;
1820

1921
namespace DazContentInstaller.Views;
2022

@@ -100,6 +102,10 @@ private async void Control_OnLoaded(object? sender, RoutedEventArgs e)
100102
{
101103
try
102104
{
105+
var currentLocation = System.AppContext.BaseDirectory;
106+
SharpSevenZipBase.SetLibraryPath(Path.Combine(currentLocation, Environment.Is64BitProcess ? "x64" : "x86",
107+
"7z.dll"));
108+
103109
if (Application.Current?.ApplicationLifetime is null)
104110
return;
105111

0 commit comments

Comments
 (0)