views:

302

answers:

2

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.
A: 

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.

Yan Sklyarenko
A: 

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