Browse Source

分别修改.Net Framework框架版本为4.5和3.5,完美兼容Win8、Win8.1、Win7

蓝点lilac 5 years ago
parent
commit
3d427dc1bf
36 changed files with 353 additions and 261 deletions
  1. 2 2
      ContextMenuManager/App.config
  2. 21 0
      ContextMenuManager/BulePointLilac.Methods/GuidEx.cs
  3. 1 1
      ContextMenuManager/BulePointLilac.Methods/IniReader.cs
  4. 1 1
      ContextMenuManager/BulePointLilac.Methods/ObjectPath.cs
  5. 3 3
      ContextMenuManager/BulePointLilac.Methods/RegTrustedInstaller.cs
  6. 14 1
      ContextMenuManager/BulePointLilac.Methods/RegistryEx.cs
  7. 2 2
      ContextMenuManager/BulePointLilac.Methods/ResourceIcon.cs
  8. 12 0
      ContextMenuManager/BulePointLilac.Methods/StringExtension.cs
  9. 91 0
      ContextMenuManager/BulePointLilac.Methods/WshShortcut.cs
  10. 5 17
      ContextMenuManager/ContextMenuManager.csproj
  11. 1 1
      ContextMenuManager/Controls/NewOpenWithDialog.cs
  12. 3 4
      ContextMenuManager/Controls/NewSendToDialog.cs
  13. 2 2
      ContextMenuManager/Controls/NewShellDialog.cs
  14. 2 1
      ContextMenuManager/Controls/OpenWithList.cs
  15. 2 5
      ContextMenuManager/Controls/SendToItem.cs
  16. 5 5
      ContextMenuManager/Controls/ShellCommonDialog.cs
  17. 1 1
      ContextMenuManager/Controls/ShellExItem.cs
  18. 2 2
      ContextMenuManager/Controls/ShellNewItem.cs
  19. 1 0
      ContextMenuManager/Controls/ShellNewList.cs
  20. 1 1
      ContextMenuManager/Controls/ShellSubMenuDialog.cs
  21. 1 1
      ContextMenuManager/Controls/ThirdRulesList.cs
  22. 2 4
      ContextMenuManager/Controls/WinXItem.cs
  23. 7 3
      ContextMenuManager/Controls/WinXList.cs
  24. 3 3
      ContextMenuManager/GuidInfo.cs
  25. 4 0
      ContextMenuManager/Program.cs
  26. 2 2
      ContextMenuManager/Properties/AssemblyInfo.cs
  27. 139 176
      ContextMenuManager/Properties/Resources.Designer.cs
  28. 2 2
      ContextMenuManager/Properties/Resources/Texts/AppLanguageDic.ini
  29. 5 1
      ContextMenuManager/Properties/Resources/Texts/GuidInfosDic.ini
  30. 1 1
      ContextMenuManager/Properties/Resources/Texts/ThirdRulesDic.xml
  31. 1 1
      ContextMenuManager/Properties/Settings.Designer.cs
  32. 1 1
      ContextMenuManager/Updater.cs
  33. 8 12
      README.md
  34. BIN
      Thumbs.db
  35. 3 3
      languages/ja-JP.ini
  36. 2 2
      languages/zh-CN.ini

+ 2 - 2
ContextMenuManager/App.config

@@ -1,8 +1,8 @@
 <?xml version="1.0" encoding="utf-8"?>
 <configuration>
   <startup>
-    <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6"/>
-  </startup>
+    
+  <supportedRuntime version="v2.0.50727"/></startup>
   <runtime>
     <legacyCorruptedStateExceptionsPolicy enabled="true"/>
     <EnableWindowsFormsHighDpiAutoResizing enabled="true"/>

+ 21 - 0
ContextMenuManager/BulePointLilac.Methods/GuidEx.cs

@@ -0,0 +1,21 @@
+using System;
+
+namespace BulePointLilac.Methods
+{
+    //为兼容.Net Framework 3.5,无法引用Microsoft.CSharp.dll(中的Guid.TryParse)写了这个扩展方法
+    public static class GuidEx
+    {
+        public static bool TryParse(string str, out Guid guid)
+        {
+            try
+            {
+                guid = new Guid(str);
+                return true;
+            }
+            catch(Exception) {
+                guid = Guid.Empty;
+                return false;
+            }
+        }
+    }
+}

+ 1 - 1
ContextMenuManager/BulePointLilac.Methods/IniReader.cs

@@ -10,7 +10,7 @@ namespace BulePointLilac.Methods
     {
         public IniReader(StringBuilder sb)
         {
-            if(string.IsNullOrWhiteSpace(sb.ToString())) return;
+            if(sb.ToString().IsNullOrWhiteSpace()) return;
             List<string> lines = sb.ToString().Split(new[] { "\r\n", "\n" },
                 StringSplitOptions.RemoveEmptyEntries).ToList();//拆分为行
             lines.ForEach(line => line.Trim());

+ 1 - 1
ContextMenuManager/BulePointLilac.Methods/ObjectPath.cs

@@ -57,7 +57,7 @@ namespace BulePointLilac.Methods
         public static string ExtractFilePath(string command, out string shortPath)
         {
             shortPath = null;
-            if(string.IsNullOrWhiteSpace(command)) return null;
+            if(command.IsNullOrWhiteSpace()) return null;
             command = Environment.ExpandEnvironmentVariables(command).Replace(@"\\", @"\");
             if(File.Exists(command)) {
                 shortPath = command;

+ 3 - 3
ContextMenuManager/BulePointLilac.Methods/RegTrustedInstaller.cs

@@ -149,7 +149,7 @@ namespace BulePointLilac.Methods
         /// <param name="regPath">要获取权限的注册表完整路径</param>
         public static void TakeRegKeyOwnerShip(string regPath)
         {
-            if(string.IsNullOrWhiteSpace(regPath)) return;
+            if(regPath.IsNullOrWhiteSpace()) return;
             RegistryKey key = null;
             WindowsIdentity id = null;
             //利用试错判断是否有写入权限
@@ -206,7 +206,7 @@ namespace BulePointLilac.Methods
                 }
                 catch(Exception) { }
             }
-            finally { key?.Dispose(); id?.Dispose(); }
+            finally { key?.Close(); id?.Dispose(); }
         }
 
         /// <summary>获取注册表项及其子项、递归子级子项权限</summary>
@@ -214,7 +214,7 @@ namespace BulePointLilac.Methods
         /// <param name="regPath">要获取权限的注册表完整路径</param>
         public static void TakeRegTreeOwnerShip(string regPath)
         {
-            if(string.IsNullOrWhiteSpace(regPath)) return;
+            if(regPath.IsNullOrWhiteSpace()) return;
             TakeRegKeyOwnerShip(regPath);
             using(RegistryKey key = RegistryEx.GetRegistryKey(regPath))
                 if(key != null)

+ 14 - 1
ContextMenuManager/BulePointLilac.Methods/RegistryEx.cs

@@ -36,7 +36,14 @@ namespace BulePointLilac.Methods
         {
             string dirPath = GetParentPath(regPath);
             string keyName = GetKeyName(regPath);
-            GetRegistryKey(dirPath, true)?.DeleteSubKeyTree(keyName, throwOnMissingKey);
+            try
+            {
+                GetRegistryKey(dirPath, true)?.DeleteSubKeyTree(keyName);
+            }
+            catch(Exception)
+            {
+                if(throwOnMissingKey) throw;
+            }
         }
 
         /// <summary>获取指定注册表路径的根项RegistryKey和不包含根项部分的注册表路径</summary>
@@ -106,5 +113,11 @@ namespace BulePointLilac.Methods
                     srcSubKey.CopyTo(dstSubKey);
             }
         }
+
+        public static RegistryKey CreateSubKey(this RegistryKey key, string subKeyName, bool writable)
+        {
+            key.CreateSubKey(subKeyName).Close();
+            return key.OpenSubKey(subKeyName, writable);
+        }
     }
 }

+ 2 - 2
ContextMenuManager/BulePointLilac.Methods/ResourceIcon.cs

@@ -110,7 +110,7 @@ namespace BulePointLilac.Methods
         public static Icon GetIcon(string iconLocation, out string iconPath, out int iconIndex)
         {
             iconIndex = 0; iconPath = null;
-            if(string.IsNullOrWhiteSpace(iconLocation)) return null;
+            if(iconLocation.IsNullOrWhiteSpace()) return null;
             iconLocation = Environment.ExpandEnvironmentVariables(iconLocation).Replace("\"", "");
             int index = iconLocation.LastIndexOf(',');
             if(index == -1) iconPath = iconLocation;
@@ -133,7 +133,7 @@ namespace BulePointLilac.Methods
         public static Icon GetIcon(string iconPath, int iconIndex)
         {
             Icon icon = null;
-            if(string.IsNullOrWhiteSpace(iconPath)) return icon;
+            if(iconPath.IsNullOrWhiteSpace()) return icon;
             iconPath = Environment.ExpandEnvironmentVariables(iconPath).Replace("\"", "");
 
             if(Path.GetFileName(iconPath).ToLower() == "shell32.dll")

+ 12 - 0
ContextMenuManager/BulePointLilac.Methods/StringExtension.cs

@@ -0,0 +1,12 @@
+namespace BulePointLilac.Methods
+{
+    //为兼容.Net Framework 3.5,无法引用Microsoft.CSharp.dll(中的string.IsNullOrWhiteSpace)写了这个扩展方法
+    public static class StringExtension
+    {
+        public static bool IsNullOrWhiteSpace(this string str)
+        {
+            if(string.IsNullOrEmpty(str)) return true;
+            return str.Trim().Length == 0;
+        }
+    }
+}

+ 91 - 0
ContextMenuManager/BulePointLilac.Methods/WshShortcut.cs

@@ -0,0 +1,91 @@
+using System;
+using System.Reflection;
+
+namespace BulePointLilac.Methods
+{
+    //为兼容.Net Framework 3.5无法使用dynamic和Interop.IWshRuntimeLibrary.dll专门写出此类
+    sealed class WshShortcut
+    {
+        private static readonly Type ShellType = Type.GetTypeFromProgID("WScript.Shell");
+        private static readonly object Shell = Activator.CreateInstance(ShellType);
+        private static readonly BindingFlags InvokeMethodFlag = BindingFlags.Public | BindingFlags.Instance | BindingFlags.InvokeMethod;
+        private static readonly BindingFlags GetPropertyFlag = BindingFlags.Public | BindingFlags.Instance | BindingFlags.GetProperty;
+        private static readonly BindingFlags SetPropertyFlag = BindingFlags.Public | BindingFlags.Instance | BindingFlags.SetProperty;
+
+        private static object CreateShortcut(string lnkPath)
+        {
+            return ShellType.InvokeMember("CreateShortcut", InvokeMethodFlag, null, Shell, new[] { lnkPath });
+        }
+
+        private Type ShortcutType;
+        private object Shortcut;
+
+        private string fullName;
+        public string FullName
+        {
+            get => fullName;
+            set => Load(value);
+        }
+
+        public string TargetPath
+        {
+            get => GetValue("TargetPath").ToString();
+            set => SetValue("TargetPath", value);
+        }
+        public string Arguments
+        {
+            get => GetValue("Arguments").ToString();
+            set => SetValue("Arguments", value);
+        }
+        public string WorkingDirectory
+        {
+            get => GetValue("WorkingDirectory").ToString();
+            set => SetValue("WorkingDirectory", value);
+        }
+        public string IconLocation
+        {
+            get => GetValue("IconLocation").ToString();
+            set => SetValue("IconLocation", value);
+        }
+        public string Description
+        {
+            get => GetValue("Description").ToString();
+            set => SetValue("Description", value);
+        }
+        public string Hotkey
+        {
+            get => GetValue("Hotkey").ToString();
+            set => SetValue("Hotkey", value);
+        }
+        public int WindowStyle
+        {
+            get => Convert.ToInt32(GetValue("WindowStyle"));
+            set => SetValue("WindowStyle", value);
+        }
+        //public string RelativePath { get; set; }//暂时不知道这是啥
+
+        private object GetValue(string name)
+        {
+            return ShortcutType.InvokeMember(name, GetPropertyFlag, null, Shortcut, null);
+        }
+
+        private void SetValue(string name, object value)
+        {
+            ShortcutType.InvokeMember(name, SetPropertyFlag, null, Shortcut, new[] { value });
+        }
+
+        public void Load(string lnkPath)
+        {
+            fullName = lnkPath;
+            Shortcut = CreateShortcut(lnkPath);
+            ShortcutType = Shortcut.GetType();
+            Save();
+        }
+
+        public void Save()
+        {
+            //存储快捷方式为写入文件行为,如果没有权限会报错
+            ShortcutType.InvokeMember("Save", InvokeMethodFlag, null, Shortcut, null);
+        }
+    }
+}

+ 5 - 17
ContextMenuManager/ContextMenuManager.csproj

@@ -8,7 +8,7 @@
     <OutputType>WinExe</OutputType>
     <RootNamespace>ContextMenuManager</RootNamespace>
     <AssemblyName>ContextMenuManager</AssemblyName>
-    <TargetFrameworkVersion>v4.6</TargetFrameworkVersion>
+    <TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
     <FileAlignment>512</FileAlignment>
     <AutoGenerateBindingRedirects>false</AutoGenerateBindingRedirects>
     <Deterministic>true</Deterministic>
@@ -97,7 +97,6 @@
     <ApplicationManifest>Properties\App.manifest</ApplicationManifest>
   </PropertyGroup>
   <ItemGroup>
-    <Reference Include="Microsoft.CSharp" />
     <Reference Include="PresentationFramework" />
     <Reference Include="System" />
     <Reference Include="System.Core" />
@@ -110,19 +109,20 @@
     <Reference Include="System.Xml.Linq" />
   </ItemGroup>
   <ItemGroup>
-    <Compile Include="BulePointLilac.Controls\MyToolTip.cs">
-      <SubType>Form</SubType>
-    </Compile>
+    <Compile Include="BulePointLilac.Controls\MyToolTip.cs" />
     <Compile Include="BulePointLilac.Controls\ResizbleForm.cs">
       <SubType>Form</SubType>
     </Compile>
     <Compile Include="BulePointLilac.Controls\MyToolBar.cs">
       <SubType>Component</SubType>
     </Compile>
+    <Compile Include="BulePointLilac.Methods\GuidEx.cs" />
     <Compile Include="BulePointLilac.Methods\IniFileHelper.cs" />
     <Compile Include="BulePointLilac.Methods\IniReader.cs" />
     <Compile Include="BulePointLilac.Methods\MessageBoxEx.cs" />
     <Compile Include="BulePointLilac.Methods\RichTextBoxExtension.cs" />
+    <Compile Include="BulePointLilac.Methods\StringExtension.cs" />
+    <Compile Include="BulePointLilac.Methods\WshShortcut.cs" />
     <Compile Include="Controls\AddCommonButton.cs">
       <SubType>Component</SubType>
     </Compile>
@@ -329,17 +329,6 @@
       <Install>false</Install>
     </BootstrapperPackage>
   </ItemGroup>
-  <ItemGroup>
-    <COMReference Include="IWshRuntimeLibrary">
-      <Guid>{F935DC20-1CF0-11D0-ADB9-00C04FD58A0B}</Guid>
-      <VersionMajor>1</VersionMajor>
-      <VersionMinor>0</VersionMinor>
-      <Lcid>0</Lcid>
-      <WrapperTool>tlbimp</WrapperTool>
-      <Isolated>False</Isolated>
-      <EmbedInteropTypes>True</EmbedInteropTypes>
-    </COMReference>
-  </ItemGroup>
   <ItemGroup>
     <Content Include="Properties\AppIcon.ico" />
     <Content Include="Properties\Resources\Texts\ShellCommonDic.xml" />
@@ -372,7 +361,6 @@
       <LastGenOutput>Resources.Designer.cs</LastGenOutput>
     </EmbeddedResource>
   </ItemGroup>
-  <ItemGroup />
   <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
   <PropertyGroup>
     <PreBuildEvent>

+ 1 - 1
ContextMenuManager/Controls/NewOpenWithDialog.cs

@@ -40,7 +40,7 @@ namespace ContextMenuManager.Controls
                         MessageBoxEx.Show(AppString.MessageBox.TextCannotBeEmpty);
                         return;
                     }
-                    if(string.IsNullOrWhiteSpace(ItemCommand))
+                    if(ItemCommand.IsNullOrWhiteSpace())
                     {
                         MessageBoxEx.Show(AppString.MessageBox.TextCannotBeEmpty);
                         return;

+ 3 - 4
ContextMenuManager/Controls/NewSendToDialog.cs

@@ -22,7 +22,6 @@ namespace ContextMenuManager.Controls
 
         sealed class NewSendToItemForm : NewItemForm
         {
-            private static readonly IWshRuntimeLibrary.WshShell WshShell = new IWshRuntimeLibrary.WshShell();
             public string FilePath { get; set; }
 
             readonly RadioButton rdoFile = new RadioButton
@@ -54,12 +53,12 @@ namespace ContextMenuManager.Controls
 
                 btnOk.Click += (sender, e) =>
                 {
-                    if(string.IsNullOrWhiteSpace(ItemText))
+                    if(ItemText.IsNullOrWhiteSpace())
                     {
                         MessageBoxEx.Show(AppString.MessageBox.TextCannotBeEmpty);
                         return;
                     }
-                    if(string.IsNullOrWhiteSpace(ItemCommand))
+                    if(ItemCommand.IsNullOrWhiteSpace())
                     {
                         MessageBoxEx.Show(AppString.MessageBox.CommandCannotBeEmpty);
                         return;
@@ -105,7 +104,7 @@ namespace ContextMenuManager.Controls
                 FilePath = $@"{SendToList.SendToPath}\{ObjectPath.RemoveIllegalChars(ItemText)}.lnk";
                 FilePath = ObjectPath.GetNewPathWithIndex(FilePath, ObjectPath.PathType.File);
 
-                IWshRuntimeLibrary.IWshShortcut shortcut = WshShell.CreateShortcut(FilePath);
+                WshShortcut shortcut = new WshShortcut { FullName = FilePath };
                 if(rdoFile.Checked)
                 {
                     ItemCommand = Environment.ExpandEnvironmentVariables(ItemCommand);

+ 2 - 2
ContextMenuManager/Controls/NewShellDialog.cs

@@ -79,7 +79,7 @@ namespace ContextMenuManager.Controls
 
                 btnOk.Click += (sender, e) =>
                 {
-                    if(string.IsNullOrWhiteSpace(txtText.Text))
+                    if(txtText.Text.IsNullOrWhiteSpace())
                     {
                         MessageBoxEx.Show(AppString.MessageBox.TextCannotBeEmpty);
                     }
@@ -127,7 +127,7 @@ namespace ContextMenuManager.Controls
                             key.SetValue("SubCommands", "");
                         else
                         {
-                            if(!string.IsNullOrWhiteSpace(ItemCommand))
+                            if(!ItemCommand.IsNullOrWhiteSpace())
                                 key.CreateSubKey("command", true).SetValue("", ItemCommand);
                         }
                     }

+ 2 - 1
ContextMenuManager/Controls/OpenWithList.cs

@@ -16,10 +16,11 @@ namespace ContextMenuManager.Controls
             this.LoadCommonItems();
             this.SortItemByText();
             this.AddNewItem();
+            Version ver = Environment.OSVersion.Version;
             RegRuleItem storeItem = new RegRuleItem(RegRuleItem.UseStoreOpenWith)
             {
                 MarginRight = RegRuleItem.SysMarginRignt,
-                Visible = Environment.OSVersion.Version.Major == 10
+                Visible = (ver.Major == 10) || (ver.Major == 6 && ver.Minor >= 2)
             };
             this.InsertItem(storeItem, 1);
         }

+ 2 - 5
ContextMenuManager/Controls/SendToItem.cs

@@ -10,9 +10,6 @@ namespace ContextMenuManager.Controls
 {
     sealed class SendToItem : MyListItem, IChkVisibleItem, IBtnShowMenuItem, ITsiTextItem, ITsiIconItem, ITsiWebSearchItem, ITsiFilePathItem, ITsiDeleteItem
     {
-
-        private static readonly IWshRuntimeLibrary.WshShell WshShell = new IWshRuntimeLibrary.WshShell();
-
         public SendToItem(string filePath)
         {
             InitializeComponents();
@@ -26,14 +23,14 @@ namespace ContextMenuManager.Controls
             set
             {
                 filePath = value;
-                if(IsShortcut) this.Shortcut = WshShell.CreateShortcut(value);
+                if(IsShortcut) this.Shortcut.FullName = value;
                 this.Text = this.ItemText;
                 this.Image = this.ItemIcon.ToBitmap();
                 ChkVisible.Checked = this.ItemVisible;
             }
         }
 
-        private IWshRuntimeLibrary.IWshShortcut Shortcut;
+        private WshShortcut Shortcut = new WshShortcut();
         private string FileName => Path.GetFileName(FilePath);
         private string FileExtension => Path.GetExtension(FilePath);
         private bool IsShortcut => FileExtension.ToLower() == ".lnk";

+ 5 - 5
ContextMenuManager/Controls/ShellCommonDialog.cs

@@ -93,7 +93,7 @@ namespace ContextMenuManager.Controls
                 {
                     XmlElement szXE = (XmlElement)itemXE.SelectSingleNode("Value/REG_SZ");
                     string keyName = itemXE.GetAttribute("KeyName");
-                    if(string.IsNullOrWhiteSpace(keyName)) continue;
+                    if(keyName.IsNullOrWhiteSpace()) continue;
                     ShellCommonItem item = new ShellCommonItem
                     {
                         DefaultKeyName = keyName,
@@ -106,7 +106,7 @@ namespace ContextMenuManager.Controls
                         else if(szXE.HasAttribute("HasLUAShield")) item.Image = AppImage.Shield;
                     }
                     if(item.Image == null) item.Image = AppImage.NotFound;
-                    if(string.IsNullOrWhiteSpace(item.Text)) item.Text = item.DefaultKeyName;
+                    if(item.Text.IsNullOrWhiteSpace()) item.Text = item.DefaultKeyName;
                     item.SetTip(itemXE.GetAttribute("Tip"));
                     list.AddItem(item);
                 }
@@ -125,8 +125,8 @@ namespace ContextMenuManager.Controls
                         DefaultKeyName = itemXE.GetAttribute("KeyName"),
                         Guid = guid
                     };
-                    if(string.IsNullOrWhiteSpace(item.Text)) item.Text = GuidInfo.GetText(guid);
-                    if(string.IsNullOrWhiteSpace(item.DefaultKeyName)) item.DefaultKeyName = guid.ToString("B");
+                    if(item.Text.IsNullOrWhiteSpace()) item.Text = GuidInfo.GetText(guid);
+                    if(item.DefaultKeyName.IsNullOrWhiteSpace()) item.DefaultKeyName = guid.ToString("B");
                     item.SetTip(itemXE.GetAttribute("Tip"));
                     list.AddItem(item);
                 }
@@ -207,7 +207,7 @@ namespace ContextMenuManager.Controls
         {
             if(keyXE == null) return;
             string defaultValue = keyXE.GetAttribute("Default");
-            if(!string.IsNullOrWhiteSpace(defaultValue)) SetValue(regPath, "", defaultValue);
+            if(!defaultValue.IsNullOrWhiteSpace()) SetValue(regPath, "", defaultValue);
             WriteAttributesValue(keyXE.SelectSingleNode("Value"), regPath);
 
             XmlNode subKeyXN = keyXE.SelectSingleNode("SubKey");

+ 1 - 1
ContextMenuManager/Controls/ShellExItem.cs

@@ -171,7 +171,7 @@ namespace ContextMenuManager.Controls
                     return;
                 }
                 Directory.CreateDirectory(Program.ConfigDir);
-                if(!string.IsNullOrWhiteSpace(dlg.ItemName))
+                if(!dlg.ItemName.IsNullOrWhiteSpace())
                 {
                     helper.SetValue(section, "Text", dlg.ItemName);
                     this.Text = ResourceString.GetDirectString(dlg.ItemName);

+ 2 - 2
ContextMenuManager/Controls/ShellNewItem.cs

@@ -71,7 +71,7 @@ namespace ContextMenuManager.Controls
                     if(filePath != null) return filePath;
 
                     value = key.OpenSubKey("CLSID")?.GetValue("")?.ToString();
-                    if(Guid.TryParse(value, out Guid guid))
+                    if(GuidEx.TryParse(value, out Guid guid))
                     {
                         filePath = GuidInfo.GetFilePath(guid);
                         if(filePath != null) return filePath;
@@ -133,7 +133,7 @@ namespace ContextMenuManager.Controls
                 string iconPath;
                 int iconIndex;
                 string value = IconLocation;
-                if(string.IsNullOrWhiteSpace(value)) value = DefaultTypeDefaultIcon;
+                if(value.IsNullOrWhiteSpace()) value = DefaultTypeDefaultIcon;
                 if(!string.IsNullOrEmpty(value)) icon = ResourceIcon.GetIcon(value, out iconPath, out iconIndex);
                 else icon = ResourceIcon.GetIcon(iconPath = ItemFilePath, iconIndex = 0);
                 if(icon == null) icon = ResourceIcon.GetIcon(iconPath = "imageres.dll", iconIndex = 2);//图标资源不存在

+ 1 - 0
ContextMenuManager/Controls/ShellNewList.cs

@@ -1,4 +1,5 @@
 using BulePointLilac.Controls;
+using BulePointLilac.Methods;
 using Microsoft.Win32;
 using System;
 using System.Collections.Generic;

+ 1 - 1
ContextMenuManager/Controls/ShellSubMenuDialog.cs

@@ -37,7 +37,7 @@ namespace ContextMenuManager.Controls
                 this.MinimumSize = this.Size = new Size(646, 389).DpiZoom();
                 LstSubItems = new MyListBox { Dock = DockStyle.Fill, Parent = this };
                 string value = GetValue(parentPath, "SubCommands", null)?.ToString();
-                if(string.IsNullOrWhiteSpace(value))
+                if(value.IsNullOrWhiteSpace())
                 {
                     using(var shellKey = RegistryEx.GetRegistryKey($@"{parentPath}\shell"))
                     {

+ 1 - 1
ContextMenuManager/Controls/ThirdRulesList.cs

@@ -42,7 +42,7 @@ namespace ContextMenuManager.Controls
                     PathType = ObjectPath.PathType.Registry,
                     Image = GuidInfo.GetImage(guid),
                 };
-                if(string.IsNullOrWhiteSpace(groupItem.Text)) groupItem.Text = GuidInfo.GetText(guid);
+                if(groupItem.Text.IsNullOrWhiteSpace()) groupItem.Text = GuidInfo.GetText(guid);
                 this.AddItem(groupItem);
 
                 foreach(XmlElement itemXE in groupXE.ChildNodes)

+ 2 - 4
ContextMenuManager/Controls/WinXItem.cs

@@ -10,8 +10,6 @@ namespace ContextMenuManager.Controls
     sealed class WinXItem : MyListItem, IChkVisibleItem, IBtnShowMenuItem,
         ITsiTextItem, ITsiWebSearchItem, ITsiFilePathItem, ITsiDeleteItem, IFoldSubItem
     {
-        private static readonly IWshRuntimeLibrary.WshShell WshShell = new IWshRuntimeLibrary.WshShell();
-
         public WinXItem(string filePath, IFoldGroupItem group)
         {
             InitializeComponents();
@@ -26,7 +24,7 @@ namespace ContextMenuManager.Controls
             set
             {
                 filePath = value;
-                this.Shortcut = WshShell.CreateShortcut(value);
+                this.Shortcut.FullName = value;
                 this.Text = this.ItemText;
                 this.Image = this.ItemIcon.ToBitmap();
                 ChkVisible.Checked = this.ItemVisible;
@@ -73,7 +71,7 @@ namespace ContextMenuManager.Controls
             }
         }
 
-        private IWshRuntimeLibrary.IWshShortcut Shortcut;
+        private WshShortcut Shortcut = new WshShortcut();
         private Icon ItemIcon => ResourceIcon.GetIcon(IconLocation) ?? Icon.ExtractAssociatedIcon(Shortcut.TargetPath);
         public string SearchText => $"{AppString.SideBar.WinX} {Text}";
 

+ 7 - 3
ContextMenuManager/Controls/WinXList.cs

@@ -27,9 +27,13 @@ namespace ContextMenuManager.Controls
 
         public void LoadItems()
         {
-            this.ClearItems();
-            DesktopIniReaders.Clear();
-            Array.ForEach(new DirectoryInfo(WinXPath).GetDirectories(), di => LoadSubDirItems(di));
+            Version ver = Environment.OSVersion.Version;
+            if((ver.Major == 10) || (ver.Major == 6 && ver.Minor >= 2))
+            {
+                this.ClearItems();
+                DesktopIniReaders.Clear();
+                Array.ForEach(new DirectoryInfo(WinXPath).GetDirectories(), di => LoadSubDirItems(di));
+            }
         }
 
         private void LoadSubDirItems(DirectoryInfo di)

+ 3 - 3
ContextMenuManager/GuidInfo.cs

@@ -34,7 +34,7 @@ namespace ContextMenuManager
         public static bool TryGetGuid(string value, out Guid guid, out string guidPath)
         {
             guidPath = null;
-            if(!Guid.TryParse(value, out guid)) return false;
+            if(!GuidEx.TryParse(value, out guid)) return false;
             foreach(string path in ClsidPaths)
             {
                 using(RegistryKey key = RegistryEx.GetRegistryKey($@"{path}\{guid:B}"))
@@ -100,7 +100,7 @@ namespace ContextMenuManager
                 {
                     itemText = GetAbsStr(guid, itemText, true);
                 }
-                if(string.IsNullOrWhiteSpace(itemText))
+                if(itemText.IsNullOrWhiteSpace())
                 {
                     foreach(string clsidPath in ClsidPaths)
                     {
@@ -112,7 +112,7 @@ namespace ContextMenuManager
                     }
                 }
                 itemText = ResourceString.GetDirectString(itemText);
-                if(string.IsNullOrWhiteSpace(itemText)) itemText = null;
+                if(itemText.IsNullOrWhiteSpace()) itemText = null;
                 ItemTextDic.Add(guid, itemText);
             }
             return itemText;

+ 4 - 0
ContextMenuManager/Program.cs

@@ -7,6 +7,10 @@ using System.Windows.Forms;
 
 namespace ContextMenuManager
 {
+    //完美兼容.Net Framework 3.5(Win7)、.Net Framework 4.5(Win8、Win8.1)、.Net Framework 4.6(Win10)
+    //避免用户未安装或不会安装系统未自带的.Net Framework版本,这样可以直接启动程序,不用担心框架问题,
+    //Win10和Win8、Win8.1可共用一个exe文件(.Net Framework 4.5),Win7另用一个版本(.Net Framework 3.5)
+    //在编译前在Properties\应用程序\目标框架中修改为对应框架即可
     static class Program
     {
         public const string ZH_CNINI = "zh-CN.ini";

+ 2 - 2
ContextMenuManager/Properties/AssemblyInfo.cs

@@ -11,5 +11,5 @@ using System.Runtime.InteropServices;
 [assembly: AssemblyCulture("")]
 [assembly: ComVisible(false)]
 [assembly: Guid("35190ec1-2515-488d-a2e9-825d6ff67aa2")]
-[assembly: AssemblyVersion("2.0.0.0")]
-[assembly: AssemblyFileVersion("2.0.0.0")]
+[assembly: AssemblyVersion("3.0.0.0")]
+[assembly: AssemblyFileVersion("3.0.0.0")]

+ 139 - 176
ContextMenuManager/Properties/Resources.Designer.cs

@@ -1,182 +1,183 @@
-namespace ContextMenuManager.Properties
-{
-    [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "16.0.0.0")]
+//------------------------------------------------------------------------------
+// <auto-generated>
+//     此代码由工具生成。
+//     运行时版本:4.0.30319.42000
+//
+//     对此文件的更改可能会导致不正确的行为,并且如果
+//     重新生成代码,这些更改将会丢失。
+// </auto-generated>
+//------------------------------------------------------------------------------
+
+namespace ContextMenuManager.Properties {
+    using System;
+    
+    
+    /// <summary>
+    ///   一个强类型的资源类,用于查找本地化的字符串等。
+    /// </summary>
+    // 此类是由 StronglyTypedResourceBuilder
+    // 类通过类似于 ResGen 或 Visual Studio 的工具自动生成的。
+    // 若要添加或移除成员,请编辑 .ResX 文件,然后重新运行 ResGen
+    // (以 /str 作为命令选项),或重新生成 VS 项目。
+    [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "15.0.0.0")]
     [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
     [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
-    internal class Resources
-    {
+    internal class Resources {
+        
         private static global::System.Resources.ResourceManager resourceMan;
+        
         private static global::System.Globalization.CultureInfo resourceCulture;
-
+        
         [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
-        internal Resources() { }
-
+        internal Resources() {
+        }
+        
         /// <summary>
         ///   返回此类使用的缓存的 ResourceManager 实例。
         /// </summary>
         [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
-        internal static global::System.Resources.ResourceManager ResourceManager
-        {
-            get
-            {
-                if(object.ReferenceEquals(resourceMan, null))
-                {
+        internal static global::System.Resources.ResourceManager ResourceManager {
+            get {
+                if (object.ReferenceEquals(resourceMan, null)) {
                     global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("ContextMenuManager.Properties.Resources", typeof(Resources).Assembly);
                     resourceMan = temp;
                 }
                 return resourceMan;
             }
         }
-
+        
         /// <summary>
         ///   重写当前线程的 CurrentUICulture 属性
         ///   重写当前线程的 CurrentUICulture 属性。
         /// </summary>
         [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
-        internal static global::System.Globalization.CultureInfo Culture
-        {
-            get
-            {
+        internal static global::System.Globalization.CultureInfo Culture {
+            get {
                 return resourceCulture;
             }
-            set
-            {
+            set {
                 resourceCulture = value;
             }
         }
-
+        
         /// <summary>
         ///   查找 System.Drawing.Bitmap 类型的本地化资源。
         /// </summary>
-        internal static System.Drawing.Bitmap About
-        {
-            get
-            {
+        internal static System.Drawing.Bitmap About {
+            get {
                 object obj = ResourceManager.GetObject("About", resourceCulture);
                 return ((System.Drawing.Bitmap)(obj));
             }
         }
-
+        
         /// <summary>
         ///   查找 System.Drawing.Bitmap 类型的本地化资源。
         /// </summary>
-        internal static System.Drawing.Bitmap Add
-        {
-            get
-            {
+        internal static System.Drawing.Bitmap Add {
+            get {
                 object obj = ResourceManager.GetObject("Add", resourceCulture);
                 return ((System.Drawing.Bitmap)(obj));
             }
         }
-
+        
         /// <summary>
         ///   查找 System.Drawing.Bitmap 类型的本地化资源。
         /// </summary>
-        internal static System.Drawing.Bitmap AddCommon
-        {
-            get
-            {
+        internal static System.Drawing.Bitmap AddCommon {
+            get {
                 object obj = ResourceManager.GetObject("AddCommon", resourceCulture);
                 return ((System.Drawing.Bitmap)(obj));
             }
         }
-
+        
         /// <summary>
         ///   查找 System.Drawing.Bitmap 类型的本地化资源。
         /// </summary>
-        internal static System.Drawing.Bitmap AddExisting
-        {
-            get
-            {
+        internal static System.Drawing.Bitmap AddExisting {
+            get {
                 object obj = ResourceManager.GetObject("AddExisting", resourceCulture);
                 return ((System.Drawing.Bitmap)(obj));
             }
         }
-
+        
         /// <summary>
         ///   查找 System.Drawing.Bitmap 类型的本地化资源。
         /// </summary>
-        internal static System.Drawing.Bitmap AddSeparator
-        {
-            get
-            {
+        internal static System.Drawing.Bitmap AddSeparator {
+            get {
                 object obj = ResourceManager.GetObject("AddSeparator", resourceCulture);
                 return ((System.Drawing.Bitmap)(obj));
             }
         }
-
+        
         /// <summary>
         ///   查找类似 ;此文件为ContextMenuManager程序的显示文本字典, 字典内换行符使用\n转义
-        ///;如果你想要帮助作者为此程序添加其他语言字典, 可在.\config\languages文件夹内制作字典文件, 
-        ///;比如英语字典保存为en-us.ini, 并给[General]\General_Language赋值 en-us 英语
+        ///;如果你想要帮助作者为此程序添加其他语言字典, 可以修改此文本并保存在.\config\languages文件夹内, 
+        ///;比如美国英语字典保存为en-US.ini, 并给[General]\Language赋值 en-US 英语
+        ///;可以在Github或Gitee上Fork该项目并提交申请给我,或者直接发送文件到邮箱[email protected]
         ///
         ///[General]
-        ///General_Language = zh-cn 简体中文
-        ///General_AppName = Windows右键管理
+        ///Language = zh-CN 简体中文
+        ///Translator = 蓝点lilac
+        ///AppName = Windows右键管理
         ///
         ///[ToolBar]
-        ///ToolBar_Home = 主页
-        ///ToolBar_Type = 文件类型
-        ///ToolBar_Rule = 其他规则
-        ///ToolBar_About = 关于
+        ///Home = 主页
+        ///Type = 文件类型
+        ///Rule = 其他规则
+        ///About = 关于
         ///
         ///[SideBar]
-        ///SideBar_File = 文件
-        ///SideBar_Folder = 文件夹
-        ///SideBar_Directory = 目录
-        ///SideBar_Background = 目录背景
-        ///SideBar_Desktop = 桌面背景
-        ///SideBar_Drive = 磁盘分区
-        ///SideBar_AllObjects = 所有对 [字符串的其余部分被截断]&quot;; 的本地化字符串。
+        ///File = 文件
+        ///Folder = 文件夹
+        ///Directory = 目录
+        ///Background = 目录背景
+        ///Desktop = 桌面背景
+        ///Drive = 磁盘分区
+        ///AllObjects = 所有对象
+        ///Computer = 此电脑
+        ///Recy [字符串的其余部分被截断]&quot;; 的本地化字符串。
         /// </summary>
-        internal static string AppLanguageDic
-        {
-            get
-            {
+        internal static string AppLanguageDic {
+            get {
                 return ResourceManager.GetString("AppLanguageDic", resourceCulture);
             }
         }
-
+        
         /// <summary>
         ///   查找 System.Drawing.Bitmap 类型的本地化资源。
         /// </summary>
-        internal static System.Drawing.Bitmap CustomType
-        {
-            get
-            {
+        internal static System.Drawing.Bitmap CustomType {
+            get {
                 object obj = ResourceManager.GetObject("CustomType", resourceCulture);
                 return ((System.Drawing.Bitmap)(obj));
             }
         }
-
+        
         /// <summary>
         ///   查找 System.Drawing.Bitmap 类型的本地化资源。
         /// </summary>
-        internal static System.Drawing.Bitmap Delete
-        {
-            get
-            {
+        internal static System.Drawing.Bitmap Delete {
+            get {
                 object obj = ResourceManager.GetObject("Delete", resourceCulture);
                 return ((System.Drawing.Bitmap)(obj));
             }
         }
-
+        
         /// <summary>
         ///   查找 System.Drawing.Bitmap 类型的本地化资源。
         /// </summary>
-        internal static System.Drawing.Bitmap Donate
-        {
-            get
-            {
+        internal static System.Drawing.Bitmap Donate {
+            get {
                 object obj = ResourceManager.GetObject("Donate", resourceCulture);
                 return ((System.Drawing.Bitmap)(obj));
             }
         }
-
+        
         /// <summary>
         ///   查找类似 ;&lt;说明&gt;:
         ///;由于ShellEx类型右键菜单的菜单名称和图标无法直接获取,只能通过制作字典给用户更直观的体验
-        ///;此文件为依赖&lt;GUID&gt;的ShellEx类型右键菜单项目的名称和图标字典,用户可自行添加字典
+        ///;此文件为依赖&lt;GUID&gt;的ShellEx类型右键菜单项目的名称和图标字典
         ///;&lt;GUID&gt;可通过右键程序内ShellEx项目&quot;复制guid&quot;获取
         ///;不带括号的&lt;GUID&gt;为字典索引
         ///
@@ -194,209 +195,171 @@
         ///
         ///;&lt;资源文件路径&gt;:
         ///;&lt;Text&gt;和&lt;Icon&gt;中的&lt;资源文件路径&gt;一般使用相对路径
-        /// [字符串的其余部分被截断]&quot;; 的本地化字符串。
+        ///;如果资源文件所在 [字符串的其余部分被截断]&quot;; 的本地化字符串。
         /// </summary>
-        internal static string GuidInfosDic
-        {
-            get
-            {
+        internal static string GuidInfosDic {
+            get {
                 return ResourceManager.GetString("GuidInfosDic", resourceCulture);
             }
         }
-
+        
         /// <summary>
         ///   查找 System.Drawing.Bitmap 类型的本地化资源。
         /// </summary>
-        internal static System.Drawing.Bitmap Home
-        {
-            get
-            {
+        internal static System.Drawing.Bitmap Home {
+            get {
                 object obj = ResourceManager.GetObject("Home", resourceCulture);
                 return ((System.Drawing.Bitmap)(obj));
             }
         }
-
+        
         /// <summary>
         ///   查找 System.Drawing.Bitmap 类型的本地化资源。
         /// </summary>
-        internal static System.Drawing.Bitmap MicrosoftStore
-        {
-            get
-            {
+        internal static System.Drawing.Bitmap MicrosoftStore {
+            get {
                 object obj = ResourceManager.GetObject("MicrosoftStore", resourceCulture);
                 return ((System.Drawing.Bitmap)(obj));
             }
         }
-
+        
         /// <summary>
         ///   查找 System.Drawing.Bitmap 类型的本地化资源。
         /// </summary>
-        internal static System.Drawing.Bitmap NewItem
-        {
-            get
-            {
+        internal static System.Drawing.Bitmap NewItem {
+            get {
                 object obj = ResourceManager.GetObject("NewItem", resourceCulture);
                 return ((System.Drawing.Bitmap)(obj));
             }
         }
-
+        
         /// <summary>
         ///   查找 System.Drawing.Bitmap 类型的本地化资源。
         /// </summary>
-        internal static System.Drawing.Bitmap Open
-        {
-            get
-            {
+        internal static System.Drawing.Bitmap Open {
+            get {
                 object obj = ResourceManager.GetObject("Open", resourceCulture);
                 return ((System.Drawing.Bitmap)(obj));
             }
         }
-
+        
         /// <summary>
         ///   查找 System.Drawing.Bitmap 类型的本地化资源。
         /// </summary>
-        internal static System.Drawing.Bitmap SeparatorItem
-        {
-            get
-            {
+        internal static System.Drawing.Bitmap SeparatorItem {
+            get {
                 object obj = ResourceManager.GetObject("SeparatorItem", resourceCulture);
                 return ((System.Drawing.Bitmap)(obj));
             }
         }
-
+        
         /// <summary>
         ///   查找 System.Drawing.Bitmap 类型的本地化资源。
         /// </summary>
-        internal static System.Drawing.Bitmap Setting
-        {
-            get
-            {
+        internal static System.Drawing.Bitmap Setting {
+            get {
                 object obj = ResourceManager.GetObject("Setting", resourceCulture);
                 return ((System.Drawing.Bitmap)(obj));
             }
         }
-
+        
         /// <summary>
         ///   查找类似 &lt;?xml version=&apos;1.0&apos; encoding=&apos;utf-8&apos; ?&gt;
-        ///&lt;!--此文件为常用右键菜单字典,如果想要添加字典,请保存为.\config\CommonItemsDic.xml后再进行添加--&gt;
-        ///
+        ///&lt;!--此文件为常用右键菜单字典,
+        ///Tip属性为鼠标悬浮在开关上时的提示信息,从每个Item节点开始, 子元素Value表示该项的注册表键值,目前仅支持REG_SZ、REG_DWORD、REG_EXPAND_SZ的键值类型,
+        ///,子元素SubKey的所有子元素是该项的子项,项名即为元素名; 每一Item项和SubKey的所有子元素的属性Default为该注册表项默认值,不放在Value\REG_SZ元素里面是为了防止与可能存在的键名为Default的键产生冲突--&gt;
         ///&lt;Data&gt;
         ///  &lt;Group RegPath=&apos;HKEY_CLASSES_ROOT\*&apos;&gt;
         ///    &lt;Shell&gt;
         ///      &lt;Item KeyName=&apos;CopyContent&apos; Tip=&apos;不需打开文件直接复制文件文本内容&amp;#x000A;非UTF-16 LE(或带BOM)编码会乱码&apos;&gt;
         ///        &lt;Value&gt;
-        ///          &lt;REG_SZ MUIVerb=&apos;复制内容到剪切板&apos; Icon=&apos;DxpTaskSync.dll,-52&apos;/&gt;
-        ///        &lt;/Value&gt;
-        ///        &lt;SubKey&gt;
-        ///          &lt;Command Default=&apos;cmd /c clip &amp;lt; &quot;%1&quot;&apos;/&gt;
-        ///        &lt;/SubKey&gt;
-        ///      &lt;/Item&gt;
-        ///      &lt;Item KeyName=&apos;TakeOwnerShip&apos;&gt;
-        ///     [字符串的其余部分被截断]&quot;; 的本地化字符串。
+        ///          &lt;REG_SZ MUIVerb=&apos;复制内容到剪切板&apos; Icon=&apos;DxpTaskSync.dll,-52&apos;/&gt; [字符串的其余部分被截断]&quot;; 的本地化字符串。
         /// </summary>
-        internal static string ShellCommonDic
-        {
-            get
-            {
+        internal static string ShellCommonDic {
+            get {
                 return ResourceManager.GetString("ShellCommonDic", resourceCulture);
             }
         }
-
+        
         /// <summary>
         ///   查找 System.Drawing.Bitmap 类型的本地化资源。
         /// </summary>
-        internal static System.Drawing.Bitmap Star
-        {
-            get
-            {
+        internal static System.Drawing.Bitmap Star {
+            get {
                 object obj = ResourceManager.GetObject("Star", resourceCulture);
                 return ((System.Drawing.Bitmap)(obj));
             }
         }
-
+        
         /// <summary>
         ///   查找 System.Drawing.Bitmap 类型的本地化资源。
         /// </summary>
-        internal static System.Drawing.Bitmap SubItems
-        {
-            get
-            {
+        internal static System.Drawing.Bitmap SubItems {
+            get {
                 object obj = ResourceManager.GetObject("SubItems", resourceCulture);
                 return ((System.Drawing.Bitmap)(obj));
             }
         }
-
+        
         /// <summary>
         ///   查找类似 &lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot; ?&gt;
-        ///&lt;!--每个程序为一个Group,Text为Group项显示文本,Guid用于判断用户是否安装此程序并决定是否显示该Group,当菜单项为常驻菜单时添加属性Common,RegPath为程序相关注册表主路径;
-        ///其相关菜单项目设置作为一个Item子元素,Item的Text为该Item项显示文本,Tag属性为鼠标悬浮在开关上时状态栏显示的相关提示信息,需要重启资源管理器生效则添加属性RestartExplorer;
+        ///&lt;!--每个程序为一个Group,Text为Group项显示文本,Guid用于判断用户是否安装此程序并决定是否显示该Group,常驻菜单时添加属性Common,RegPath为程序相关注册表主路径;
+        ///其相关菜单项目设置作为一个Item子元素,Item的Text为该Item项显示文本,Tip属性为鼠标悬浮在开关上时的提示信息,需要重启资源管理器生效则添加属性RestartExplorer;
         ///Item的子元素Rule为相关注册表内容,RegPath省略则默认为Group主路径,以\开头则为Group主路径的子项路径;ValueName为相关键名,On为启用键值,Off为禁用键值;
         ///每个Item可能受多个注册表Rule影响,按照顺序进行键值判定;程序优先判定为On,即只要所有Rule不匹配Off键值就判定为On,键值类型不符时也判定为On;
-        ///ValueKind为键值类型,默认键值类型ValueKind为REG_DWORD,为默认值时可省略,键值类型有:REG_SZ、REG_BINARY、REG_DWOR [字符串的其余部分被截断]&quot;; 的本地化字符串。
+        ///ValueKind为键值类型,默认键值类型ValueKind为REG_DWORD,为默认值时可省略,目前仅支持REG_SZ、REG_DWORD、REG_EXPAND_SZ的键值类型--&gt; [字符串的其余部分被截断]&quot;; 的本地化字符串。
         /// </summary>
-        internal static string ThirdRulesDic
-        {
-            get
-            {
+        internal static string ThirdRulesDic {
+            get {
                 return ResourceManager.GetString("ThirdRulesDic", resourceCulture);
             }
         }
-
+        
         /// <summary>
         ///   查找 System.Drawing.Bitmap 类型的本地化资源。
         /// </summary>
-        internal static System.Drawing.Bitmap TurnOff
-        {
-            get
-            {
+        internal static System.Drawing.Bitmap TurnOff {
+            get {
                 object obj = ResourceManager.GetObject("TurnOff", resourceCulture);
                 return ((System.Drawing.Bitmap)(obj));
             }
         }
-
+        
         /// <summary>
         ///   查找 System.Drawing.Bitmap 类型的本地化资源。
         /// </summary>
-        internal static System.Drawing.Bitmap TurnOn
-        {
-            get
-            {
+        internal static System.Drawing.Bitmap TurnOn {
+            get {
                 object obj = ResourceManager.GetObject("TurnOn", resourceCulture);
                 return ((System.Drawing.Bitmap)(obj));
             }
         }
-
+        
         /// <summary>
         ///   查找 System.Drawing.Bitmap 类型的本地化资源。
         /// </summary>
-        internal static System.Drawing.Bitmap Type
-        {
-            get
-            {
+        internal static System.Drawing.Bitmap Type {
+            get {
                 object obj = ResourceManager.GetObject("Type", resourceCulture);
                 return ((System.Drawing.Bitmap)(obj));
             }
         }
-
+        
         /// <summary>
         ///   查找 System.Drawing.Bitmap 类型的本地化资源。
         /// </summary>
-        internal static System.Drawing.Bitmap Types
-        {
-            get
-            {
+        internal static System.Drawing.Bitmap Types {
+            get {
                 object obj = ResourceManager.GetObject("Types", resourceCulture);
                 return ((System.Drawing.Bitmap)(obj));
             }
         }
-
+        
         /// <summary>
         ///   查找 System.Drawing.Bitmap 类型的本地化资源。
         /// </summary>
-        internal static System.Drawing.Bitmap Up
-        {
-            get
-            {
+        internal static System.Drawing.Bitmap Up {
+            get {
                 object obj = ResourceManager.GetObject("Up", resourceCulture);
                 return ((System.Drawing.Bitmap)(obj));
             }

File diff suppressed because it is too large
+ 2 - 2
ContextMenuManager/Properties/Resources/Texts/AppLanguageDic.ini


+ 5 - 1
ContextMenuManager/Properties/Resources/Texts/GuidInfosDic.ini

@@ -38,7 +38,7 @@ Icon=shell32.dll,-16769
 ;打开文件所在的位置(&I)
 [37ea3a21-7493-4208-a011-7f9ea79ce9f5]
 Text=@*,-1033
-Icon=imageres.dll,203
+Icon=explorer.exe,0
 ;兼容性疑难解答(&Y)
 [1d27f844-3a1f-4410-85ac-14651078412d]
 Text=@*,-2022
@@ -139,6 +139,10 @@ Icon=imageres.dll,-5303
 [3080f90e-d7ad-11d9-bd98-0000947b0257]
 Text=窗口转换程序
 Icon=imageres.dll,0
+[8a734961-c4aa-4741-ac1e-791acebf5b39]
+Text=联机购买音乐
+[e598560b-28d5-46aa-a14a-8a3bea34b576]
+Text=幻灯片放映
 [cb3d0f55-bc2c-4c1a-85ed-23ed75b5106b]
 Text=OneDrive
 Icon=%LocalAppData%\Microsoft\OneDrive\OneDrive.exe,0

+ 1 - 1
ContextMenuManager/Properties/Resources/Texts/ThirdRulesDic.xml

@@ -28,7 +28,7 @@ ValueKind为键值类型,默认键值类型ValueKind为REG_DWORD,为默认
       <Rule RegPath="HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer" ValueName="DelaySendToMenuBuild" On="0" Off="1"/>
       <Rule RegPath="HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer" ValueName="DelaySendToMenuBuild" On="0" Off="1"/>
     </Item>
-    <Item Text="Win10 在Microsoft Store中查找应用">
+    <Item Text="Win10、Win8 在Microsoft Store中查找应用">
       <Rule RegPath="HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Explorer" ValueName="NoUseStoreOpenWith" On="0" Off="1"/>
       <Rule RegPath="HKEY_CURRENT_USER\Software\Policies\Microsoft\Windows\Explorer" ValueName="NoUseStoreOpenWith" On="0" Off="1"/>
     </Item>

+ 1 - 1
ContextMenuManager/Properties/Settings.Designer.cs

@@ -12,7 +12,7 @@ namespace ContextMenuManager.Properties {
     
     
     [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
-    [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "16.7.0.0")]
+    [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "15.9.0.0")]
     internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
         
         private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));

+ 1 - 1
ContextMenuManager/Updater.cs

@@ -43,7 +43,7 @@ namespace ContextMenuManager
         private static void UpdateText(string filePath, string url)
         {
             string contents = GetWebString(url);
-            if(!string.IsNullOrWhiteSpace(contents))
+            if(!contents.IsNullOrWhiteSpace())
                 File.WriteAllText(filePath, contents, Encoding.UTF8);
         }
 

+ 8 - 12
README.md

@@ -7,22 +7,18 @@
 * 对上述场景右键菜单项目进行修改名称、修改图标、导航注册表位置、导航文件位置、永久删除等操作
 * 对上述场景右键菜单自定义添加项目,自定义菜单命令
 
-## 运行平台
-|系统|框架|
-|:--:|:--:|
-|Win10|.Net Framework 4.6 (Win10自带)
-|Win7|.Net Framework 3.5 (Win7自带)
-|Win8、Win8.1|未测试,理论上可直接使用Win7版
-
-## 运行截图
-* Win10<br>![](https://gitee.com/BluePointLilac/ContextMenuManager/raw/master/Win10%20Screenshot.png)
-* Win7<br>![](https://gitee.com/BluePointLilac/ContextMenuManager/raw/master/Win7%20Screenshot.png)
-
 ## 兼容性能
+* 适用于Win7、8、8.1、10系统
 * 适用于64位和32位操作系统
 * 适用于高分屏,最佳显示缩放比为150%
 * 程序支持国际化多语言显示,欢迎为此程序制作语言字典
 
+## 运行截图
+* Win10<br>![](https://gitee.com/BluePointLilac/ContextMenuManager/raw/master/Win10%20Screenshot.png)
+* Win8.1<br>![](https://gitee.com/BluePointLilac/ContextMenuManager/raw/master/Win8.1%20Screenshot.png)
+* Win8<br>![](https://gitee.com/BluePointLilac/ContextMenuManager/raw/master/Win8%20Screenshot.png)
+* Win7<br>![](https://gitee.com/BluePointLilac/ContextMenuManager/raw/master/Win7%20Screenshot.png)
+
 ## 程序图标
 * 程序主图标来自 [Easyicon][1]<br>![](https://gitee.com/BluePointLilac/ContextMenuManager/raw/master/ContextMenuManager/Properties/AppIcon.ico)
 * [程序按钮图标][2] 主要来自于 [阿里巴巴矢量图标资源库][3]
@@ -51,4 +47,4 @@
   [4]: https://github.com/BluePointLilac/ContextMenuManager/releases
   [5]: https://gitee.com/BluePointLilac/ContextMenuManager/releases
   [6]: http://www.pcmoe.net/
-  [7]: https://space.bilibili.com/34492771
+  [7]: https://space.bilibili.com/34492771

BIN
Thumbs.db


File diff suppressed because it is too large
+ 3 - 3
languages/ja-JP.ini


File diff suppressed because it is too large
+ 2 - 2
languages/zh-CN.ini


Some files were not shown because too many files changed in this diff