PDA

View Full Version : IS Automation And PowerShell



Roman1
10-23-2013, 07:57 AM
Hello,
I am trying to write an PowerShell automation wrapper for IS2013. On this PC IS2013 is installed and is used to build all setups.

The first error I see is:

===================
New-Object : COM-Class factory for Component CLSID {52BA76F5-D0A7-4F2E-BD4A-45F8F2CE6A55} can not be called
Error: 80040154 class not registered (exception HRESULT: 0x80040154
(REGDB_E_CLASSNOTREG)).
+ $m_ISWiProj = New-Object -com ISWiAuto20.ISWiProject
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : ResourceUnavailable: (:) [New-Object], COMException
+ FullyQualifiedErrorId : NoCOMClassIdentified,Microsoft.PowerShell.Commands.NewObjectCommand
===================

Below the whole ps1 script. Does anybody know, what wrong is here?

$m_ISWiProj = New-Object -com ISWiAuto20.ISWiProject
$strFile = "C:\\devX11-Installations\\test-MSI-Leer2\\test-MSI-Leer2.ism"

$m_ISWiProj.OpenProject($strFile)

$strProject = ""

ForEach ($m_Feature In $m_ISWiProj.ISWiFeatures)
{
$strProject = $strProject + "Feature: " + $m_Feature.Name + 'n'
$strProject = $strProject + "Components: "
ForEach ($m_Component In $m_Feature.ISWiComponents)
{
$strProject = $strProject + $m_Component.Name + " "
}
}
ConsoleWrite($strProject + 'n')
$m_ISWiProj.CloseProject()

Any help is wellcome.

Evan Border
10-28-2013, 09:53 AM
Hello,
I am trying to write an PowerShell automation wrapper for IS2013. On this PC IS2013 is installed and is used to build all setups.

The first error I see is:

===================
New-Object : COM-Class factory for Component CLSID {52BA76F5-D0A7-4F2E-BD4A-45F8F2CE6A55} can not be called
Error: 80040154 class not registered (exception HRESULT: 0x80040154
(REGDB_E_CLASSNOTREG)).
+ $m_ISWiProj = New-Object -com ISWiAuto20.ISWiProject
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : ResourceUnavailable: (:) [New-Object], COMException
+ FullyQualifiedErrorId : NoCOMClassIdentified,Microsoft.PowerShell.Commands.NewObjectCommand
===================

Does anybody know, what wrong is here?

Be sure to use 32-bit PowerShell. I suspect it isn't seeing the class because 64-bit PowerShell is being used.

Call PowerShell.exe from under SysWOW64 instead of System32.
Also use the -STA parameter to force single - threaded operation.