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

推荐订阅源

The Hacker News
The Hacker News
S
Schneier on Security
P
Privacy & Cybersecurity Law Blog
Cisco Talos Blog
Cisco Talos Blog
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
Attack and Defense Labs
Attack and Defense Labs
NISL@THU
NISL@THU
L
LINUX DO - 最新话题
PCI Perspectives
PCI Perspectives
Cyberwarzone
Cyberwarzone
K
Kaspersky official blog
V
Vulnerabilities – Threatpost
G
GRAHAM CLULEY
Help Net Security
Help Net Security
Scott Helme
Scott Helme
V2EX - 技术
V2EX - 技术
Security Latest
Security Latest
Recent Commits to openclaw:main
Recent Commits to openclaw:main
Hacker News: Ask HN
Hacker News: Ask HN
C
Cybersecurity and Infrastructure Security Agency CISA
O
OpenAI News
L
LINUX DO - 热门话题
T
Tor Project blog
M
MIT News - Artificial intelligence
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
GbyAI
GbyAI
Security Archives - TechRepublic
Security Archives - TechRepublic
量子位
I
InfoQ
Hacker News - Newest:
Hacker News - Newest: "LLM"
S
SegmentFault 最新的问题
Google Online Security Blog
Google Online Security Blog
P
Proofpoint News Feed
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
Application and Cybersecurity Blog
Application and Cybersecurity Blog
雷峰网
雷峰网
Cloudbric
Cloudbric
Microsoft Azure Blog
Microsoft Azure Blog
D
Docker
T
Threat Research - Cisco Blogs
Blog — PlanetScale
Blog — PlanetScale
H
Heimdal Security Blog
T
Tenable Blog
Y
Y Combinator Blog
The GitHub Blog
The GitHub Blog
云风的 BLOG
云风的 BLOG
美团技术团队
S
Secure Thoughts
Know Your Adversary
Know Your Adversary
H
Hackread – Cybersecurity News, Data Breaches, AI and More

博客园 - 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;