Browse Source

Merge pull request #979 from PixiEditor/fixes/26.06.2025

Replaced appdomain with process dir
Krzysztof Krysiński 1 month ago
parent
commit
e3da9f881a

+ 8 - 0
src/Directory.Build.props

@@ -56,6 +56,14 @@
     <Optimize>true</Optimize>
   </PropertyGroup>
 
+
+  <PropertyGroup Condition="'$(Configuration)'=='ReleaseNoUpdate'">
+    <DefineConstants>TRACE;RELEASE</DefineConstants>
+    <DebugSymbols>False</DebugSymbols>
+    <DebugType>None</DebugType>
+    <Optimize>true</Optimize>
+  </PropertyGroup>
+
   <PropertyGroup Condition="'$(Configuration)'=='Debug'">
     <DebugType>full</DebugType>
     <DebugSymbols>true</DebugSymbols>

+ 1 - 1
src/Drawie

@@ -1 +1 @@
-Subproject commit 0aaaed404a98c5b482066dce8e02ca62c4242f8c
+Subproject commit 7e9e4ba82f589f6d68589707208c57ee907272a6

+ 2 - 2
src/PixiEditor.AnimationRenderer.FFmpeg/FFMpegRenderer.cs

@@ -24,7 +24,7 @@ public class FFMpegRenderer : IAnimationRenderer
     {
         string path = $"ThirdParty/{IOperatingSystem.Current.Name}/ffmpeg";
 
-        string binaryPath = Path.Combine(Path.GetDirectoryName(AppDomain.CurrentDomain.BaseDirectory), path);
+        string binaryPath = Path.Combine(Path.GetDirectoryName(Environment.ProcessPath), path);
 
         GlobalFFOptions.Configure(new FFOptions() { BinaryFolder = binaryPath });
 
@@ -89,7 +89,7 @@ public class FFMpegRenderer : IAnimationRenderer
     {
         string path = $"ThirdParty/{IOperatingSystem.Current.Name}/ffmpeg";
 
-        string binaryPath = Path.Combine(Path.GetDirectoryName(AppDomain.CurrentDomain.BaseDirectory), path);
+        string binaryPath = Path.Combine(Path.GetDirectoryName(Environment.ProcessPath), path);
 
         GlobalFFOptions.Configure(new FFOptions() { BinaryFolder = binaryPath });
 

+ 4 - 0
src/PixiEditor/PixiEditor.csproj

@@ -60,6 +60,10 @@
     <ProjectReference Include="..\PixiEditor.Platform.Standalone\PixiEditor.Platform.Standalone.csproj"/>
   </ItemGroup>
 
+  <ItemGroup Condition=" '$(Configuration)' == 'ReleaseNoUpdate' ">
+    <ProjectReference Include="..\PixiEditor.Platform.Standalone\PixiEditor.Platform.Standalone.csproj"/>
+  </ItemGroup>
+
   <ItemGroup Condition=" '$(Configuration)' == 'DevRelease' ">
     <ProjectReference Include="..\PixiEditor.Platform.Standalone\PixiEditor.Platform.Standalone.csproj"/>
   </ItemGroup>

+ 4 - 3
src/PixiEditor/ViewModels/SubViewModels/MiscViewModel.cs

@@ -15,13 +15,13 @@ internal class MiscViewModel : SubViewModel<ViewModelMain>
     }
 
     [Command.Internal("PixiEditor.Links.OpenHyperlink")]
-    [Command.Basic("PixiEditor.Links.OpenDocumentation", "https://pixieditor.net/docs/introduction", "DOCUMENTATION", "OPEN_DOCUMENTATION", Icon = PixiPerfectIcons.Globe,
+    [Command.Basic("PixiEditor.Links.OpenDocumentation", "https://pixieditor.net/docs/", "DOCUMENTATION", "OPEN_DOCUMENTATION", Icon = PixiPerfectIcons.Globe,
         MenuItemPath = "HELP/DOCUMENTATION", MenuItemOrder = 0, AnalyticsTrack = true)]
     [Command.Basic("PixiEditor.Links.OpenWebsite", "https://pixieditor.net", "WEBSITE", "OPEN_WEBSITE", Icon = PixiPerfectIcons.Globe,
         MenuItemPath = "HELP/WEBSITE", MenuItemOrder = 1, AnalyticsTrack = true)]
     [Command.Basic("PixiEditor.Links.OpenRepository", "https://github.com/PixiEditor/PixiEditor", "REPOSITORY", "OPEN_REPOSITORY", Icon = PixiPerfectIcons.Globe,
         MenuItemPath = "HELP/REPOSITORY", MenuItemOrder = 2, AnalyticsTrack = true)]
-    [Command.Basic("PixiEditor.Links.OpenLicense", "{BaseDir}LICENSE", "LICENSE", "OPEN_LICENSE", Icon = PixiPerfectIcons.Folder,
+    [Command.Basic("PixiEditor.Links.OpenLicense", "{BaseDir}/LICENSE", "LICENSE", "OPEN_LICENSE", Icon = PixiPerfectIcons.Folder,
         MenuItemPath = "HELP/LICENSE", MenuItemOrder = 3, AnalyticsTrack = true)]
     [Command.Basic("PixiEditor.Links.OpenOtherLicenses", "{BaseDir}/Third Party Licenses", "THIRD_PARTY_LICENSES", "OPEN_THIRD_PARTY_LICENSES", Icon = PixiPerfectIcons.Folder,
         MenuItemPath = "HELP/THIRD_PARTY_LICENSES", MenuItemOrder = 4, AnalyticsTrack = true)]
@@ -31,7 +31,8 @@ internal class MiscViewModel : SubViewModel<ViewModelMain>
         {
             if (uri.StartsWith("{BaseDir}"))
             {
-                uri = uri.Replace("{BaseDir}", AppDomain.CurrentDomain.BaseDirectory);
+                string exeDir = Path.GetDirectoryName(Environment.ProcessPath);
+                uri = uri.Replace("{BaseDir}", exeDir ?? string.Empty);
             }
             
             IOperatingSystem.Current.OpenUri(uri);

+ 4 - 3
src/PixiEditor/ViewModels/SubViewModels/UpdateViewModel.cs

@@ -140,7 +140,8 @@ internal class UpdateViewModel : SubViewModel<ViewModelMain>
     {
         if (IOperatingSystem.Current.IsLinux)
         {
-            if (File.Exists("no-updates"))
+            string exeDir = Path.GetDirectoryName(Environment.ProcessPath);
+            if (File.Exists(Path.Combine(exeDir, "no-updates")))
             {
                 UpdateState = UpdateState.UnableToCheck;
                 return;
@@ -283,7 +284,7 @@ internal class UpdateViewModel : SubViewModel<ViewModelMain>
         UpdateChecker.SetLatestReleaseInfo(new ReleaseInfo(true) { TagName = "2.2.2.2" });
         Install(true);
     }
-    
+
     [Command.Debug("PixiEditor.Update.DebugDownload", "Debug Download Update",
         "(DEBUG) Download update file")]
     public void DebugDownload()
@@ -379,7 +380,7 @@ internal class UpdateViewModel : SubViewModel<ViewModelMain>
 
     private static bool InstallDirReadOnly()
     {
-        string installDir = AppDomain.CurrentDomain.BaseDirectory;
+        string installDir = Path.GetDirectoryName(Environment.ProcessPath);
         DirectoryInfo dirInfo = new DirectoryInfo(installDir);
         return dirInfo.Attributes.HasFlag(FileAttributes.ReadOnly);
     }