一、命令行模式编译,需要注意以下几点:
1.首先需要将C:\Program Files (x86)\InstallShield\2010\System\FrmWrkLib.dll文件重命名,否则无法进行命令行编译
2.如果你的installshield没有激活(这里指官方激活,如果已激活,则这条可以忽略不看),那么你也是无法在命令行编译的,此时需要替换ISWIBuild.dll文件,可从这里下载:ISWIBuild.dll
3.更改版本号,每次发布版本都需要更改软件版本号,查看installshield官方帮助文档,说是通过-y或-z参数可以修改版本号,但是试过之后并没有什么乱用,不知道是不是因为软件未激活的原因,因此只能通过脚本来更改版本号了,以下是用python更改版本号的脚本,可供参考
################################
#
# change_version.py
#
###############################
import sys
# change version of source code
with open('C:\Program Files (x86)\Jenkins\workspace\myproject\config.conf','r') as r:
lines=r.readlines()
with open('C:\Program Files (x86)\Jenkins\workspace\myproject\config.conf','w') as w:
for l in lines:
w.write(l.replace('1.0.0.1',sys.argv[1]))
# change version of installshield
with open('C:\InstallShield 2010 Projects_myproject\myproject.ism','r') as r:
lines=r.readlines()
with open('C:\InstallShield 2010 Projects_myproject\myproject.ism','w') as w:
for l in lines:
w.write(l.replace('1.0.0.1',sys.argv[1]))
sys.exit()
当然,还有一种更方便的替换方法,那就是适用powershell(刚才吃晚饭,突然想起了这个东东),这个一般系统都是自带的,直接适用即可
powershell -Command "(gc myproject.ism) -replace 'foo', 'bar' | Out-File myproject.ism"
二、使用IsCmdBld.exe以及ReleasePackager.exe进行编译
"C:\Program Files (x86)\InstallShield\2010\System\ISCmdBld.exe" -p "C:\InstallShield 2010 Projects_myproject\myproject.ism" -r "Release" -c COMP -a "Media"
此过程是对安装包进行编译,编译完成后还需要用ReleasePackager.exe进行压缩,做成最终安装包
"C:\Program Files (x86)\InstallShield\2010\System\ReleasePackager.exe" "C:\InstallShield 2010 Projects_myproject\myproject\Media\Release\Disk Images" "C:\packages\myproject.exe" "C:\InstallShield 2010 Projects_myproject\myproject\source\myproject.ico"
具体使用方法可直接执行IsCmdBld.exe或ReleasePackager.exe查看使用方法,也可在installshield自带帮助文档中查看,位置在C:\Program Files (x86)\InstallShield\2010\Program\0409\HelpLib.chm