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" );