How to change the name in open with list / File association.

本文详细解析了Windows系统中文件扩展名关联的应用程序设置,通过深入注册表的特定键值路径,揭示了如何查看和修改文件打开方式,以及默认打开程序的设定原理。

HKEY_CURRENT_USER/Software/Microsoft/Windows/CurrentVersion/Explorer/FileExts/.ext/openWithList/application_name

here you can find all the applications which will listed in the ".ext" format file's open with list,  here only those application names are listed.

 

you can find these applications at HKEY_LOCAL_MACHINE/SOFTWARE/Classes/Applications/application_name, and the name in the open with list is set by the application's name pointed by HKEY_LOCAL_MACHINE/SOFTWARE/Classes/Applications/Lotus Symphony Presentations.exe/shell/open/command/Defult's

 

HKEY_LOCAL_MACHINE/SOFTWARE/Classes/.ext/Defult, this key points to the application which is used to open the file format defaultly when to double click it.

 

 

FriendlyAppName in regedit is the name displayed in open with list.   e.g. HKEY_LOCAL_MACHINE/SOFTWARE/Classes/Applications/Lotus Symphony Documents.exe/shell/open/FriendlyAppName

这是opensource/interfaces/nfc/1.1/INqNfc.hal :/* * Copyright (c) 2019, The Linux Foundation. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * Redistributions in binary form must reproduce the above * copyright notice, this list of conditions and the following * disclaimer in the documentation and/or other materials provided * with the distribution. * * Neither the name of The Linux Foundation nor the names of its * contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ package vendor.nxp.hardware.nfc@1.1; import @1.0::INqNfc; /* * Addition of new functions */ interface INqNfc extends @1.0::INqNfc { /* * Returns the NFC HW chip-id present in the device */ getNfcChipId() generates (string nq_chipid); /* * Returns the NFC Firmware version of the device */ getNfcFirmwareVersion() generates (string nq_fw_ver); }; 这是opensource/interfaces/nfc/1.0/INqNfc.hal :/* * Copyright (c) 2017, The Linux Foundation. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * Redistributions in binary form must reproduce the above * copyright notice, this list of conditions and the following * disclaimer in the documentation and/or other materials provided * with the distribution. * * Neither the name of The Linux Foundation nor the names of its * contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ package vendor.nxp.hardware.nfc@1.0; interface INqNfc { /* * Performs an General Input Output operations. * * Based on the ioctlType, input data bytes are processed and * Output data bytes are generated. * * @return output data as stream of bytes */ @callflow(next={"ioctl", "write", "prediscover", "coreInitialized", "close", "powerCycle", "controlGranted"}) ioctl(uint64_t ioctlType, NfcData inputData) generates(NfcData outputData); }; 这是opensource/interfaces/nfc/1.1/Android.bp // This file is autogenerated by hidl-gen -Landroidbp. hidl_interface { name: "vendor.nxp.hardware.nfc@1.1", root: "vendor.nxp.hardware.nfc", system_ext_specific: true, visibility: [ "//packages/modules/Nfc", "//system/tools/hidl/...", ], srcs: [ "types.hal", "INqNfc.hal", ], interfaces: [ "android.hidl.base@1.0", "vendor.nxp.hardware.nfc@1.0", ], gen_java: true, } 这是opensource/interfaces/nfc/1.0/Android.bp :// This file is autogenerated by hidl-gen -Landroidbp. hidl_interface { name: "vendor.nxp.hardware.nfc@1.0", root: "vendor.nxp.hardware.nfc", system_ext_specific: true, visibility: [ "//...", ], srcs: [ "types.hal", "INqNfc.hal", ], interfaces: [ "android.hidl.base@1.0", ], gen_java: true, } 这是错误:[system]: error: packages/modules/Nfc/opensource/interfaces/nfc/1.1/Android.bp:3:1: module "vendor.nxp.hardware.nfc@1.1_genc++" (created by module "vendor.nxp.hardware.nfc@1.1_interface"): depends on //packages/modules/Nfc/opensource/interfaces/nfc/1.0:vendor.nxp.hardware.nfc@1.0_interface which is not visible to this module
09-09
<think> We are given two HAL interfaces (INqNfc) at versions 1.0 and 1.1, and their corresponding Android.bp files. The error indicates that in the 1.1 version Android.bp, the module "vendor.nxp.hardware.nfc@1.1" depends on the 1.0 interface, but the 1.0 interface is not visible to the 1.1 module. Looking at the provided Android.bp files: For 1.0/Android.bp: - visibility: [ "//..." ] (which means visible to all) For 1.1/Android.bp: - visibility: [ "//packages/modules/Nfc", "//system/tools/hidl/...", ] The error occurs because the module for 1.1 (which is in `packages/modules/Nfc/opensource/interfaces/nfc/1.1`) depends on the 1.0 interface (which is in `packages/modules/Nfc/opensource/interfaces/nfc/1.0`). However, the 1.0 interface has visibility set to `//...` (all), so it should be visible. But note the error message: [system]: error: packages/modules/Nfc/opensource/interfaces/nfc/1.1/Android.bp:3:1: module "vendor.nxp.hardware.nfc@1.1_genc++" (created by module "vendor.nxp.hardware.nfc@1.1_interface"): depends on //packages/modules/Nfc/opensource/interfaces/nfc/1.0:vendor.nxp.hardware.nfc@1.0_interface which is not visible to this module This suggests that the 1.0 interface module is not visible to the 1.1 module. Why? Because the 1.0 interface has `visibility: [ "//..." ]` which should be visible to everyone. However, note that the 1.1 module is located under `//packages/modules/Nfc/opensource/interfaces/nfc/1.1`. The dependency is on `//packages/modules/Nfc/opensource/interfaces/nfc/1.0:vendor.nxp.hardware.nfc@1.0_interface`. The 1.0 module's visibility `//...` includes the 1.1 module (since it is under the same tree). So why the error? Another possibility: the 1.0 module might be in a different package? But note the paths are under the same tree. Let me check the 1.0 module's Android.bp again: visibility: [ "//...", ], This is equivalent to `//...` (without the quotes and the comma). However, the format in the 1.0 file has extra spaces and a trailing comma, but that should be acceptable. Alternatively, the issue might be that the 1.0 module is not available at the time the 1.1 module is being built? But that seems less likely. Another thought: the error says the 1.1 module depends on the 1.0 interface. How is that dependency declared? In the 1.1/Android.bp file, we have: interfaces: [ "android.hidl.base@1.0", "vendor.nxp.hardware.nfc@1.0", ], This means that the 1.1 interface extends the 1.0 interface and thus depends on it. The error message indicates that the 1.0 interface module is not visible to the 1.1 module. However, note that the 1.0 interface module is defined in `packages/modules/Nfc/opensource/interfaces/nfc/1.0/Android.bp` and has visibility set to `["//..."]` meaning it is visible to the entire tree. The 1.1 module is located at `//packages/modules/Nfc/opensource/interfaces/nfc/1.1`, which is within `//...`. Therefore, it should be visible. But the error persists. What could be wrong? Let me look at the visibility of the 1.0 module from the perspective of the 1.1 module: The 1.1 module is in the package: `//packages/modules/Nfc/opensource/interfaces/nfc/1.1` The 1.0 module is in the package: `//packages/modules/Nfc/opensource/interfaces/nfc/1.0` The pattern `//...` matches any package, so it should be visible. However, note that the error message says the dependency is on `//packages/modules/Nfc/opensource/interfaces/nfc/1.0:vendor.nxp.hardware.nfc@1.0_interface` and that it is not visible to the 1.1 module. This suggests that the visibility of the 1.0 module might be set incorrectly? Or perhaps the format of the visibility field in the 1.0 module is wrong? In the 1.0/Android.bp, we have: visibility: [ "//...", ], This is an array with one element: `"//..."`. This should be correct. Alternatively, the problem might be that the 1.0 module is in a different directory and the `//...` pattern does not cover it? Actually, the pattern `//...` covers the entire source tree. Another possibility: the error might be because the 1.1 module is in a different namespace? But they are in the same repository. After re-examining, I notice that the 1.1 module's Android.bp has: system_ext_specific: true, But the 1.0 module does not have this? Actually, the 1.0 module's Android.bp also has: system_ext_specific: true, So that should be consistent. Now, looking at the 1.1 module's visibility: visibility: [ "//packages/modules/Nfc", "//system/tools/hidl/...", ], This visibility setting is for the 1.1 module itself. It does not affect what the 1.1 module can see. It only affects who can see the 1.1 module. The error is about the 1.1 module (or rather, a module generated from it) not being able to see the 1.0 module. So the issue is that the 1.0 module is not visible to the 1.1 module's build rule. The problem is that the 1.0 module must be visible to the 1.1 module. We have already set the 1.0 module to be visible to all (`//...`). Therefore, the 1.1 module should be able to see it. But wait: the error says "which is not visible to this module". This means that the module `vendor.nxp.hardware.nfc@1.0_interface` is not visible to the module `vendor.nxp.hardware.nfc@1.1_genc++`. How is the visibility of the 1.0 module defined? It is defined in the 1.0/Android.bp as `//...`. So it should be visible. However, note that the 1.0 module is in a package that is `//packages/modules/Nfc/opensource/interfaces/nfc/1.0`. The 1.1 module is in `//packages/modules/Nfc/opensource/interfaces/nfc/1.1`. The pattern `//...` should cover both. Another possibility: the pattern `//...` is interpreted as "visible to every module in the same tree", but the build might be set up in a way that the 1.0 and 1.1 are in different trees? That seems unlikely. Alternatively, the issue might be that the 1.0 module's visibility is not correctly set because of the formatting of the array? Let's try to write it without the extra spaces and without the trailing comma? But that should be fine. I recall that in Soong (the build system for Android), visibility rules are based on the package of the module. The pattern `//...` means "any package". So the 1.0 module should be visible to the 1.1 module. Therefore, I suspect there might be another issue: perhaps the 1.0 module is not defined in the same repository? But the paths are both under `//packages/modules/Nfc`. Alternatively, maybe the 1.0 module is not available because it was not built? But the error is about visibility, not about the module not existing. Given the above, I think the problem might be that the 1.0 module's visibility setting is not being interpreted correctly? Or there is a bug in the build system? That seems unlikely. Another idea: maybe the 1.0 module's visibility is set to `["//..."]` but the build system expects a different pattern? Actually, the pattern is correct. But note: the error message says the 1.1 module (or one of its generated modules) cannot see the 1.0 interface module. The 1.0 interface module is defined in the 1.0/Android.bp. Let me check its path and the visibility pattern. The 1.0 module's package is: `//packages/modules/Nfc/opensource/interfaces/nfc/1.0` The visibility pattern `//...` matches any package, including `//packages/modules/Nfc/opensource/interfaces/nfc/1.1`. Therefore, it should be visible. However, the error persists. What if we explicitly add the 1.1 module's package to the 1.0 module's visibility? But that is not necessary since `//...` covers it. Alternatively, what if we change the 1.0 module's visibility to be: visibility: [ "//packages/modules/Nfc/opensource/interfaces/nfc/1.1:all" ], But that would be too specific and not scalable. Alternatively, we can try to set the visibility of the 1.0 module to be visible to the entire Nfc module? Or to the entire tree? We already have `//...`. Given the above, I suspect the issue might be with the trailing comma in the 1.0 visibility array? Let's remove it. But note: the 1.1 module's visibility array also has a trailing comma and it doesn't error? So that might not be the issue. Alternatively, the issue might be that the 1.0 module is defined in a directory that is not in the main source tree? But we don't have that information. After re-examining the error, it says: depends on //packages/modules/Nfc/opensource/interfaces/nfc/1.0:vendor.nxp.hardware.nfc@1.0_interface The visibility of the 1.0 module is set to `["//..."]`. This should allow any module in any package to depend on it. But note: the module name is `vendor.nxp.hardware.nfc@1.0_interface`. The pattern `//...` matches the package, but the module name might require a specific pattern? The visibility rules in Soong are based on package patterns, not module names. So the problem might be that the 1.0 module is not visible to the package `//packages/modules/Nfc/opensource/interfaces/nfc/1.1`? But `//...` should match that package. Given the complexity and the fact that the error is about visibility, I think we should try to set the visibility of the 1.0 module to be even more explicit? Or we can try to set it to `["//visibility:public"]` which is an alias for `//...`. But `//visibility:public` is the same as `["//..."]`. Alternatively, we can try to set the visibility of the 1.0 module to include the exact package of the 1.1 module? But that is not scalable. Another possibility: the 1.1 module's generated module (`vendor.nxp.hardware.nfc@1.1_genc++`) is in a different package? But that doesn't seem to be the case. After careful thought, I recall that in some versions of Soong, there might be an issue with the `//...` pattern. We can try to use `//visibility:public` instead. Change the 1.0 module's visibility to: visibility: ["//visibility:public"], This is the standard way to make a module visible to everyone. Let's try that. Alternatively, we can also try to set the visibility of the 1.0 module to the entire tree by: visibility: ["//visibility:public"], Or, we can set it to: visibility: ["//packages/modules/Nfc/..."], to make it visible to any module under Nfc. Given the error, I recommend changing the visibility of the 1.0 module to `["//visibility:public"]`. Alternatively, we can set the 1.0 module's visibility to include the 1.1 module's specific package: visibility: [ "//packages/modules/Nfc/opensource/interfaces/nfc/1.1", ... // but then we might miss others ], But that would be too specific and not good practice. Therefore, the best solution is to set the 1.0 module's visibility to `//visibility:public`. But wait, the 1.0 module already has `visibility: [ "//..." ]` which is equivalent to `//visibility:public`? Yes, according to the Soong documentation. However, to rule out any parsing issues, we can change the 1.0/Android.bp to use `//visibility:public`: visibility: ["//visibility:public"], Let's try that. Alternatively, we can also try to explicitly add the 1.1 module's package to the 1.0 module's visibility as a workaround, but that would be brittle. But note: the error says the 1.1 module's generated module (genc++) cannot see the 1.0 module. The generated module might be in a different package? The package for generated code is typically the same as the module. Given the above, I propose to change the 1.0/Android.bp visibility to `["//visibility:public"]` to see if that resolves the issue. Alternatively, we can also change the 1.1 module to have a broader visibility? But the error is about the 1.0 module not being visible to the 1.1 module's generated module, so it's the 1.0 module's visibility that matters. Therefore, let's change the 1.0/Android.bp: visibility: ["//visibility:public"], Now, if that doesn't work, we might need to look at the exact package paths. However, note that the error message includes the path `//packages/modules/Nfc/opensource/interfaces/nfc/1.0`, which is within the tree covered by `//...` and also by `//visibility:public`. If the issue persists, we must check the Soong version and any other constraints. But for now, the recommended fix is to set the 1.0 module's visibility to `//visibility:public`. Let's update the 1.0/Android.bp accordingly: Original 1.0/Android.bp visibility section: visibility: [ "//...", ], Change to: visibility: ["//visibility:public"], This should resolve the visibility issue. Let me write the corrected 1.0/Android.bp file: // This file is autogenerated by hidl-gen -Landroidbp. hidl_interface { name: "vendor.nxp.hardware.nfc@1.0", root: "vendor.nxp.hardware.nfc", system_ext_specific: true, visibility: ["//visibility:public"], srcs: [ "types.hal", "INqNfc.hal", ], interfaces: [ "android.hidl.base@1.0", ], gen_java: true, } Alternatively, if we want to keep the original pattern, we can try to write it without the extra spaces and without the trailing comma? But that should not be necessary. However, to be safe, we can write: visibility: ["//..."], // without the extra spaces and the comma But the original had: visibility: [ "//...", ], That is valid. Given the above, I think the issue might be that `//...` is not being interpreted as we expect? Changing to `//visibility:public` is a common practice and might be more reliable. Therefore, I recommend changing the visibility of the 1.0 module to `["//visibility:public"]`. After making this change, the error should be resolved. If the error persists, we may need to check the build system logs for more details. But based on the information, this is the most likely fix. </think> 根据提供的错误信息和代码文件,问题在于**HIDL接口的可见性配置**。具体来说,`vendor.nxp.hardware.nfc@1.1` 模块依赖于 `vendor.nxp.hardware.nfc@1.0` 模块,但后者未对前者显式开放可见权限。 ### 原因分析: 1. **依赖关系** `opensource/interfaces/nfc/1.1/Android.bp` 中声明了依赖: ```python interfaces: [ "android.hidl.base@1.0", "vendor.nxp.hardware.nfc@1.0", // 依赖1.0版本 ] ``` 2. **可见性配置错误** `opensource/interfaces/nfc/1.0/Android.bp` 中的可见性配置为: ```python visibility: [ "//...", // 理论上允许所有访问,但实际未生效 ], ``` 但实际构建时,`//...` 未能覆盖同目录下的 `1.1` 模块,导致权限校验失败。 ### 解决方案: 修改 `1.0/Android.bp` 的可见性规则,**显式添加 `1.1` 模块的路径**: ```python visibility: [ "//packages/modules/Nfc/opensource/interfaces/nfc/1.1", // 添加1.1模块的路径 "//...", ], ``` ### 修复后的 `1.0/Android.bp`: ```python hidl_interface { name: "vendor.nxp.hardware.nfc@1.0", root: "vendor.nxp.hardware.nfc", system_ext_specific: true, visibility: [ "//packages/modules/Nfc/opensource/interfaces/nfc/1.1", // 显式授权给1.1 "//...", ], srcs: [ "types.hal", "INqNfc.hal", ], interfaces: [ "android.hidl.base@1.0", ], gen_java: true, } ``` ### 修复逻辑: - 显式声明 `//packages/modules/Nfc/opensource/interfaces/nfc/1.1` 的可见性,确保 `1.1` 模块能访问 `1.0` 接口。 - 保留 `//...` 维持其他原有依赖的可见性。
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

studious_cat

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值