我希望我的 WIX 安装程序安静地调用 NETSH 命令以将自签名证书绑定到 IP 地址:端口。
正在调用 CAQuietExec,但 NETSH 命令失败。
MSI (s) (C4:84) [16:19:50:455]: Executing op: CustomActionSchedule(Action=customQtExecRtBindCertToPort,ActionType=3137,Source=BinaryData,Target=CAQuietExec,CustomActionData="netsh" http add sslcert ipport=0.0.0.0:8080 certhash=2B2C23C6B1334F886B9FFD827D64BDC072BBEFD7 appid={123456-7890-12345-4567-AAABBBCCCDDDFFFF})
MSI (s) (C4:8C) [16:19:50:457]: Invoking remote custom action. DLL: C:\Windows\Installer\MSI87DB.tmp, Entrypoint: CAQuietExec
MSI (s) (C4:78) [16:19:50:457]: Generating random cookie.
MSI (s) (C4:78) [16:19:50:458]: Created Custom Action Server with PID 2588 (0xA1C).
MSI (s) (C4:38) [16:19:50:477]: Running as a service.
MSI (s) (C4:38) [16:19:50:479]: Hello, I'm your 32bit Elevated custom action server.
CAQuietExec:
CAQuietExec: SSL Certificate add failed, Error: 1312
CAQuietExec: A specified logon session does not exist. It may already have been terminated.
指定的登录会话不存在。它可能已经被终止。
当我从命令外壳运行完全相同的命令时,我成功了:
>SSL Certificate successfully added
我的代码相当简单:
<CustomAction
Id="customQtExecRtBindCertToPortData"
Property="customQtExecRtBindCertToPort"
Value=""netsh" http add sslcert ipport=0.0.0.0:[RT_PORT] certhash=[CERT_THUMBPRINT] appid={123456-7890-12345-4567-AAABBBCCCDDDFFFF}"
/>
<CustomAction
Id="customQtExecRtBindCertToPort"
BinaryKey="WixCA"
DllEntry="CAQuietExec"
Execute="deferred"
Return="ignore"
Impersonate="no"
/>
我尝试在 Windows Server 2008 R2 中以提升的权限运行,但仍然收到相同的日志输出。