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

Iis 7 执行inetsrv\appcmd时,在WiX安装程序中CAQuietExec失败,iis-7,wix,custom-action,Iis 7,Wix,Custom Action,我在WiX中编写了一些自定义操作,将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:

我在WiX中编写了一些自定义操作,将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

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

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

其次,这里是如何正确地做到这一点:

如果博客消失,复制/粘贴:

<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:&quot;[APPPOOLNAME]&quot; /enable32BitAppOnWin64:true" />
=600]>