我已经为自动构建创建了bat文件。它是我的产品的安装程序。但问题是,在运行自动构建脚本之前,我必须手动从安装屏蔽更改产品代码。那么,有没有办法自动更改产品代码?因为除产品代码外,一切都是自动的
正如Phil所说,您可以通过COM自动化界面为Installshield执行此操作,但还有其他方法,如下所述:Installshield Build Automation。
实质上:
"[PATHHERE]ISCmdBld.exe" -p "MyInstaller.ism" -r SingleImage -y "1.0.0.13" -z ProductCode=%guid%
。
请检查以上链接 - 我从未使用过ISCmdBld.exe来选择COM自动化。我没有提供Installshield 2013,但这里有一个非常粗略的草图,说明如何使用VBScript通过COM自动化自动化最新版本2016:
' On Error Resume Next
Set isproject = CreateObject("ISWiAuto23.ISWiProject")
isproject.OpenProject "C:\InstallShield 2016 Projects\TestProject.ism", False
Set isproductconfig = isproject.AddProductConfig("MyNewProduct_1.0.16")
isproductconfig.ProductName = "MyNewProduct_1.0.16"
isproductconfig.ProductVersion = "1.0.16"
isproductconfig.ProductCode = isproject.GenerateGUID
' lots of properties to set, the above should normally suffice I think...
Set isrelease = isproductconfig.AddRelease("MyNewRelease_1.0.16")
isrelease.Compressed = True
isrelease.SetupEXE = True
' lots of properties to set...
' Save and build project
isproject.SaveProject ' For some reason the project won't save properly after it is built
isrelease.Build
isproject.SaveProject
' Report error status
WScript.Echo "Number of Build Errors: " & CStr(isrelease.BuildErrorCount)
WScript.Echo "Number of Build Warnings: " & CStr(isrelease.BuildWarningCount)
isproject.CloseProject
此脚本未经过彻底测试,奇怪的是,除非在触发构建之前保存,否则不会保存新产品配置和发行版。这可能是我混淆的简单 - 或者它可能是工具中的错误(它不会是第一个)。
把它拿走它是什么,让我们希望它让你自己解决wilburys(bug)。我认为如果你将ISWiAuto23.ISWiProject
更改为IswiAuto20.ISWiProject
以匹配Installshield 2013 COM服务器版本,它可能会运行。
至关重要的是,你必须从32-bit CScript.exe / WScript.exe
运行VBScript(不要问我为什么)。只需将C:\Windows\SysWOW64\cscript.exe
的快捷方式放在桌面上进行测试,然后将脚本拖放到其上,或者更好的是,打开命令提示符并转到C:\Windows\SysWOW64
(不管你信不信,这是32位文件夹 - 和the System32 folder is 64 bit(! ) - 仅在Windows中!)然后键入cscript.exe [FullPathToVBScript]
。显然,请记住在运行脚本之前关闭Installshield GUI中的ISM文件。
我喜欢你可以在* .ism文件中保存新版本和产品配置,这样你就可以获得已编译版本的记录。我不确定ISCmdBld.exe是做什么的。
我认为你应该使用InstallShield自动化来做这种事情,例如暴露你正在构建的MSI的ProductCode的ISWiProductConfig对象。