打开APP
userphoto
未登录

开通VIP,畅享免费电子书等14项超值服

开通VIP
RegDBQueryKey

To call this function in a Basic MSI setup, you must first create a custom action for the entry-point function, execute the custom action in a sequence or as the result of a dialog's control event, and then build the release.

/*--------------------------------------------------------------*\

*

* InstallShield Example Script

*

* Demonstrates the RegDBQueryKey function.

*

* First, RegDBQueryKey is called to query the subkeys under the

* key KEY1. The list returned by RegDBQueryKey is displayed

* in a dialog.

*

* Then RegDBQueryKey is called to query the subkeys under the

* key KEY2. This list is also displayed in a dialog.

*

\*--------------------------------------------------------------*/

#define KEY1 "SOFTWARE"

#define KEY2 "SOFTWARE\\Microsoft"

#define TITLE "RegDBQueryKey Example"

// Include Ifx.h for built-in InstallScript function prototypes.

#include "Ifx.h"

export prototype ExFn_RegDBQueryKey(HWND);

function ExFn_RegDBQueryKey(hMSI)

STRING szMsg;

NUMBER nReturn, nItem;

LIST listSubKeys, listNames;

begin

// Disable the Back button in setup dialogs.

Disable (BACKBUTTON);

// Create the lists to hold values returned by RegDBQueryKey.

listSubKeys = ListCreate(STRINGLIST);

listNames = ListCreate(STRINGLIST);

if ((listNames = LIST_NULL) || (listSubKeys = LIST_NULL)) then

MessageBox ("Unable to create necessary lists.", SEVERE);

abort;

endif;

RegDBSetDefaultRoot(HKEY_LOCAL_MACHINE);

// Get the list of subkeys.

nReturn = RegDBQueryKey(KEY1, REGDB_KEYS, listSubKeys );

if (nReturn < 0) then

MessageBox("First call to RegDBQueryKey failed.", SEVERE);

else

szMsg = "Subkeys under " + KEY1 + " key:";

SdShowInfoList(TITLE, szMsg, listSubKeys );

endif;

// Get the list of subkeys.

nReturn = RegDBQueryKey(KEY2, REGDB_NAMES, listNames);

if (nReturn < 0) then

MessageBox("Second call to RegDBQueryKey failed.", SEVERE);

else

szMsg = "Named values under " + KEY2 + " key";

SdShowInfoList(TITLE, szMsg, listNames);

endif;

// Remove the lists from memory.

ListDestroy (listNames);

ListDestroy (listSubKeys );

end; 

本站仅提供存储服务,所有内容均由用户发布,如发现有害或侵权内容,请点击举报
打开APP,阅读全文并永久保存 查看更多类似文章
猜你喜欢
类似文章
【热】打开小程序,算一算2024你的财运
Debian更新源时出现签名无法进行验证(GPG error)
下载软件公钥问题
Installshield新版本安装时卸载旧版本的安装
Installshield 打包安装包心得
InstallShield For .Net制作.Net项目安装包之完整代码_有梦去...
Tiny语言编译器汇编完全版
更多类似文章 >>
生活服务
热点新闻
分享 收藏 导长图 关注 下载文章
绑定账号成功
后续可登录账号畅享VIP特权!
如果VIP功能使用有故障,
可点击这里联系客服!

联系客服