Преглед изворни кода

Run as admin show window changes and queue next frame in scene

flabbet пре 8 месеци
родитељ
комит
20f7feaab7

+ 1 - 0
src/PixiEditor.UpdateInstaller/PixiEditor.UpdateInstaller/ViewModels/UpdateController.cs

@@ -36,6 +36,7 @@ public class UpdateController
         {
             Installer = new UpdateModule.UpdateInstaller(files[0], UpdateDirectory);
             log.AppendLine($"Installing update from {files[0]} to {UpdateDirectory}");
+            Console.WriteLine("Installing update, DO NOT CLOSE THIS WINDOW");
             Installer.Install(log);
         }
     }

+ 4 - 1
src/PixiEditor.UpdateModule/UpdateInstaller.cs

@@ -32,16 +32,19 @@ public class UpdateInstaller
             processes[0].WaitForExit();
             log.AppendLine("Processes killed.");
         }
-
+        
         log.AppendLine("Extracting files");
+        
         ZipFile.ExtractToDirectory(ArchiveFileName, UpdateFilesPath, true);
         
         log.AppendLine("Files extracted");
         string dirWithFiles = Directory.GetDirectories(UpdateFilesPath)[0];
         log.AppendLine($"Copying files from {dirWithFiles} to {TargetDirectory}");
+        
         CopyFilesToDestination(dirWithFiles, log);
         log.AppendLine("Files copied");
         log.AppendLine("Deleting archive and update files");
+        
         DeleteArchive();
     }
 

+ 9 - 3
src/PixiEditor.Windows/WindowsProcessUtility.cs

@@ -18,12 +18,18 @@ public class WindowsProcessUtility : IProcessUtility
         {
             FileName = path,
             Verb = "runas",
-            UseShellExecute = true,
+            UseShellExecute = createWindow,
             CreateNoWindow = !createWindow,
-            WindowStyle = createWindow ? ProcessWindowStyle.Normal : ProcessWindowStyle.Minimized,
+            RedirectStandardOutput = !createWindow,
+            RedirectStandardError = !createWindow,
+            WindowStyle = createWindow ? ProcessWindowStyle.Normal : ProcessWindowStyle.Hidden
         };
 
-        return Process.Start(startInfo);  
+        Process p = new Process();
+        p.StartInfo = startInfo;
+
+        p.Start();
+        return p;
     }
 
     public bool IsRunningAsAdministrator()

+ 2 - 2
src/PixiEditor/Views/Rendering/Scene.cs

@@ -139,7 +139,7 @@ internal class Scene : Zoombox.Zoombox, ICustomHitTest
     {
         AffectsRender<Scene>(BoundsProperty, WidthProperty, HeightProperty, ScaleProperty, AngleRadiansProperty,
             FlipXProperty,
-            FlipYProperty, DocumentProperty, AllOverlaysProperty);
+            FlipYProperty, DocumentProperty, AllOverlaysProperty, ContentDimensionsProperty);
 
         FadeOutProperty.Changed.AddClassHandler<Scene>(FadeOutChanged);
         CheckerImagePathProperty.Changed.AddClassHandler<Scene>(CheckerImagePathChanged);
@@ -153,7 +153,7 @@ internal class Scene : Zoombox.Zoombox, ICustomHitTest
 
     private static void Refresh(Scene scene, AvaloniaPropertyChangedEventArgs args)
     {
-        scene.InvalidateVisual();
+        scene.QueueNextFrame();
     }
 
     public Scene()