mirror of
https://github.com/QL-Win/QuickLook.git
synced 2026-01-28 01:08:34 +08:00
Add Sandbox detection
This commit is contained in:
Submodule QuickLook.Common updated: 474d7be09e...fac282e3ae
@@ -38,11 +38,12 @@ namespace QuickLook;
|
||||
public partial class App : Application
|
||||
{
|
||||
public static readonly string LocalDataPath = SettingHelper.LocalDataPath;
|
||||
public static readonly string UserPluginPath = Path.Combine(SettingHelper.LocalDataPath, "QuickLook.Plugin\\");
|
||||
public static readonly string UserPluginPath = Path.Combine(SettingHelper.LocalDataPath, @"QuickLook.Plugin\");
|
||||
public static readonly string AppFullPath = Assembly.GetExecutingAssembly().Location;
|
||||
public static readonly string AppPath = Path.GetDirectoryName(AppFullPath);
|
||||
public static readonly bool Is64Bit = Environment.Is64BitProcess;
|
||||
public static readonly bool IsUWP = ProcessHelper.IsRunningAsUWP();
|
||||
public static readonly bool IsSandBox = !ProcessHelper.IsFullTrust();
|
||||
public static readonly bool IsWin11 = Environment.OSVersion.Version >= new Version(10, 0, 21996);
|
||||
public static readonly bool IsWin10 = !IsWin11 && Environment.OSVersion.Version >= new Version(10, 0);
|
||||
public static readonly bool IsGPUInBlacklist = SystemHelper.IsGPUInBlacklist();
|
||||
|
||||
@@ -34,7 +34,7 @@ internal class TrayIconManager : IDisposable
|
||||
private readonly NotifyIcon _icon;
|
||||
|
||||
private readonly MenuItem _itemAutorun =
|
||||
new MenuItem(TranslationHelper.Get("Icon_RunAtStartup"),
|
||||
new(TranslationHelper.Get("Icon_RunAtStartup"),
|
||||
(sender, e) =>
|
||||
{
|
||||
if (AutoStartupHelper.IsAutorun())
|
||||
@@ -44,6 +44,8 @@ internal class TrayIconManager : IDisposable
|
||||
})
|
||||
{ Enabled = !App.IsUWP };
|
||||
|
||||
private string _attr = App.IsUWP ? $" (UWP{(App.IsSandBox ? string.Empty : "-SandBox")})" : string.Empty;
|
||||
|
||||
private TrayIconManager()
|
||||
{
|
||||
_icon = new NotifyIcon
|
||||
@@ -53,7 +55,7 @@ internal class TrayIconManager : IDisposable
|
||||
Icon = GetTrayIconByDPI(),
|
||||
ContextMenu = new ContextMenu(
|
||||
[
|
||||
new MenuItem($"v{Application.ProductVersion}{(App.IsUWP ? " (UWP)" : string.Empty)}") {Enabled = false},
|
||||
new MenuItem($"v{Application.ProductVersion}{_attr}") {Enabled = false},
|
||||
new MenuItem("-"),
|
||||
new MenuItem(TranslationHelper.Get("Icon_CheckUpdate"), (_, _) => Updater.CheckForUpdates()),
|
||||
new MenuItem(TranslationHelper.Get("Icon_GetPlugin"),
|
||||
|
||||
Reference in New Issue
Block a user