我正在遵循Microsoft的Build a Custom Authentication Method for AD FS in Windows Server指南为ADFS构建自定义身份验证提供程序,并且在部署步骤中指出:
适配器提供程序必须提供执行以下操作的安装程序: 必要的安装操作,包括在GAC中安装,以及 安装程序必须支持在AD FS中注册。
我可以使用WiX成功地将适配器安装到GAC并使用PowerShell手动向ADFS注册,但是当尝试让WiX通过{来自动向ADFS注册提供程序时,Windows Installer出现了错误。 {1}}:CustomAction
完整日志如下所示:
Error 1721. There is a problem with this Windows Installer package. A program required for this install to complete could not be run. Contact your support personnel or package vendor.
如果我从日志中复制命令并在PowerShell中手动运行,它将成功完成。我在MSI (s) (E4:78) [10:02:27:412]: Executing op: ActionStart(Name=RegisterAdfsProvider,,)
MSI (s) (E4:78) [10:02:27:413]: Executing op: CustomActionSchedule(Action=RegisterAdfsProvider,ActionType=3106,Source=C:\,Target=Register-AdfsAuthenticationProvider -TypeName "MyAuthenticationAdapter.MyAdapter, MyAuthenticationAdapter, version=1.0.0.0, culture=neutral, publicKeyToken=D006C127CE4A16A7, processorArchitecture=MSIL" -Name MyAuthenticationProvider,)
MSI (s) (E4:78) [10:02:27:416]: Note: 1: 1721 2: RegisterAdfsProvider 3: C:\ 4: Register-AdfsAuthenticationProvider -TypeName "MyAuthenticationAdapter.MyAdapter, MyAuthenticationAdapter, version=1.0.0.0, culture=neutral, publicKeyToken=D006C127CE4A16A7, processorArchitecture=MSIL" -Name MyAuthenticationProvider
MSI (s) (E4:78) [10:02:27:416]: Note: 1: 2205 2: 3: Error
MSI (s) (E4:78) [10:02:27:416]: Note: 1: 2228 2: 3: Error 4: SELECT `Message` FROM `Error` WHERE `Error` = 1721
MSI (c) (0C:B0) [10:02:27:429]: Font created. Charset: Req=0, Ret=0, Font: Req=MS Shell Dlg, Ret=MS Shell Dlg
Error 1721. There is a problem with this Windows Installer package. A program required for this install to complete could not be run. Contact your support personnel or package vendor. Action: RegisterAdfsProvider, location: C:\, command: Register-AdfsAuthenticationProvider -TypeName "MyAuthenticationAdapter.MyAdapter, MyAuthenticationAdapter, version=1.0.0.0, culture=neutral, publicKeyToken=D006C127CE4A16A7, processorArchitecture=MSIL" -Name MyAuthenticationProvider
MSI (s) (E4:78) [10:02:28:198]: Note: 1: 2205 2: 3: Error
MSI (s) (E4:78) [10:02:28:198]: Note: 1: 2228 2: 3: Error 4: SELECT `Message` FROM `Error` WHERE `Error` = 1709
MSI (s) (E4:78) [10:02:28:198]: Product: MyAuthenticationAdapter -- Error 1721. There is a problem with this Windows Installer package. A program required for this install to complete could not be run. Contact your support personnel or package vendor. Action: RegisterAdfsProvider, location: C:\, command: Register-AdfsAuthenticationProvider -TypeName "MyAuthenticationAdapter.MyAdapter, MyAuthenticationAdapter, version=1.0.0.0, culture=neutral, publicKeyToken=D006C127CE4A16A7, processorArchitecture=MSIL" -Name MyAuthenticationProvider
Action ended 10:02:28: InstallFinalize. Return value 3.
文件中的代码如下:
.wxs
我的WiX文件怎么了,导致在安装过程中出现此错误?
答案 0 :(得分:0)
原始错误是正确的。在意识到要尝试运行的命令实际上是PowerShell Cmdlet之前,我通过几种不同的执行命令的方法进行了研究,尽管通过CustomAction的ExeCommand
属性无法执行该命令。我是通过在PowerShell中运行gcm "Register-AdfsAuthenticationProvider"
并获取以下输出来发现这一点的:
CommandType Name Version Source
----------- ---- ------- ------
Cmdlet Register-AdfsAuthenticationProvider 1.0.0.0 ADFS