执行 inetsrv\appcmd 时,CAQuietExec 在 WiX 安装程序中失败

发布于 2024-08-22 08:57:53 字数 8355 浏览 4 评论 0原文

我正在 WiX 中编写一些 CustomActions 以将 web.config 从 IIS6 迁移到 IIS7,但出现错误。但是,如果我从安装日志文件复制并粘贴失败的命令,它就会成功。这是日志文件中指示错误的部分。您将看到前两个 appcmd 成功,但最后一个迁移命令失败。

Action 10:43:52: UnlockModulesCmd. 
Action start 10:43:52: UnlockModulesCmd.
MSI (s) (80:44) [10:43:52:631]: PROPERTY CHANGE: Adding QtExecCmdLine property. Its value is '"C:\Windows\system32\inetsrv\appcmd" unlock config -section:system.webServer/modules'.
Action ended 10:43:52: UnlockModulesCmd. Return value 1.
MSI (s) (80:44) [10:43:52:641]: Doing action: UnlockModules
Action 10:43:52: UnlockModules. Migrating to IIS7
Action start 10:43:52: UnlockModules.
MSI (s) (80:44) [10:43:52:691]: Creating MSIHANDLE (834) of type 790542 for thread 2116
MSI (s) (80:B8) [10:43:52:691]: Invoking remote custom action. DLL: C:\Windows\Installer\MSI72FF.tmp, Entrypoint: CAQuietExec
MSI (s) (80!7C) [10:43:52:771]: Creating MSIHANDLE (835) of type 790541 for thread 892
MSI (s) (80!7C) [10:43:52:771]: Creating MSIHANDLE (836) of type 790531 for thread 892
MSI (s) (80!7C) [10:43:52:781]: Closing MSIHANDLE (836) of type 790531 for thread 892
MSI (s) (80!7C) [10:43:52:781]: PROPERTY CHANGE: Deleting QtExecCmdLine property. Its current value is '"C:\Windows\system32\inetsrv\appcmd" unlock config -section:system.webServer/modules'.
MSI (s) (80!7C) [10:43:53:752]: Creating MSIHANDLE (837) of type 790531 for thread 892
CAQuietExec:  Unlocked section "system.webServer/modules" at configuration path "MACHINE/WEBROOT/APPHOST".
MSI (s) (80!7C) [10:43:53:762]: Closing MSIHANDLE (837) of type 790531 for thread 892
MSI (s) (80!7C) [10:43:53:762]: Closing MSIHANDLE (835) of type 790541 for thread 892
MSI (s) (80:B8) [10:43:53:762]: Closing MSIHANDLE (834) of type 790542 for thread 2116
Action ended 10:43:53: UnlockModules. Return value 1.
MSI (s) (80:44) [10:43:53:772]: Doing action: UnlockHandlersCmd
Action 10:43:53: UnlockHandlersCmd. 
Action start 10:43:53: UnlockHandlersCmd.
MSI (s) (80:44) [10:43:53:792]: PROPERTY CHANGE: Adding QtExecCmdLine property. Its value is '"C:\Windows\system32\inetsrv\appcmd" unlock config -section:system.webServer/handlers'.
Action ended 10:43:53: UnlockHandlersCmd. Return value 1.
MSI (s) (80:44) [10:43:53:792]: Doing action: UnlockHandlers
Action 10:43:53: UnlockHandlers. Migrating to IIS7
Action start 10:43:53: UnlockHandlers.
MSI (s) (80:44) [10:43:53:862]: Creating MSIHANDLE (838) of type 790542 for thread 2116
MSI (s) (80:08) [10:43:53:862]: Invoking remote custom action. DLL: C:\Windows\Installer\MSI7780.tmp, Entrypoint: CAQuietExec
MSI (s) (80!60) [10:43:54:123]: Creating MSIHANDLE (839) of type 790541 for thread 2144
MSI (s) (80!60) [10:43:54:123]: Creating MSIHANDLE (840) of type 790531 for thread 2144
MSI (s) (80!60) [10:43:54:123]: Closing MSIHANDLE (840) of type 790531 for thread 2144
MSI (s) (80!60) [10:43:54:133]: PROPERTY CHANGE: Deleting QtExecCmdLine property. Its current value is '"C:\Windows\system32\inetsrv\appcmd" unlock config -section:system.webServer/handlers'.
MSI (s) (80!60) [10:43:54:493]: Creating MSIHANDLE (841) of type 790531 for thread 2144
CAQuietExec:  Unlocked section "system.webServer/handlers" at configuration path "MACHINE/WEBROOT/APPHOST".
MSI (s) (80!60) [10:43:54:503]: Closing MSIHANDLE (841) of type 790531 for thread 2144
MSI (s) (80!60) [10:43:54:503]: Closing MSIHANDLE (839) of type 790541 for thread 2144
MSI (s) (80:08) [10:43:54:513]: Closing MSIHANDLE (838) of type 790542 for thread 2116
Action ended 10:43:54: UnlockHandlers. Return value 1.
MSI (s) (80:44) [10:43:54:634]: Doing action: MigrateIIS7Cmd
Action 10:43:54: MigrateIIS7Cmd. 
Action start 10:43:54: MigrateIIS7Cmd.
MSI (s) (80:44) [10:43:54:644]: PROPERTY CHANGE: Adding QtExecCmdLine property. Its value is '"C:\Windows\system32\inetsrv\appcmd" migrate config "Default Web Site/sdportal"'.
Action ended 10:43:54: MigrateIIS7Cmd. Return value 1.
MSI (s) (80:44) [10:43:54:654]: Doing action: MigrateIIS7
Action 10:43:54: MigrateIIS7. Migrating to IIS7
Action start 10:43:54: MigrateIIS7.
MSI (s) (80:44) [10:43:54:704]: Creating MSIHANDLE (842) of type 790542 for thread 2116
MSI (s) (80:E8) [10:43:54:704]: Invoking remote custom action. DLL: C:\Windows\Installer\MSI7ADE.tmp, Entrypoint: CAQuietExec
MSI (s) (80!14) [10:43:54:714]: Creating MSIHANDLE (843) of type 790541 for thread 2068
MSI (s) (80!14) [10:43:54:724]: Creating MSIHANDLE (844) of type 790531 for thread 2068
MSI (s) (80!14) [10:43:54:724]: Closing MSIHANDLE (844) of type 790531 for thread 2068
MSI (s) (80!14) [10:43:54:724]: PROPERTY CHANGE: Deleting QtExecCmdLine property. Its current value is '"C:\Windows\system32\inetsrv\appcmd" migrate config "Default Web Site/sdportal"'.
MSI (s) (80!14) [10:43:55:755]: Creating MSIHANDLE (845) of type 790531 for thread 2068
CAQuietExec:  Error 0x80070001: Command line returned an error.
MSI (s) (80!14) [10:43:55:765]: Closing MSIHANDLE (845) of type 790531 for thread 2068
MSI (s) (80!14) [10:43:55:765]: Creating MSIHANDLE (846) of type 790531 for thread 2068
CAQuietExec:  Error 0x80070001: CAQuietExec Failed
MSI (s) (80!14) [10:43:55:775]: Closing MSIHANDLE (846) of type 790531 for thread 2068
MSI (s) (80!14) [10:43:55:775]: Closing MSIHANDLE (843) of type 790541 for thread 2068
MSI (s) (80:E8) [10:43:55:775]: Closing MSIHANDLE (842) of type 790542 for thread 2116
Action ended 10:43:55: MigrateIIS7. Return value 1.

这是后续行动。我能够通过要求安装程序以管理员身份运行来让 appcmd 工作。最近,我添加了一个额外的自定义命令,但失败了。这是日志的相关部分。请注意,其他 appcmd.exe 命令运行良好。如果我将失败的 appcmd 从日志复制并粘贴到命令行提示符,它就会起作用。有什么想法吗?

MSI (s) (1C:B0) [15:56:46:510]: Invoking remote custom action. DLL: C:\Windows\Installer\MSIB74D.tmp, Entrypoint: CAQuietExec
MSI (s) (1C!B8) [15:56:46:570]: PROPERTY CHANGE: Deleting QtExecCmdLine property. Its current value is '"C:\Windows\system32\inetsrv\appcmd" migrate config    "Default Web Site/sdportal"'.
CAQuietExec:  Error 0x80070001: Command line returned an error.
CAQuietExec:  Error 0x80070001: CAQuietExec Failed
Action ended 15:56:47: MigrateIIS7. Return value 1.
MSI (s) (1C:14) [15:56:47:001]: Doing action: DisableRapidFailCmd
Action 15:56:47: DisableRapidFailCmd. 
Action start 15:56:47: DisableRapidFailCmd.
MSI (s) (1C:14) [15:56:47:011]: PROPERTY CHANGE: Adding QtExecCmdLine property. Its value is '"C:\Windows\system32\inetsrv\appcmd"  set apppool "WssAppPool"  /failure.rapidFailProtection:false'.
Action ended 15:56:47: DisableRapidFailCmd. Return value 1.
MSI (s) (1C:14) [15:56:47:021]: Doing action: DisableRapidFail
Action 15:56:47: DisableRapidFail. Disabling Rapid Fail
Action start 15:56:47: DisableRapidFail.
MSI (s) (1C:30) [15:56:47:061]: Invoking remote custom action. DLL: C:\Windows\Installer\MSIB988.tmp, Entrypoint: CAQuietExec
MSI (s) (1C!64) [15:56:47:141]: PROPERTY CHANGE: Deleting QtExecCmdLine property. Its current value is '"C:\Windows\system32\inetsrv\appcmd"  set apppool "WssAppPool" /failure.rapidFailProtection:false'.
CAQuietExec:  APPPOOL object "WssAppPool" changed
Action ended 15:56:47: DisableRapidFail. Return value 1.
MSI (s) (1C:14) [15:56:47:502]: Doing action: ConfigureAppPoolLoggingCmd
Action 15:56:47: ConfigureAppPoolLoggingCmd. 
Action start 15:56:47: ConfigureAppPoolLoggingCmd.
MSI (s) (1C:14) [15:56:47:522]: PROPERTY CHANGE: Adding QtExecCmdLine property. Its value is '"C:\Windows\system32\inetsrv\appcmd" set config /section:applicationPools /[name='WssAppPool'].recycling.logEventOnRecycle:Memory,Schedule,Requests,Time,PrivateMemory'.
Action ended 15:56:47: ConfigureAppPoolLoggingCmd. Return value 1.
MSI (s) (1C:14) [15:56:47:522]: Doing action: ConfigureAppPoolLogging
Action 15:56:47: ConfigureAppPoolLogging. Configuring App Pool Logging
Action start 15:56:47: ConfigureAppPoolLogging.
MSI (s) (1C:C0) [15:56:47:562]: Invoking remote custom action. DLL: C:\Windows\Installer\MSIBB7E.tmp, Entrypoint: CAQuietExec
MSI (s) (1C!A8) [15:56:47:602]: PROPERTY CHANGE: Deleting QtExecCmdLine property. Its current value is '"C:\Windows\system32\inetsrv\appcmd" set config /section:applicationPools /[name='WssAppPool'].recycling.logEventOnRecycle:Memory,Schedule,Requests,Time,PrivateMemory'.
CAQuietExec:  ERROR ( message:Unknown attribute ".recycling.logEventOnRecycle".  Replace with -? for help. )
CAQuietExec:  Error 0x80070585: Command line returned an error.
CAQuietExec:  Error 0x80070585: CAQuietExec Failed

I'm writing some CustomActions in WiX to migrate a web.config from IIS6 to IIS7 and am getting an error. However if I copy and paste the failing command from the install log file, it succeeds. Here's section of the log file that indicates the error. You'll see the first two appcmds succeed but the last migration command fails.

Action 10:43:52: UnlockModulesCmd. 
Action start 10:43:52: UnlockModulesCmd.
MSI (s) (80:44) [10:43:52:631]: PROPERTY CHANGE: Adding QtExecCmdLine property. Its value is '"C:\Windows\system32\inetsrv\appcmd" unlock config -section:system.webServer/modules'.
Action ended 10:43:52: UnlockModulesCmd. Return value 1.
MSI (s) (80:44) [10:43:52:641]: Doing action: UnlockModules
Action 10:43:52: UnlockModules. Migrating to IIS7
Action start 10:43:52: UnlockModules.
MSI (s) (80:44) [10:43:52:691]: Creating MSIHANDLE (834) of type 790542 for thread 2116
MSI (s) (80:B8) [10:43:52:691]: Invoking remote custom action. DLL: C:\Windows\Installer\MSI72FF.tmp, Entrypoint: CAQuietExec
MSI (s) (80!7C) [10:43:52:771]: Creating MSIHANDLE (835) of type 790541 for thread 892
MSI (s) (80!7C) [10:43:52:771]: Creating MSIHANDLE (836) of type 790531 for thread 892
MSI (s) (80!7C) [10:43:52:781]: Closing MSIHANDLE (836) of type 790531 for thread 892
MSI (s) (80!7C) [10:43:52:781]: PROPERTY CHANGE: Deleting QtExecCmdLine property. Its current value is '"C:\Windows\system32\inetsrv\appcmd" unlock config -section:system.webServer/modules'.
MSI (s) (80!7C) [10:43:53:752]: Creating MSIHANDLE (837) of type 790531 for thread 892
CAQuietExec:  Unlocked section "system.webServer/modules" at configuration path "MACHINE/WEBROOT/APPHOST".
MSI (s) (80!7C) [10:43:53:762]: Closing MSIHANDLE (837) of type 790531 for thread 892
MSI (s) (80!7C) [10:43:53:762]: Closing MSIHANDLE (835) of type 790541 for thread 892
MSI (s) (80:B8) [10:43:53:762]: Closing MSIHANDLE (834) of type 790542 for thread 2116
Action ended 10:43:53: UnlockModules. Return value 1.
MSI (s) (80:44) [10:43:53:772]: Doing action: UnlockHandlersCmd
Action 10:43:53: UnlockHandlersCmd. 
Action start 10:43:53: UnlockHandlersCmd.
MSI (s) (80:44) [10:43:53:792]: PROPERTY CHANGE: Adding QtExecCmdLine property. Its value is '"C:\Windows\system32\inetsrv\appcmd" unlock config -section:system.webServer/handlers'.
Action ended 10:43:53: UnlockHandlersCmd. Return value 1.
MSI (s) (80:44) [10:43:53:792]: Doing action: UnlockHandlers
Action 10:43:53: UnlockHandlers. Migrating to IIS7
Action start 10:43:53: UnlockHandlers.
MSI (s) (80:44) [10:43:53:862]: Creating MSIHANDLE (838) of type 790542 for thread 2116
MSI (s) (80:08) [10:43:53:862]: Invoking remote custom action. DLL: C:\Windows\Installer\MSI7780.tmp, Entrypoint: CAQuietExec
MSI (s) (80!60) [10:43:54:123]: Creating MSIHANDLE (839) of type 790541 for thread 2144
MSI (s) (80!60) [10:43:54:123]: Creating MSIHANDLE (840) of type 790531 for thread 2144
MSI (s) (80!60) [10:43:54:123]: Closing MSIHANDLE (840) of type 790531 for thread 2144
MSI (s) (80!60) [10:43:54:133]: PROPERTY CHANGE: Deleting QtExecCmdLine property. Its current value is '"C:\Windows\system32\inetsrv\appcmd" unlock config -section:system.webServer/handlers'.
MSI (s) (80!60) [10:43:54:493]: Creating MSIHANDLE (841) of type 790531 for thread 2144
CAQuietExec:  Unlocked section "system.webServer/handlers" at configuration path "MACHINE/WEBROOT/APPHOST".
MSI (s) (80!60) [10:43:54:503]: Closing MSIHANDLE (841) of type 790531 for thread 2144
MSI (s) (80!60) [10:43:54:503]: Closing MSIHANDLE (839) of type 790541 for thread 2144
MSI (s) (80:08) [10:43:54:513]: Closing MSIHANDLE (838) of type 790542 for thread 2116
Action ended 10:43:54: UnlockHandlers. Return value 1.
MSI (s) (80:44) [10:43:54:634]: Doing action: MigrateIIS7Cmd
Action 10:43:54: MigrateIIS7Cmd. 
Action start 10:43:54: MigrateIIS7Cmd.
MSI (s) (80:44) [10:43:54:644]: PROPERTY CHANGE: Adding QtExecCmdLine property. Its value is '"C:\Windows\system32\inetsrv\appcmd" migrate config "Default Web Site/sdportal"'.
Action ended 10:43:54: MigrateIIS7Cmd. Return value 1.
MSI (s) (80:44) [10:43:54:654]: Doing action: MigrateIIS7
Action 10:43:54: MigrateIIS7. Migrating to IIS7
Action start 10:43:54: MigrateIIS7.
MSI (s) (80:44) [10:43:54:704]: Creating MSIHANDLE (842) of type 790542 for thread 2116
MSI (s) (80:E8) [10:43:54:704]: Invoking remote custom action. DLL: C:\Windows\Installer\MSI7ADE.tmp, Entrypoint: CAQuietExec
MSI (s) (80!14) [10:43:54:714]: Creating MSIHANDLE (843) of type 790541 for thread 2068
MSI (s) (80!14) [10:43:54:724]: Creating MSIHANDLE (844) of type 790531 for thread 2068
MSI (s) (80!14) [10:43:54:724]: Closing MSIHANDLE (844) of type 790531 for thread 2068
MSI (s) (80!14) [10:43:54:724]: PROPERTY CHANGE: Deleting QtExecCmdLine property. Its current value is '"C:\Windows\system32\inetsrv\appcmd" migrate config "Default Web Site/sdportal"'.
MSI (s) (80!14) [10:43:55:755]: Creating MSIHANDLE (845) of type 790531 for thread 2068
CAQuietExec:  Error 0x80070001: Command line returned an error.
MSI (s) (80!14) [10:43:55:765]: Closing MSIHANDLE (845) of type 790531 for thread 2068
MSI (s) (80!14) [10:43:55:765]: Creating MSIHANDLE (846) of type 790531 for thread 2068
CAQuietExec:  Error 0x80070001: CAQuietExec Failed
MSI (s) (80!14) [10:43:55:775]: Closing MSIHANDLE (846) of type 790531 for thread 2068
MSI (s) (80!14) [10:43:55:775]: Closing MSIHANDLE (843) of type 790541 for thread 2068
MSI (s) (80:E8) [10:43:55:775]: Closing MSIHANDLE (842) of type 790542 for thread 2116
Action ended 10:43:55: MigrateIIS7. Return value 1.

Here's a follow up. I was able to get appcmd to work by requiring the installer be run as admin. Recently, I added an additional custom command which fails. Here's the relevant portion of the log. Note that the other appcmd.exe commands run fine. If I copy and past the failing appcmd from the log to a command line prompt, it works. Any thoughts?

MSI (s) (1C:B0) [15:56:46:510]: Invoking remote custom action. DLL: C:\Windows\Installer\MSIB74D.tmp, Entrypoint: CAQuietExec
MSI (s) (1C!B8) [15:56:46:570]: PROPERTY CHANGE: Deleting QtExecCmdLine property. Its current value is '"C:\Windows\system32\inetsrv\appcmd" migrate config    "Default Web Site/sdportal"'.
CAQuietExec:  Error 0x80070001: Command line returned an error.
CAQuietExec:  Error 0x80070001: CAQuietExec Failed
Action ended 15:56:47: MigrateIIS7. Return value 1.
MSI (s) (1C:14) [15:56:47:001]: Doing action: DisableRapidFailCmd
Action 15:56:47: DisableRapidFailCmd. 
Action start 15:56:47: DisableRapidFailCmd.
MSI (s) (1C:14) [15:56:47:011]: PROPERTY CHANGE: Adding QtExecCmdLine property. Its value is '"C:\Windows\system32\inetsrv\appcmd"  set apppool "WssAppPool"  /failure.rapidFailProtection:false'.
Action ended 15:56:47: DisableRapidFailCmd. Return value 1.
MSI (s) (1C:14) [15:56:47:021]: Doing action: DisableRapidFail
Action 15:56:47: DisableRapidFail. Disabling Rapid Fail
Action start 15:56:47: DisableRapidFail.
MSI (s) (1C:30) [15:56:47:061]: Invoking remote custom action. DLL: C:\Windows\Installer\MSIB988.tmp, Entrypoint: CAQuietExec
MSI (s) (1C!64) [15:56:47:141]: PROPERTY CHANGE: Deleting QtExecCmdLine property. Its current value is '"C:\Windows\system32\inetsrv\appcmd"  set apppool "WssAppPool" /failure.rapidFailProtection:false'.
CAQuietExec:  APPPOOL object "WssAppPool" changed
Action ended 15:56:47: DisableRapidFail. Return value 1.
MSI (s) (1C:14) [15:56:47:502]: Doing action: ConfigureAppPoolLoggingCmd
Action 15:56:47: ConfigureAppPoolLoggingCmd. 
Action start 15:56:47: ConfigureAppPoolLoggingCmd.
MSI (s) (1C:14) [15:56:47:522]: PROPERTY CHANGE: Adding QtExecCmdLine property. Its value is '"C:\Windows\system32\inetsrv\appcmd" set config /section:applicationPools /[name='WssAppPool'].recycling.logEventOnRecycle:Memory,Schedule,Requests,Time,PrivateMemory'.
Action ended 15:56:47: ConfigureAppPoolLoggingCmd. Return value 1.
MSI (s) (1C:14) [15:56:47:522]: Doing action: ConfigureAppPoolLogging
Action 15:56:47: ConfigureAppPoolLogging. Configuring App Pool Logging
Action start 15:56:47: ConfigureAppPoolLogging.
MSI (s) (1C:C0) [15:56:47:562]: Invoking remote custom action. DLL: C:\Windows\Installer\MSIBB7E.tmp, Entrypoint: CAQuietExec
MSI (s) (1C!A8) [15:56:47:602]: PROPERTY CHANGE: Deleting QtExecCmdLine property. Its current value is '"C:\Windows\system32\inetsrv\appcmd" set config /section:applicationPools /[name='WssAppPool'].recycling.logEventOnRecycle:Memory,Schedule,Requests,Time,PrivateMemory'.
CAQuietExec:  ERROR ( message:Unknown attribute ".recycling.logEventOnRecycle".  Replace with -? for help. )
CAQuietExec:  Error 0x80070585: Command line returned an error.
CAQuietExec:  Error 0x80070585: CAQuietExec Failed

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

故事和酒 2024-08-29 08:57:53

首先,即使 UAC 被禁用,您也无法使用 CAQuietExec,因为它不会以正确的权限运行。
只需执行 appcmd 即可,无需使用 CAQuietExec。

其次,正确的做法如下:
http://esmithy.net/2010/07/ 02/iis-configuration-with-wix-and-appcmd/

复制/粘贴,以防博客消失:

<InstallExecuteSequence><Custom Action="ConfigureAppPools" Before="InstallFinalize"><![CDATA[NOT Installed AND VersionNT64 >= 600]]></Custom></InstallExecuteSequence>

<CustomAction Id="ConfigureAppPools" Execute="deferred" Impersonate="no" Return="check" Directory="TARGETDIR" ExeCommand="[SystemFolder]inetsrv\appcmd set apppool /apppool.name:"[APPPOOLNAME]" /enable32BitAppOnWin64:true" />

First, you cannot use CAQuietExec even if UAC is disabled, since it will not run with the correct rights.
Simply execute the appcmd without using CAQuietExec.

Secondly, here is how to do it correctly:
http://esmithy.net/2010/07/02/iis-configuration-with-wix-and-appcmd/

Copy/paste in case the blog disappears:

<InstallExecuteSequence><Custom Action="ConfigureAppPools" Before="InstallFinalize"><![CDATA[NOT Installed AND VersionNT64 >= 600]]></Custom></InstallExecuteSequence>

<CustomAction Id="ConfigureAppPools" Execute="deferred" Impersonate="no" Return="check" Directory="TARGETDIR" ExeCommand="[SystemFolder]inetsrv\appcmd set apppool /apppool.name:"[APPPOOLNAME]" /enable32BitAppOnWin64:true" />
Oo萌小芽oO 2024-08-29 08:57:53

这是我在wix上发现的 - 用户邮件存档。这似乎是非常相似的问题。尝试按照 Phil 建议的方式定义自定义操作。

This is what I found on a wix-users mail archive. It seems to be very similar problem. Try to define the custom action the way Phil suggests.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文