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

推荐订阅源

B
Blog
Blog — PlanetScale
Blog — PlanetScale
酷 壳 – CoolShell
酷 壳 – CoolShell
GbyAI
GbyAI
M
MIT News - Artificial intelligence
T
Tailwind CSS Blog
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
博客园 - 聂微东
C
Check Point Blog
云风的 BLOG
云风的 BLOG
aimingoo的专栏
aimingoo的专栏
V
Visual Studio Blog
U
Unit 42
Microsoft Azure Blog
Microsoft Azure Blog
Spread Privacy
Spread Privacy
博客园 - Franky
Vercel News
Vercel News
月光博客
月光博客
罗磊的独立博客
博客园 - 叶小钗
腾讯CDC
A
About on SuperTechFans
P
Privacy International News Feed
V
V2EX
L
LINUX DO - 最新话题
K
Kaspersky official blog
P
Privacy & Cybersecurity Law Blog
D
DataBreaches.Net
D
Darknet – Hacking Tools, Hacker News & Cyber Security
有赞技术团队
有赞技术团队
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
Stack Overflow Blog
Stack Overflow Blog
T
Tor Project blog
MyScale Blog
MyScale Blog
Y
Y Combinator Blog
G
GRAHAM CLULEY
V
Vulnerabilities – Threatpost
Recorded Future
Recorded Future
大猫的无限游戏
大猫的无限游戏
P
Proofpoint News Feed
L
LangChain Blog
C
Cyber Attacks, Cyber Crime and Cyber Security
雷峰网
雷峰网
Project Zero
Project Zero
G
Google Developers Blog
博客园 - 【当耐特】
C
Cisco Blogs
Cisco Talos Blog
Cisco Talos Blog
C
CXSECURITY Database RSS Feed - CXSecurity.com
The GitHub Blog
The GitHub Blog

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