版权声明: 可以任意转载,转载时请务必以超链接形式标明文章原始出处和作者信息。
InstallShield支持通过命令行修改ism文件,相当于我们通过IDE修改工程的属性,这对于需要进行自动化编译的开发团队来说,该功能就攸关重要。
' Build path to the .ism file
strFile = "C:\<WindowsFolder>\Profiles\<UserName>\Personal\MySetups\Test.ism"
m_ISWiProject.OpenProject strFile
' perform queries and changes here
m_ISWiProject.ProductName = "ISWiProject Modified by Kevin Wan"
m_ISWiProject.ProductVersion = "1.0.1"
m_ISWiProject.SaveProject ' necessary only if modifying the project
m_ISWiProject.CloseProject
上述VBScript的Sample代码,我们打开ism文件,修改了产品名和版本。
请大家要注意,上面是InstallShield 2011的Sample代码,如果是使用InstallShield 12,则是:CreateObject("IswiAuto12.ISWiProject")
InstallShield的版本与开发版本对应的关系:
InstallShield 2011 - Ver 17
InstallShield 2010 - Ver 16
InstallShield 2009 - Ver 15
InstallShield 2008 - Ver 14
InstallShield 12 - Ver 12
InstallShield 11.5 - Ver 1150
InstallShield 11 - Ver 11
InstallShield 10.5 - Ver 1050
InstallShield X - Ver 10
InstallShield DevStudio - CreateObject("IswiAutomation9.ISWiProject")
InstallShield Developer - CreateObject("IswiAutomation.ISWiProject")
更多的内容见InstallShield帮助ISWiProject Object一节。
http://blog.csdn.net/emma_he/archive/2010/05/24/5620723.aspx
http://hi.baidu.com/xuantangtech/blog/item/cf385237ae3b2c375bb5f5a6.html