惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

AI
AI
G
Google Developers Blog
T
Tailwind CSS Blog
大猫的无限游戏
大猫的无限游戏
量子位
月光博客
月光博客
美团技术团队
阮一峰的网络日志
阮一峰的网络日志
罗磊的独立博客
T
The Exploit Database - CXSecurity.com
C
CXSECURITY Database RSS Feed - CXSecurity.com
Latest news
Latest news
P
Privacy International News Feed
www.infosecurity-magazine.com
www.infosecurity-magazine.com
WordPress大学
WordPress大学
博客园 - 三生石上(FineUI控件)
TaoSecurity Blog
TaoSecurity Blog
Hacker News: Ask HN
Hacker News: Ask HN
Hugging Face - Blog
Hugging Face - Blog
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
C
Cisco Blogs
Project Zero
Project Zero
Security Latest
Security Latest
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
人人都是产品经理
人人都是产品经理
Scott Helme
Scott Helme
S
Securelist
有赞技术团队
有赞技术团队
T
Threat Research - Cisco Blogs
N
News | PayPal Newsroom
博客园 - 聂微东
小众软件
小众软件
S
SegmentFault 最新的问题
D
Darknet – Hacking Tools, Hacker News & Cyber Security
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
P
Privacy & Cybersecurity Law Blog
博客园 - Franky
Cyberwarzone
Cyberwarzone
Cisco Talos Blog
Cisco Talos Blog
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
Spread Privacy
Spread Privacy
A
Arctic Wolf
S
Security @ Cisco Blogs
The Hacker News
The Hacker News
腾讯CDC
博客园 - 【当耐特】
T
Troy Hunt's Blog
NISL@THU
NISL@THU
爱范儿
爱范儿

博客园 - Leon0812

Export csv Export Excel Jquery pluign development example XML Mail Template Management Resource file management Excel Reader iframe 中显示内嵌页的局部 - Leon0812 - 博客园 easyslider - Leon0812 - 博客园 缩放页面字体 可编辑DIV - Leon0812 - 博客园 vs快捷键大全(转) SQL文件執行 利用IHttpModule、IHttpHandler做授权类 - Leon0812 - 博客园 C#调用非托管的DLL 无缝滚动 - Leon0812 - 博客园 获取-编译-打包 VS作业一条龙批处理 Reporting Service for SQL 2008匿名访问报表方法 獲取控件位置 - Leon0812 - 博客园 publish
Installscript中修改web.config - Leon0812 - 博客园
Leon0812 · 2009-12-13 · via 博客园 - Leon0812

代码修改web.config

#include "ifx.h"

export prototype LoadReportTool(HWND); 
export prototype InstallFW(HWND); 
export prototype Update_WebConfig(HWND); 

//Launch the report publishing tool               
function LoadReportTool(hMSI)
begin
    LaunchApp(TARGETDIR
^"Report Tool\\RSExplorer.exe","");
end;    
  
  
  
  
//check the dot net framework  
function InstallFW(hMSI) 
    
NUMBER nvType,nvSize;
    STRING svvalue,szKey,szName,checkText,preText;
begin            
    szKey
="SOFTWARE\\Microsoft\\NET Framework Setup\\NDP\\v3.5";
    szName
="Version";
    RegDBSetDefaultRoot(HKEY_LOCAL_MACHINE);

    RegDBGetKeyValueEx(szKey,szName,nvType,svvalue,nvSize);

if(svvalue != "3.5.30729.01") then
        
//MessageBox("Dot Net FW has been installed!",INFORMATION);
    
//else     
        
//MessageBox("Dot Net FW is not installed!",INFORMATION);
        
//LaunchApp(TARGETDIR^"FW\\dotnetfx35setup.exe",""); 
          
//if   (LaunchAppAndWait(TARGETDIR^"FW\\dotnetfx35setup.exe",   "",   WAIT)   <   0)   then   
    
          
//          MessageBox   ("Unable   to   launch  .",SEVERE);   
    
          
//    endif; 
          preText 
= "IIS ";
    endif;
             
     
if (preText = "") then
        checkText 
= "竒杆IIS ㎝.Net Framework 3.5";
     
else
         checkText 
=  "﹟ゼ杆"^preText;
     endif;     
        
     MsiSetProperty(hMSI,"CheckSetting", checkText);
end;//Encrypt the SQL login user's Password  and update other info
function Update_WebConfig(hMSI)  
     OBJECT oNode;
     OBJECT oDom;
     number nvBuff, nTemp ; 
     string strFSName;  
     OBJECT nodeServer,nodeDatabase,nodeUserName,nodePassword;
     string strServer,strDatabase,strUserName,strPassword;
     STRING netDllPath;             
     OBJECT objNetDll;
begin  
    try   
         nvBuff = 256;
         set oDom = CreateObject( "MSXML.DOMDocument" );
         strFSName = INSTALLDIR^"web.config"; 
         oDom.Load(strFSName);
         
         MsiGetProperty(hMSI,"IS_SQLSERVER_SERVER",strServer,nvBuff);    
         set nodeServer = oDom.selectSingleNode("/configuration/appSettings/add[@key=
'DatabaseServerAddress']");
         nodeServer.Attributes.getNamedItem("value").nodeValue = strServer;

         MsiGetProperty(hMSI,"IS_SQLSERVER_DATABASE",strDatabase,nvBuff);    
         set nodeDatabase = oDom.selectSingleNode("/configuration/appSettings/add[@key=

'Database']");
         nodeDatabase.Attributes.getNamedItem("value").nodeValue = strDatabase;

         MsiGetProperty(hMSI,"IS_SQLSERVER_USERNAME",strUserName,nvBuff);    
         set nodePassword = oDom.selectSingleNode("/configuration/appSettings/add[@key=

'MSQLUserID']");
         nodePassword.Attributes.getNamedItem("value").nodeValue = strUserName;

         MsiGetProperty(hMSI,"IS_SQLSERVER_PASSWORD",strPassword,nvBuff);    
          
          //use .net dll to encrypt the password
          netDllPath = TARGETDIR^"Net DLL\\ENPWD.dll"; 
         set objNetDll = CoCreateObjectDotNet(netDllPath,"NetMethod.EnDecryptPWD");
          strPassword = objNetDll.EngEncrypt(strPassword);
           
          set nodeUserName = oDom.selectSingleNode("/configuration/appSettings/add[@key=

'MSQLUserPW']");
         nodeUserName.Attributes.getNamedItem("value").nodeValue = strPassword;
         
         
         oDom.save(strFSName); 
    catch  
         nTemp = Err.Number;
            /* Handle the exception based on its cause. */
    endcatch;  
 
    set nodeServer = NOTHING; 
    set nodeDatabase = NOTHING;
    set nodeUserName = NOTHING;
    set nodePassword = NOTHING;
    set oDom = NOTHING;  

end;