Use process dir to find license file
This commit is contained in:
@@ -1,4 +1,5 @@
|
|||||||
using System;
|
using System;
|
||||||
|
using System.Diagnostics;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using Avalonia;
|
using Avalonia;
|
||||||
using Avalonia.Controls;
|
using Avalonia.Controls;
|
||||||
@@ -13,7 +14,8 @@ namespace MayShow.Views
|
|||||||
this.InitializeComponent();
|
this.InitializeComponent();
|
||||||
|
|
||||||
// set license text
|
// set license text
|
||||||
var licenseFileName = "Assets/LICENSES.txt";
|
var processDir = Path.GetDirectoryName(Environment.ProcessPath) ?? "";
|
||||||
|
var licenseFileName = Path.Combine(processDir, "Assets", "LICENSES.txt");
|
||||||
var licenseText = "";
|
var licenseText = "";
|
||||||
if (File.Exists(licenseFileName))
|
if (File.Exists(licenseFileName))
|
||||||
{
|
{
|
||||||
@@ -21,7 +23,7 @@ namespace MayShow.Views
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
licenseFileName = "../Resources/Assets/LICENSES.txt";
|
licenseFileName = Path.Combine(processDir, "../Resources/Assets/LICENSES.txt");
|
||||||
if (File.Exists(licenseFileName))
|
if (File.Exists(licenseFileName))
|
||||||
{
|
{
|
||||||
licenseText = File.ReadAllText(licenseFileName);
|
licenseText = File.ReadAllText(licenseFileName);
|
||||||
|
|||||||
Reference in New Issue
Block a user