编写了上下文菜单项的注册表项,但没有上下文菜单项 [英] Registry keys for context menu entries written, but no context menu entries

查看:93
本文介绍了编写了上下文菜单项的注册表项,但没有上下文菜单项的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我认为这是一个非常奇怪的问题,但是无论如何...

I think this is a very weird question, but anyway...

我创建了两个C#应用程序,himgr.execimgr.exe.它们与Inno Setup一起安装,并复制到C:\Program Files [(x86)]\Imgr Suite.

I have created two C# applications, himgr.exe and cimgr.exe. They're installed with Inno Setup, and copied to C:\Program Files [(x86)]\Imgr Suite.

它们已经可以通过explorer.exe的上下文菜单条目使用了,所以我将安装程序配置为在注册表中创建一些键:

They're done to be used through a context menu entry at explorer.exe, so I configured the installator to create a few keys in the registry:

[Registry]
Root: HKLM; Subkey: "SOFTWARE\classes\jpegfile\shell\Halve size"; Flags: uninsdeletekey
Root: HKLM; Subkey: "SOFTWARE\classes\jpegfile\shell\Halve size\command"; ValueType: string; ValueName: ""; ValueData: """{app}\himgr.exe"" ""%1"""
Root: HKLM; Subkey: "SOFTWARE\classes\pngfile\shell\Halve size"; Flags: uninsdeletekey
Root: HKLM; Subkey: "SOFTWARE\classes\pngfile\shell\Halve size\command"; ValueType: string; ValueName: ""; ValueData: """{app}\himgr.exe"" ""%1"""
Root: HKLM; Subkey: "SOFTWARE\classes\giffile\shell\Halve size"; Flags: uninsdeletekey
Root: HKLM; Subkey: "SOFTWARE\classes\giffile\shell\Halve size\command"; ValueType: string; ValueName: ""; ValueData: """{app}\himgr.exe"" ""%1"""
Root: HKLM; Subkey: "SOFTWARE\classes\jpegfile\shell\Resize to custom size"; Flags: uninsdeletekey
Root: HKLM; Subkey: "SOFTWARE\classes\jpegfile\shell\Resize to custom size\command"; ValueType: string; ValueName: ""; ValueData: """{app}\cimgr.exe"" ""%1"""
Root: HKLM; Subkey: "SOFTWARE\classes\pngfile\shell\Resize to custom size"; Flags: uninsdeletekey
Root: HKLM; Subkey: "SOFTWARE\classes\pngfile\shell\Resize to custom size\command"; ValueType: string; ValueName: ""; ValueData: """{app}\cimgr.exe"" ""%1"""
Root: HKLM; Subkey: "SOFTWARE\classes\giffile\shell\Resize to custom size"; Flags: uninsdeletekey
Root: HKLM; Subkey: "SOFTWARE\classes\giffile\shell\Resize to custom size\command"; ValueType: string; ValueName: ""; ValueData: """{app}\cimgr.exe"" ""%1"""

完整的安装脚本位于此处.

注意:我也尝试过HKCR\jpegfile等,它对我有用,但是...

Note: I also tried HKCR\jpegfile etc. and it worked for me, but...

对于某些人来说,既不使用上面的脚本(使用HKLM)也不使用HKCR,这是行不通的.在尝试过该功能的6人中,有4人没有任何问题,并且按预期工作,但是对于2个人来说,它却没有.

Neither using the script above (using HKLM) nor with HKCR, for some people it doesn't work. 4 people out of 6 who have tried it haven't had any problems and it has worked as intended, but for 2 people it hasn't.

这些条目在注册表中,但是没有上下文菜单条目.

The entries were at the registry, but there were no context menu entries.

对于其中一名测试人员,jpegfile项的 Edit with GIMP 条目虽然存在于注册表中,但也未在上下文菜单中显示.另外,对于同一测试人员,上下文菜单的 Preview 条目显示为两次.

For one of the testers, the Edit with GIMP entry of the jpegfile key, although present in registry, wasn't shown in the context menu either. Also, for the same tester, the Preview entry for the context menu was shown twice.

在此线程中您了解有关程序本身和测试的更多信息. 此处.

In this thread you have more information about the program itself and the tests. A RAR file with all the files needed for the compilation of the installer is available here.

这真的让我感到担心,我们找不到任何解释为什么它不起作用.

This is really worrying me, and we can't find any explanation for why is it not working.

推荐答案

最有可能的是,与之无关的人将.gif和/或.jpg与不同于"giffile"或"jpegfile"的其他ProgId关联.

Most likely, the people whom it didn't work for have had .gif and/or .jpg associated with a different ProgId than "giffile" or "jpegfile".

您可以让Inno将注册添加到当前的ProgId关联中:

You can get Inno to add the registration to whatever the current ProgId association is like so:

[Registry]
Root: HKLM; Subkey: "SOFTWARE\Classes\{reg:HKLM\SOFTWARE\Classes\.jpg|jpegfile}\shell\Halve size"; Flags: uninsdeletekey
Root: HKLM; Subkey: "SOFTWARE\Classes\{reg:HKLM\SOFTWARE\Classes\.jpg|jpegfile}\shell\Halve size\command"; ValueType: string; ValueName: ""; ValueData: """{app}\himgr.exe"" ""%1"""
Root: HKLM; Subkey: "SOFTWARE\classes\{reg:HKLM\SOFTWARE\Classes\.png|pngfile}\shell\Halve size"; Flags: uninsdeletekey
Root: HKLM; Subkey: "SOFTWARE\classes\{reg:HKLM\SOFTWARE\Classes\.png|pngfile}\shell\Halve size\command"; ValueType: string; ValueName: ""; ValueData: """{app}\himgr.exe"" ""%1"""

对于您的其他条目,依此类推.

Abd so on for your other entries.

请记住,如果用户以后更改了文件关联(或安装了这样做的应用程序),则这些选项可能会再次消失,直到他们重新运行安装程序为止.

Bear in mind that if the user later changes their file associations (or installs an application that does so) then these options may disappear again until they re-run your installer.

这篇关于编写了上下文菜单项的注册表项,但没有上下文菜单项的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆