从Inno安装程序执行的PowerShell脚本失败,并显示“为具有CLSID {XXXX}的组件检索COM类工厂失败-错误80040154”。 [英] PowerShell script executed from Inno Setup is failing with "Retrieving the COM class factory for component with CLSID {XXXX} failed - error 80040154"

查看:112
本文介绍了从Inno安装程序执行的PowerShell脚本失败,并显示“为具有CLSID {XXXX}的组件检索COM类工厂失败-错误80040154”。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想使用Inno Setup将文件夹转换为具有IIS的应用程序。

I want to convert a folder to an application with IIS using Inno Setup.

我发现我可以使用PowerShell使用

I found that I can do it with PowerShell, using

ConvertTo-WebApplication 'IIS:\Sites\Default Web Site\MY_APP'

我已将其添加到我的Inno Setup脚本中:

I have added this to my Inno Setup script:

[Run]
Filename: "powershell.exe"; \
  Parameters: "-ExecutionPolicy Bypass -Command ConvertTo-WebApplication 'IIS:\Sites\Default Web Site\MY_APP'" \
  WorkingDir: {app}; Flags: runhidden 

但是PowerShell失败:

But PowerShell is failing with:


由于以下错误,检索具有CLSID {XXXX}的组件的COM类工厂失败:80040154未注册类

Retrieving the COM class factory for component with CLSID {XXXX} failed due to the following error: 80040154 Class not registered


推荐答案

作为32位应用程序中的Inno安装程序,默认情况下它将运行32位版本的PowerShell,该版本将依次使用32位COM类。

As Inno Setup in a 32-bit application, it will by default run 32-bit version of PowerShell, which in turn will use 32-bit COM classes.

ConvertTo-WebApplication 所需的COM类似乎仅对64位可用(或注册)。

The COM class needed for ConvertTo-WebApplication seems to be available (or registered) for 64-bit only.

添加 标志:64bit 使Inno Setup使用64位版本的PowerShell。

Add the Flags: 64bit to make Inno Setup use 64-bit version of PowerShell.

[Run]
Filename: "powershell.exe"; \
  Parameters: "-ExecutionPolicy Bypass -Command ConvertTo-WebApplication 'IIS:\Sites\Default Web Site\MY_APP'" \
  WorkingDir: {app}; Flags: runhidden 64bit




或使用 64位安装模式

有关类似问题,请参见从Inno设置调用.bat文件时,无法识别.bat文件中的命令,但该命令可以正常工作手动运行bat文件时很好

这篇关于从Inno安装程序执行的PowerShell脚本失败,并显示“为具有CLSID {XXXX}的组件检索COM类工厂失败-错误80040154”。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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