简体   繁体   English

InstallShield Automation无法创建对象

[英]InstallShield Automation can't create object

I am working with Installshield 2014 and 2011. I'm using major upgrades and automated build scripts to handle the build. 我正在使用Installshield 2014和2011。正在使用主要升级和自动构建脚本来处理构建。 InstallShield is the stand alone build ver. InstallShield是独立的构建版本。 for both. 对彼此而言。

Now everything worked fine with Installshield 2011 on windows 2003 servers. 现在,Windows 2003服务器上的Installshield 2011一切正常。 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. 我可以使用自动化界面打开一个项目,更改产品代码(用于主要升级),然后在构建安装程序之前将其保存。

The code for such is in a vbs file as such: 这样的代码在vbs文件中如下所示:

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

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

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: 如果我取出代码并将其放入自己的vbs文件中进行测试并运行,我将得到以下信息:

ActiveX component can't create object: 'InstallShield.GUID' ActiveX组件无法创建对象:“ InstallShield.GUID”

Looking on google I see that's from running in 64 bit mode.... but I'm not. 在谷歌上看,我看到这是在64位模式下运行的。。。。 I'm running a cmd prompt in 32 bit mode. 我在32位模式下运行cmd提示符。 http://helpnet.flexerasoftware.com/installshield18helplib/AutomationInterface64Bit.htm http://helpnet.flexerasoftware.com/installshield18helplib/AutomationInterface64Bit.htm

I tried calling the script with: %WINDIR%\\SYSWOW64\\cmd.exe /c cscript 我尝试使用以下脚本调用脚本:%WINDIR%\\ SYSWOW64 \\ cmd.exe / c cscript

as suggested here: How do I run a VBScript in 32-bit mode on a 64-bit machine? 如此处建议的那样: 如何在64位计算机上以32位模式运行VBScript?

and other places. 和其他地方。 This did not work as I got the same error. 这没有用,因为我遇到了同样的错误。

I tried removing that line as I'm sure I can create a guid another way, and reran it. 我尝试删除该行,因为我确定可以用另一种方式创建Guid,然后重新运行它。

Then I got this when it tries to create the project: Unknown runtime error: 'CreateObject' 然后在尝试创建项目时得到了此消息:未知的运行时错误:'CreateObject'

Once again google came up and I checked: https://community.flexerasoftware.com/showthread.php?189788-Automation-error 谷歌再次出现,我检查了: https : //community.flexerasoftware.com/showthread.php?189788-Automation-error

and couple others. 和其他人。 I tried ensuring the dll was registered using the regsvr32 and it said it was successful. 我尝试确保使用regsvr32注册了dll,并说它成功。 But after rerunning, it gave the same error. 但是在重新运行后,它给出了相同的错误。

I tried directly coping the command from the InstallShield documentation to ensure no spelling mistakes but again same error. 我尝试直接处理InstallShield文档中的命令,以确保没有拼写错误,但又出现了相同的错误。

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 我什至尝试按此处所述切换“ sw”的大小写: 运行vbscript时Installshield Automation失败,错误是无法创建对象

Again though, same error. 同样,同样的错误。

I also tried switching to powershell as powershell is much easier to debug and read. 我还尝试了切换到Powershell,因为Powershell更容易调试和阅读。

The powershell code is simple and is as follows: powershell代码很简单,如下所示:

$oIsm =  new-object -comobject IswiAuto21.ISWiProject

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

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 但是,尽管这些人说应该这样做,但这仍然无法正常工作: 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

When I use the 32 bit powershell I get this error: 当我使用32位Powershell时,出现以下错误:

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. new-object:由于以下错误,无法从IClassFactory创建具有CLSID {78D393F9-76E3-438C-9CAB-6664EF5FE1F2}的COM组件实例:800a801d HRESULT异常:0x800A801D。

If I run solely the vbs without a cmd prompt I also see the error of 800A801D in a pop up box. 如果只运行vbs而没有cmd提示符,我还会在弹出框中看到800A801D的错误。

How can I fix this? 我怎样才能解决这个问题? I'd like to use powershell but a vbs fix would help as well at this point. 我想使用powershell,但此时也可以使用vbs修复程序。 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). 我已经尝试了所有我能想到的东西,谷歌说我做得正确(32位powershell / cmd,注册dll,创建对象等)。

Did you install the automation interface? 您是否安装了自动化界面? Typically it's an optional feature that's set to absent when you install InstallShield. 通常,它是一项可选功能,在安装InstallShield时会设置为不存在。

Typically the HRESULT should tell you what's wrong, or be so generic that it doesn't help. 通常, HRESULT应该告诉您出了什么问题,或者太笼统而无济于事。 In this case, it's a bit of an enigma as I haven't found its definition anywhere. 在这种情况下,这有点像谜,因为我在任何地方都找不到它的定义。 The leading 0x800A... indicates FACILITY_CONTROL and the trailing ...801d happens to match the tail of TYPE_E_LIBNOTREGISTERED (0x8002801D) , but I don't know whether that's meaningful. 0x800A...表示FACILITY_CONTROL ,结尾的...801d恰好与TYPE_E_LIBNOTREGISTERED (0x8002801D)的尾部匹配,但我不知道这是否有意义。 Unfortunately FACILITY_CONTROL is defined by the control that issues the error, and that's not clear here. 不幸的是, FACILITY_CONTROL是由发出错误的控件定义的,此处不清楚。

Let's try to figure out what's wrong. 让我们尝试找出问题所在。 My bet is on COM registration. 我的赌注是COM注册。 If you want, you can skip to a likely fix by running regsvr32 C:\\...\\System\\ISWiAutomation21.dll . 如果需要,可以通过运行regsvr32 C:\\...\\System\\ISWiAutomation21.dll跳至可能的修复程序。

So let's follow what CreateObject("IswiAuto21.ISWiProject") will do. 因此,让我们遵循CreateObject("IswiAuto21.ISWiProject")作用。 First it has to look up the ProgID: 首先,它必须查找ProgID:

C:\>reg query HKCR\ISWiAuto21.ISWiProject\Clsid

HKEY_CLASSES_ROOT\ISWiAuto21.ISWiProject\Clsid
    (Default)    REG_SZ    {78D393F9-76E3-438C-9CAB-6664EF5FE1F2}

Then it has to look up the CLSID, and in this case, its InprocServer32 key: 然后,它必须查找CLSID,在这种情况下,还要查找其InprocServer32密钥:

C:\>reg query HKCR\Clsid\{78D393F9-76E3-438C-9CAB-6664EF5FE1F2}\InprocServer32

HKEY_CLASSES_ROOT\Clsid\{78D393F9-76E3-438C-9CAB-6664EF5FE1F2}\InprocServer32
    (Default)    REG_SZ    C:\...\ISWiAutomation21.dll
    ThreadingModel    REG_SZ    Apartment

If either of these are missing, it will be unable to find the COM server. 如果缺少任何一个,它将无法找到COM服务器。 In addition, the TypeLib subkey and the Type Library it references are both important: 此外, TypeLib子项及其引用的类型库都很重要:

C:\>reg query HKCR\Clsid\{78D393F9-76E3-438C-9CAB-6664EF5FE1F2}\Typelib

HKEY_CLASSES_ROOT\Clsid\{78D393F9-76E3-438C-9CAB-6664EF5FE1F2}\Typelib
    (Default)    REG_SZ    {92278CC1-987E-4A01-940C-47DCADF27496}


C:\>reg query HKCR\Typelib\{92278CC1-987E-4A01-940C-47DCADF27496}\1.1\0\win32

HKEY_CLASSES_ROOT\Typelib\{92278CC1-987E-4A01-940C-47DCADF27496}\1.1\0\win32
    (Default)    REG_SZ    C:\...\ISWiAutomation21.dll

If any of this information is missing, it will have to be repaired. 如果缺少任何信息,则必须对其进行修复。 The COM Server itself may need to probe several additional IDs at this point, so there's a chance that even if this subset is okay, there are others that are missing or corrupted. 此时,COM Server本身可能需要探测几个其他的ID,因此即使该子集还可以,但仍有一些其他ID丢失或损坏。 Self-registering the COM server should fix this. 自注册COM服务器应解决此问题。 So should running the installation's repair. 因此,应运行安装程序的修复。

Note that all of these queries were done using the 32-bit command C:\\Windows\\SysWow64\\reg.exe , or you can peruse the registry visually with C:\\Windows\\SysWow64\\regedit.exe . 请注意,所有这些查询都是使用32位命令C:\\Windows\\SysWow64\\reg.exe ,或者您可以使用C:\\Windows\\SysWow64\\regedit.exe直观地C:\\Windows\\SysWow64\\regedit.exe注册表。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Azure自动化图形Runbook-不能在Automation Account中将其他Runbook作为不同的canvas活动执行? - Azure Automation Graphical Runbook - Can't Execute other Runbooks in Automation Account as distinct canvas Activities? Powershell IE 自动化 - 无法设置文本区域的值 - Powershell IE Automation- Can't Set value for Text area Powershell IE 自动化 - 无法通过 ID 或 TagName 指定文本框 - Powershell IE Automation- Can't specify textbox by ID or TagName 具有System.Management.Automation的Select-Object不返回所选属性 - Select-Object with System.Management.Automation doesn't return selected properties 为什么我可以使用 [pscustomobject] 而不是 [System.Management.Automation.PSCustomObject] 创建对象? - How come I can create objects with [pscustomobject] but not [System.Management.Automation.PSCustomObject]? 在使用Azure自动化指定时间后,是否有一些代码可以创建文件共享快照并删除其中的一些? - Is there some codes can create file share snapshots and delete some of them after appoint time with Azure Automation? Azure自动化-为什么我不能在图形化PowerShell工作流运行手册上添加PowerShell运行手册 - Azure Automation - Why can't I add a PowerShell Runbook on a Graphical PowerShell Workflow Runbook 如何在安装InstallShield 2013的安装程序中包含KB2670838? - How can I include KB2670838 in an installer with InstallShield 2013? nConvert无法创建文件 - nConvert Can't create file 损坏的IE对象(带有Powershell的IE自动化) - Corrupt IE object (IE automation with Powershell)
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM