如何在安装过程中读取注册表项 [英] How to Read Registry Key During Installation

查看:122
本文介绍了如何在安装过程中读取注册表项的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个程序,可以添加模块"来扩展产品的功能.

这些模块要求我在安装目录下加载一个dll并更新注册表.

原始程序创建了一个注册表项调用"installDir",该注册表项包含安装路径.

我想做的就是读取该密钥并将其用作安装路径. IE.不要向用户提供安装位置的选择,只是去做就可以了.

谁能帮助我了解如何使用VS安装和部署读取注册表项并将其用作安装的安装路径?

I have a program that I can add "modules" that will extend the product''s functionality.

These modules require that I load in a dll underneath the install directory and update the registry.

The original program created a registry key call "installDir" that hold the path to the installation.

What I would like to do it to read that key and use it as the install path. I.e. don''t give the user an option on where to install to, it just goes and does it.

Can anyone help me understand how I can read a registry key using VS Setup and Deployment and use that as the install path for my installation?

推荐答案

尝试一下:

1.在VS部署项目中,选择''Launch Conditions Editor''

2.右键单击''Search Target Machine'' ,然后选择''Add Registry Search''

3.这将添加一个新的reg搜索项目,选择该项目的属性将显示:

-属性:这是您要存储检索到的值的地方
-RegKey:您需要的密钥.
-根:您希望的根蜂巢.
-值:您要测试的值.


希望这对您有帮助...
Try this out:

1. In you VS Deployment Project Select ''Launch Conditions Editor''

2. Right Click on the ''Search Target Machine'' and select ''Add Registry Search''

3. This will add a new reg search item, selecting the properties of this item will expose :

- Property : this is where you want store the retrieved value
- RegKey: the key you require.
- Root: the root hive you wish.
- Value: a value you wish to test against.


Hope this helps...


这篇关于如何在安装过程中读取注册表项的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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