无法在Vista上从HKEY_LOCAL_MACHINE读取配置数据 [英] Cannot read config data from HKEY_LOCAL_MACHINE on Vista

查看:84
本文介绍了无法在Vista上从HKEY_LOCAL_MACHINE读取配置数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们有一个Java Web Start应用程序,正在尝试使用HKEY_LOCAL_MACHINE而不是HKEY_CURRENT_USER存储应用程序配置数据.我们可以让具有管理员权限的人首次启动该应用并设置配置,以便它将值成功存储在注册表中.不过,没有管理员权限的后续Vista用户似乎甚至无法从HKEY_LOCAL_MACHINE中的注册表中读取.

We have a Java Web Start application and are trying to store application configuration data using HKEY_LOCAL_MACHINE instead of HKEY_CURRENT_USER. We can get someone with admin rights to launch the app the first time and set the configuration, so that it will store the values in the registry successfully. Nevertheless, subsequent Vista users without admin privileges cannot seem to even read the values from the registry in HKEY_LOCAL_MACHINE.

也许我们的方法不正确,并且有一种更好的方法来存储应用程序配置数据.有人可以帮忙吗?

Perhaps our approach is incorrect, and there is a better way to store application configuration data. Can anyone help?

推荐答案

您的程序可能受如果32位程序尝试在HKLM\SOFTWARE下写入注册表,并且权限不允许写入成功,则启动虚拟化.程序将被告知写入成功,并且数据实际上是写入HKCU\Software\Classes\VirtualStore\MACHINE\SOFTWARE.然后,当32位程序尝试从注册表中读取时,VirtualStore文件夹中的值将返回到该程序.这样,该程序就被欺骗,以为它已成功写入了它没有权限的位置,并且32位程序可以在Vista/Windows 7下继续运行而无需进行任何更改.

If a 32-bit program attempts to write to the registry under HKLM\SOFTWARE and the permissions do not allow the write to succeed, then Virtualization kicks in. The program is told that the write was successful, and the data is actually written into HKCU\Software\Classes\VirtualStore\MACHINE\SOFTWARE. Then, when a 32-bit program attempts to read from the registry, values from the VirtualStore folder are returned to the program. This way, the program is tricked into thinking it successfully wrote to a location that it does not have permissions for, and 32-bit programs continue to work under Vista / Windows 7 without changes.

此外,由于 UAC ,管理员用户将被视为非管理员用户. -admin用户,除非有问题的程序专门以管理员权限运行.安装程序必须以管理员权限运行,这样它们才能写入HKLM区域.

Also, due to UAC, an admin user will be treated as if he was a non-admin user, unless the program in question is specifically launched to run with admin privileges. Installer programs must run with admin privileges so that they can write to the HKLM area.

这篇关于无法在Vista上从HKEY_LOCAL_MACHINE读取配置数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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