InstallShield Automation无法创建对象 [英] InstallShield Automation can't create object

查看:265
本文介绍了InstallShield Automation无法创建对象的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Installshield 2014和2011.我正在使用主要升级和自动构建脚本来处理构建. InstallShield是独立版本.对于两者.

I am working with Installshield 2014 and 2011. I'm using major upgrades and automated build scripts to handle the build. InstallShield is the stand alone build ver. for both.

现在Windows 2003服务器上的Installshield 2011一切正常.我可以使用自动化界面打开一个项目,更改产品代码(用于主要升级),然后在构建安装程序之前将其保存.

Now everything worked fine with Installshield 2011 on windows 2003 servers. I could use the automation interface to open a project, change the product code (for the major upgrade) then save it right before building the installer.

诸如此类的代码在vbs文件中,如下所示:

The code for such is in a vbs file as such:

Dim oISM, oGUID
Set oGUID = CreateObject("InstallShield.GUID")
Set oISM = CreateObject("IswiAuto17.ISWiProject")

oISM.OpenProject strInstallShieldProjectFile
oISM.ProductCode = "{" & oGUID.CreateGUID( ) & "}"
oISM.SaveProject : oISM.CloseProject : set oISM = Nothing

现在我们已经升级到Windows 2012服务器和InstallShield2014.我已经仔细检查过,根据InstallShield,唯一需要的更改是版本号(从17更改为21).

Now we've upgraded to windows 2012 servers and InstallShield 2014. I've double checked and according to InstallShield the only change needed is the ver number (17 changes to 21).

但是现在没有任何效果.如果我取出代码并将其放在自己的vbs文件中进行测试并运行,我将得到:

But now nothing works. If I take the code out and put it in it's own vbs file for testing and run it, I get this:

ActiveX组件无法创建对象:"InstallShield.GUID"

ActiveX component can't create object: 'InstallShield.GUID'

在google上看,我看到这是在64位模式下运行的.我在32位模式下运行cmd提示符. http://helpnet.flexerasoftware.com/installshield18helplib/AutomationInterface64Bit.htm

Looking on google I see that's from running in 64 bit mode.... but I'm not. I'm running a cmd prompt in 32 bit mode. http://helpnet.flexerasoftware.com/installshield18helplib/AutomationInterface64Bit.htm

我尝试使用以下命令调用脚本: %WINDIR%\ SYSWOW64 \ cmd.exe/c cscript

I tried calling the script with: %WINDIR%\SYSWOW64\cmd.exe /c cscript

如此处建议: 如何操作我可以在64位计算机上以32位模式运行VBScript吗?

和其他地方.这没有用,因为我遇到了同样的错误.

and other places. This did not work as I got the same error.

我尝试删除该行,因为我确定我可以用另一种方式创建Guid,然后重新运行它.

I tried removing that line as I'm sure I can create a guid another way, and reran it.

然后我在尝试创建项目时得到了以下信息: 未知的运行时错误:"CreateObject"

Then I got this when it tries to create the project: Unknown runtime error: 'CreateObject'

再次,谷歌出现了,我检查了: https://community.flexerasoftware.com/showthread.php?189788-Automation-错误

Once again google came up and I checked: https://community.flexerasoftware.com/showthread.php?189788-Automation-error

和其他几个.我尝试确保使用regsvr32注册了dll,并说它成功.但是在重新运行后,它给出了相同的错误.

and couple others. I tried ensuring the dll was registered using the regsvr32 and it said it was successful. But after rerunning, it gave the same error.

我尝试直接处理InstallShield文档中的命令,以确保没有拼写错误,但又有相同的错误.

I tried directly coping the command from the InstallShield documentation to ensure no spelling mistakes but again same error.

我什至尝试切换"sw"的大小写,如下所示: 在运行vbscript时Installshield Automation失败,错误无法出现创建对象

I even tried switching the case of the "sw" as mentioned here: Installshield Automation is failing while running vbscript with error unable to create object

同样,同样的错误.

我还尝试了切换到powershell,因为powershell易于调试和读取.

I also tried switching to powershell as powershell is much easier to debug and read.

powershell代码很简单,如下所示:

The powershell code is simple and is as follows:

$oIsm =  new-object -comobject IswiAuto21.ISWiProject

$oISM.OpenProject("$file")
$oISM.ProductCode = "{" + [guid]::NewGuid() + "}"
$oISM.SaveProject(); $oISM.CloseProject(); $oISM = $null

尽管这些人说应该这样做,但这仍然行不通: https://community.flexerasoftware.com/showthread.php?190769-使用Powershell自动化 http://blogs. flexerasoftware.com/installtalk/2011/01/getting-started-with-installshield-automation-and-powershell.html

But this also does not work despite these saying it should: https://community.flexerasoftware.com/showthread.php?190769-Automation-using-Powershell http://blogs.flexerasoftware.com/installtalk/2011/01/getting-started-with-installshield-automation-and-powershell.html

当我使用32位Powershell时,出现此错误:

When I use the 32 bit powershell I get this error:

new-object:由于以下错误,从IClassFactory创建具有CLSID {78D393F9-76E3-438C-9CAB-6664EF5FE1F2}的COM组件实例失败: HRESULT出现800a801d异常:0x800A801D.

new-object : Creating an instance of the COM component with CLSID {78D393F9-76E3-438C-9CAB-6664EF5FE1F2} from the IClassFactory failed due to the following error: 800a801d Exception from HRESULT: 0x800A801D.

如果我只运行vbs而没有cmd提示符,我还会在弹出框中看到800A801D的错误.

If I run solely the vbs without a cmd prompt I also see the error of 800A801D in a pop up box.

我该如何解决?我想使用powershell,但此时也可以使用vbs修复程序.我已经尝试了所有可以想到的方法,谷歌说我做得正确(32位powershell/cmd,注册dll,创建对象等).

How can I fix this? I'd like to use powershell but a vbs fix would help as well at this point. I have tried everything I can think of and google says I'm doing it correctly (32 bit powershell/cmd, registering the dll, creating the object, etc).

推荐答案

您是否安装了自动化界面?通常,它是一项可选功能,在安装InstallShield时会设置为不存在.

Did you install the automation interface? Typically it's an optional feature that's set to absent when you install InstallShield.

这篇关于InstallShield Automation无法创建对象的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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