installshield修改注册表

 1.修改注册表

prototype int changreg();

function int changreg() 
    number nRootKey,nType,nSize;
    string szKey,szNumName;
    STRING szNumValue;
    int res;
begin   
    //启用IE的对未可信的ActiveX初始化...选项
    nRootKey = HKEY_CURRENT_USER;
    RegDBSetDefaultRoot (nRootKey);//置根为nRootKey
    //注册子项
    szKey="Software\\Microsoft\\Windows\\CurrentVersion\\Internet Settings\\Zones\\2";
    nType=REGDB_NUMBER;
    nSize=4;
    //注册安装路径
    szNumName="1201";
    szNumValue="0";
    res = RegDBSetKeyValueEx(szKey,szNumName,nType,szNumValue,nSize);
    if(res < 0) then
        MessageBox("允许初始化未授信ActiveX出错!", WARNING);
    endif;
   
    szNumName="1209";   //允许Scriptlet
    res = RegDBSetKeyValueEx(szKey,szNumName,nType,szNumValue,nSize);
    if(res < 0) then
        MessageBox("修改IE注册表出错!", WARNING);
    endif; 
    /*************************************************************************/
     szNumName="1201";
     szKey="Software\\Microsoft\\Windows\\CurrentVersion\\Internet Settings\\Zones\\3";
      res = RegDBSetKeyValueEx(szKey,szNumName,nType,szNumValue,nSize);
    if(res < 0) then
        MessageBox("允许初始化未授信ActiveX出错!!", WARNING);
    endif;
   
    szNumName="1209";   //允许Scriptlet
    res = RegDBSetKeyValueEx(szKey,szNumName,nType,szNumValue,nSize);
    if(res < 0) then
        MessageBox("修改IE注册表出错!", WARNING);
    endif; 
 
    return 0;
end;

 

2. 自定义带参函数

 

prototype int RunExe(STRING); //定义参数的时候不能有变量名,只要变量类型

//fileName是最终的绝对路径
function int RunExe(fileName)   //直接写参数名,很变态的语法
begin    
 
    if (LaunchAppAndWait(fileName, "", WAIT) < 0) then    //指定可执行文件,第二个参数是exe的输入参数,一般为""
      MessageBox("视屏解码库安装出错!",WARNING);     
    endif;
   
end;

 

3.判断是不是第一次安装,第一次安装 MAINTENANCE为false,如果是维护的话MAINTENANCE为true

  if ( !MAINTENANCE ) then
      MessageBox("安装", WARNING);
   endif;

评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值