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

推荐订阅源

WordPress大学
WordPress大学
月光博客
月光博客
T
Tailwind CSS Blog
Y
Y Combinator Blog
L
Lohrmann on Cybersecurity
Latest news
Latest news
H
Heimdal Security Blog
MongoDB | Blog
MongoDB | Blog
Hacker News - Newest:
Hacker News - Newest: "LLM"
阮一峰的网络日志
阮一峰的网络日志
C
CXSECURITY Database RSS Feed - CXSecurity.com
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
Google DeepMind News
Google DeepMind News
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
D
Darknet – Hacking Tools, Hacker News & Cyber Security
G
Google Developers Blog
博客园 - 三生石上(FineUI控件)
Application and Cybersecurity Blog
Application and Cybersecurity Blog
Recent Announcements
Recent Announcements
小众软件
小众软件
Security Archives - TechRepublic
Security Archives - TechRepublic
The Cloudflare Blog
T
Threatpost
S
Secure Thoughts
N
Netflix TechBlog - Medium
V2EX - 技术
V2EX - 技术
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
B
Blog
Simon Willison's Weblog
Simon Willison's Weblog
G
GRAHAM CLULEY
人人都是产品经理
人人都是产品经理
M
MIT News - Artificial intelligence
C
Cisco Blogs
C
CERT Recently Published Vulnerability Notes
爱范儿
爱范儿
SecWiki News
SecWiki News
The GitHub Blog
The GitHub Blog
有赞技术团队
有赞技术团队
MyScale Blog
MyScale Blog
P
Proofpoint News Feed
D
DataBreaches.Net
S
Security @ Cisco Blogs
B
Blog RSS Feed
N
News and Events Feed by Topic
V
Visual Studio Blog
P
Proofpoint News Feed
Last Week in AI
Last Week in AI
Hugging Face - Blog
Hugging Face - Blog
S
SegmentFault 最新的问题
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报

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