用变量替换固定文本内容:左侧栏选中Files and Folders,点击顶部菜单栏的Files按钮,新建web.config的映射文件,对其中需要在安装过程中自定义的内容进行替换,切换到Attributes标签,通过[符号呼出变量筛选器;直接双击打开Mysql中的my.ini文件,用替换里面的port,basedir([AppDir])等内容;对于批处理文件,使用Text File Update,命名一定要和批处理文件名一样,并且在Replace中替换,多个不同的替换内容,需要新建多个Replace;
Custom Behavior -- Custom Actions:添加Lanch file,在File to Lanch框中输入[ ,在file中选择Mysql的两个批处理脚本,然后勾选下面的三个复选框;其中mysql安装的脚本,Exection Time选择When the system is being modified,Execution Stage Condition,去掉Uninstall和Maintenace,并在中间栏Install Excution Stage中将脚本挪至Add Resources下方;Mysql卸载的脚本,Exection
Time选择Immediately,Execution Stage Condition,去掉Install和Maintenace,并在中间栏Install Excution Stage中将脚本挪至Paths Resolution 下方