Installshield构建自动化 [英] Installshield Build Automation

查看:165
本文介绍了Installshield构建自动化的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经看到许多使InstallShield构建自动化的解决方案,但是每个解决方案都存在问题.我正在使用InstallShield Professional2013.很抱歉,这个冗长的问题,但是对于解决我的问题该走哪条路,我一无所知.

I have seen many solutions for automating my InstallShield build, but I am having issues with each one. I am using InstallShield Professional 2013. Sorry for the lengthy question, but I am clueless on which direction to go to solve my issues.

1) IsCmdBld.exe -我有一个正在运行的脚本并将构建我的安装程序.但是,当安装程序运行时,我收到一条错误消息,提示"The System Administrator has set policies to prevent this installation".我不确定为什么会这样,但是如果通过设计器构建安装程序,则不会得到相同的错误消息.这是我的命令(%guid%是我生成的用于设置产品代码的Guid):

1) IsCmdBld.exe - I have a script that runs and will build my installer. BUT, when the installer runs, I get an error message that says "The System Administrator has set policies to prevent this installation". I am not sure why this is happening, but I do not get the same error message if I build the installer through the designer. Here is my command (%guid% is a Guid I generate to set the Product Code):

for /f %%i in ('"C:\Program Files\Microsoft SDKs\Windows\v7.1\Bin\uuidgen.exe"') do set guid=%%i

"C:\Program Files (x86)\InstallShield\2013 SP1 SAB\System\ISCmdBld.exe" -p "MyInstaller.ism" -r SingleImage -y "1.0.0.13" -z ProductCode=%guid%

2) InstallShield自动化接口-我遵循了许多示例,关于此的教程,但所有结果都相同.当我调用以下代码时:

2) InstallShield Automation Interface - I have followed numerous examples and tutorials on this, but all end in the same result. When I call the following code:

     var project = new ISWiAuto20.ISWiProject();

我收到此错误:

Unable to cast COM object of type 'System.__ComObject' to interface type 
'ISWiAuto20.ISWiProject'. This operation failed because the QueryInterface call 
on the COM component for the interface with IID '{872D23A7-C18D-468C-895D-1CF027E4FBB1}' 
failed due to the following error: Library not registered. 
(Exception from HRESULT: 0x8002801D (TYPE_E_LIBNOTREGISTERED)).

3) MsBuild.exe -在我的InstallShield项目文件上运行MsBuild会产生此错误:

3) MsBuild.exe - Running MsBuild on my InstallShield project file yields this error:

error NSB4025: The project file could not be loaded. Invalid character in the 
   given encoding. Line 1, position 1

推荐答案

在这些方法之间(所有方法都可行时)的选择很大程度上取决于您要与之集成的构建系统.如果使用批处理或Makefile方法,则IsCmdBld.exe可能是最简单的起点.如果您使用的是Visual Studio和TFS或MSBuild,那么您可能会有更多的运气,因为它将以构建系统可以理解的方式报告错误. (除此之外,它们在本质上是相似的.)如果在构建项目之前需要对项目进行调整,则自动化层可以扩充或替换其他方法.

The choice between these approaches (when they all work) largely depends on the build system you are trying to integrate with. If you're using a batch or makefile approach, IsCmdBld.exe is probably the easiest starting point. If you're using Visual Studio and TFS or MSBuild, you'll probably have more luck there, as it will report errors in a way the build system can understand. (Other than that, they're fundamentally similar.) If you need to make tweaks to the project before you build it, the automation layer can either augment or replace the other approaches.

但是在您的情况下,您说它们都不起作用.您做了什么诊断原因?这是我针对这些症状中的每一个采取的第一步:

But in your case you say they all don't work. What have you done to diagnose why? Here are the first steps I'd take for each of those symptoms:

  • IsCmdBuild构建的安装程序产生错误,而IDE构建的错误则不会.首先确定真正的问题是什么.查看详细日志以获取更多信息.使用可用的.msi构建两种方式,然后将结果与MsiDiff进行比较.确保您已经测试过升高的水平.根据您的发现,可能是项目,构建过程或InstallShield中的错误需要解决的问题.
  • 自动化接口产生TYPE_E_LIBNOTapped.首先,如果这是IDE计算机,请考虑修复安装.如果是独立构建的机器,则同上.如果这是一台不使用安装程序的独立构建机器,则应该(或至少应确保)存在依赖项并已注册自动化接口.其次,如Christopher Painter所述,InstallShield是32位产品,因此必须从32位上下文中调用它.如果要调用CScript来运行.vbs文件,请确保使用的是C:\Windows\SysWow64\CScript.exe.
  • MSBuild NSB4025.来自stijn的评论在很大程度上是正确的-您不能在.ism文件上调用MSBuild(尽管它可以是xml而不是二进制文件,但它与MSBuild不兼容).但是,您可以创建一个可以正常工作的.isproj文件.将项目保存在Visual Studio中,或将<InstallShield>\Support\0409\MSBuild.xml复制到(ProjectName).isproj并调整其内容;在生成的.isproj文件上调用MSBuild.可能性很大,因为构建部分在很大程度上是共享的,因此其结果将与IsCmdBuild大致相同.
  • IsCmdBuild built setups yielding an error that the IDE-build ones do not. First identify what the problem really is. Look in a verbose log for more information. Build both ways with the .msi available and compare the results with MsiDiff. Make sure you've tested elevated. Depending on what you find, it may be something to address in the project, the build process, or a bug in InstallShield.
  • Automation Interface yields TYPE_E_LIBNOTREGISTERED. First off, if this is the IDE machine, consider repairing the installation. If it's a standalone-build machine, ditto. If it's a standalone-build machine that didn't use the installation, you should, or at least you should ensure the dependencies are present and that the automation interface is registered. Secondly, as Christopher Painter noted, InstallShield is a 32-bit product so it must be invoked from a 32-bit context. If you're calling, say, CScript to run a .vbs file, make sure you're using C:\Windows\SysWow64\CScript.exe.
  • MSBuild NSB4025. The comment from stijn is largely correct - you can't call MSBuild on the .ism file (while it can be xml instead of binary, it's not MSBuild-compatible). However you can create a .isproj file that can work correctly. Save the project in Visual Studio, or copy <InstallShield>\Support\0409\MSBuild.xml to (ProjectName).isproj and tweak its contents; call MSBuild on the resulting .isproj file. Odds are strong this will have approximately the same results as IsCmdBuild, as the build portion is largely shared.

这篇关于Installshield构建自动化的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆