InstallShield 操作INI文件

时间:2014-03-15 08:21:28   收藏:0   阅读:614

1.写ini配置文件:

(写将功能1和功能2已安装写入安装目录的配置文件config.ini)

   WriteProfString (TARGETDIR^"\config.ini","Component","Feature1","TRUE");

   WriteProfString (TARGETDIR^"\config.ini","Component","Feature2","TRUE");


2.读ini配置文件:

   szFileName = TARGETDIR^"config.ini";

   szSectionName = "Component";

   szKeyName1 = "Feature1";

   szKeyName2 = "Feature2";

    GetProfString ( szFileName, szSectionName, szKeyName1, svResult1 );
    GetProfString ( szFileName, szSectionName, szKeyName2, svResult2 );

返回值svResult1和svResult2 对应Feature1和Feature2 对应值。


3.替换ini配置文件的对应键值

   ReplaceProfString ( szFileName, szSectionName, szKeyName1, svResult1, "TRUE" );
   ReplaceProfString ( szFileName, szSectionName, szKeyName2, svResult2, "FALSE" );

本文出自 “None” 博客,请务必保留此出处http://evely.blog.51cto.com/1089422/1377061

InstallShield 操作INI文件,布布扣,bubuko.com

原文:http://evely.blog.51cto.com/1089422/1377061

评论(0
© 2014 bubuko.com 版权所有 - 联系我们:wmxa8@hotmail.com
打开技术之扣,分享程序人生!