Skip to content

Commit

Permalink
fix x86 apps
Browse files Browse the repository at this point in the history
  • Loading branch information
1357310795 committed Jul 9, 2022
1 parent ab8c259 commit b4246ff
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 11 deletions.
14 changes: 7 additions & 7 deletions MyComputerManager/Helpers/NamespaceHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -66,14 +66,14 @@ public static List<NamespaceItem> GetItemsInternal(RegistryKey rootkey, bool dis
}
if (itemkey == null)
{
clsidrootkey = Registry.CurrentUser;
clsidkey = clsidrootkey.OpenSubKey(@"SOFTWARE\Classes\WOW6432Node\CLSID", false);
clsidrootkey = RegistryKey.OpenBaseKey(RegistryHive.CurrentUser, RegistryView.Registry32);
clsidkey = clsidrootkey.OpenSubKey(@"SOFTWARE\Classes\CLSID", false);
itemkey = clsidkey.OpenSubKey(item, false);
}
if (itemkey == null)
{
clsidrootkey = Registry.LocalMachine;
clsidkey = clsidrootkey.OpenSubKey(@"SOFTWARE\Classes\WOW6432Node\CLSID", false);
clsidrootkey = RegistryKey.OpenBaseKey(RegistryHive.LocalMachine, RegistryView.Registry32);
clsidkey = clsidrootkey.OpenSubKey(@"SOFTWARE\Classes\CLSID", false);
itemkey = clsidkey.OpenSubKey(item, false);
}
if (itemkey != null)
Expand All @@ -89,7 +89,7 @@ public static List<NamespaceItem> GetItemsInternal(RegistryKey rootkey, bool dis
string exepath = (string)(exekey?.GetValue("") ?? "");

if (name == "") continue;
list.Add(new NamespaceItem(name, desc, tip, exepath, iconpath, rootkey, clsidkey, disabled, item));
list.Add(new NamespaceItem(name, desc, tip, exepath, iconpath, rootkey, clsidrootkey, disabled, item));
}
}
return list;
Expand All @@ -105,7 +105,7 @@ public static CommonResult UpdateItem(NamespaceItem item)
var namespaceSubKey = namespaceKey.CreateSubKey(item.CLSID, true);
if (namespaceSubKey == null)
return new CommonResult(false, "找不到Namespace下的" + item.CLSID);
var clsidKey = item.RegKey1;
var clsidKey = item.RegKey1.CreateSubKey(@"SOFTWARE\Classes\CLSID", true);
if (clsidKey == null)
return new CommonResult(false, "找不到CLSID key");
var clsidSubKey = clsidKey.CreateSubKey(item.CLSID, true);
Expand Down Expand Up @@ -196,7 +196,7 @@ public static CommonResult DeleteItem(NamespaceItem item)
return new CommonResult(false, "找不到Namespace key");
namespaceKey.DeleteSubKeyTree(item.CLSID, false);

var clsidKey = item.RegKey1;
var clsidKey = item.RegKey1.OpenSubKey(@"SOFTWARE\Classes\CLSID", true); ;
if (clsidKey == null)
return new CommonResult(false, "找不到CLSID key");
clsidKey.DeleteSubKeyTree(item.CLSID, false);
Expand Down
2 changes: 1 addition & 1 deletion MyComputerManager/MainWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@
</StackPanel>
</Grid>

<ui:TitleBar Title="MyComputerManager - v1.01"
<ui:TitleBar Title="MyComputerManager - v1.02"
Padding="10,10,10,12"
Grid.Row="0"
Icon="/Resources/openbox.ico"
Expand Down
4 changes: 2 additions & 2 deletions MyComputerManager/Models/NamespaceItem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public NamespaceItem(string name)
{
Name = name;
RegKey = Registry.CurrentUser;
RegKey1 = Registry.CurrentUser.CreateSubKey(@"SOFTWARE\Classes\CLSID", true);
RegKey1 = Registry.CurrentUser;
isEnabled = true;
CLSID = null;
Desc = "";
Expand Down Expand Up @@ -148,7 +148,7 @@ public string RegKey_CLSID
{
get
{
return RegKey1.Name + @"\" + CLSID;
return RegKey1.Name + (RegKey1.View == RegistryView.Default ? @"\SOFTWARE\Classes\CLSID\" : @"\SOFTWARE\Classes\WOW6432Node\CLSID\") + CLSID;
}
}

Expand Down
2 changes: 1 addition & 1 deletion MyComputerManager/Views/AboutPage.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
FontSize="20" />
<TextBlock HorizontalAlignment="Center"
Margin="0,6,0,0"
Text="v1.01"
Text="v1.02"
FontSize="16" />
<TextBlock HorizontalAlignment="Center"
Margin="0,6,0,0"
Expand Down

0 comments on commit b4246ff

Please sign in to comment.