Office 2016安裝失敗解決方案
簡介
手賤卸載了Office 2013改裝2016,然后就呵呵了,安裝失敗,且沒有報錯信息。F**k 微軟。
解決方案
找日志
首先在文件資源管理器,也就是文件夾的導航里輸入%Temp%,然后搜索SetupExe,根據文件名查看出錯時的日志,例如SetupExe(2018081612405095C).log,明顯能夠看到時間。
##報錯信息
文件末尾,你會看到
Catalyst execution finished: 08/16/2018 12:09:12. Return code: 1603.
這個錯誤代碼1603,在谷歌百度上有鋪天蓋地的該問題解決方案,包括微軟自己的網站也有各種方法,反正我試了不行。1603實際是一個通用的錯誤代碼,我們需要在日志文件中找到底是哪里出錯了。
各種翻日志,我找到了這一段
2018/08/16 12:04:04:963::[14144] MSI(ACTIONSTART): ‘操作 12:04:04: InstallFinalize。’
2018/08/16 12:04:04:963::[14144] MSI(INFO): ‘操作開始 12:04:04: InstallFinalize。’
2018/08/16 12:04:05:010::[14144] MSI(COMMONDATA): ‘消息類型: 0,參數: 0’
2018/08/16 12:04:05:010::[14144] MSI(COMMONDATA): ‘消息類型: 1,參數: Microsoft Office Professional Plus 2016’
2018/08/16 12:04:05:010::[14144] MSI(ACTIONSTART): ‘操作 12:04:05: CryptRegAction。’
2018/08/16 12:04:05:073::[14144] MSI(INFO): ‘CryptRegAction: Registering the Office Provider.’
2018/08/16 12:04:05:088::[14144] MSI(ACTIONSTART): ‘操作 12:04:05: MsoHtmEdSelfReg。’
2018/08/16 12:04:05:260::[14144] MSI(ACTIONSTART): ‘操作 12:04:05: CAPopulateSPPCache。’
2018/08/16 12:04:05:276::[14144] MSI(INFO): ‘CAPopulateSPPCache: OMSICA : Initializing CustomAction CAPopulateSPPCache’
2018/08/16 12:04:05:432::[14144] MSI(ACTIONSTART): ‘操作 12:04:05: CARegisterHeartbeat。’
2018/08/16 12:04:05:510::[14144] MSI(INFO): ‘CAQuietExec: ???’
2018/08/16 12:04:05:510::[14144] MSI(INFO): ‘CAQuietExec: Error 0x80070001: Command line returned an error.’
2018/08/16 12:04:05:510::[14144] MSI(INFO): ‘CAQuietExec: Error 0x80070001: CAQuietExec Failed’
2018/08/16 12:04:05:510::[14144] MSI(INFO): ‘CustomAction CARegisterHeartbeat returned actual error code 1603 (note this may not be 100% accurate if translation happened inside sandbox)’
2018/08/16 12:04:05:510::[14144] MSI(INFO): ‘操作結束 12:04:05: InstallFinalize。返回值 3。’
沒有經驗的可以嘗試所有“返回值3”,英文版估計是“Return Code 3”。為什么搜這個?因為返回值3就說明操作失敗了。在我的記錄里,上一段之后,直接就開始回滾了,說明一定是這里出了問題。回滾的日志開頭如下
2018/08/16 12:04:05:510::[14144] MSI(COMMONDATA): ‘消息類型: 2,參數: 0’
2018/08/16 12:04:05:526::[14144] MSI(COMMONDATA): ‘消息類型: 2,參數: 0’
2018/08/16 12:04:05:526::[14144] MSI(COMMONDATA): ‘消息類型: 0,參數: 0’
2018/08/16 12:04:05:526::[14144] MSI(COMMONDATA): ‘消息類型: 1,參數: Microsoft Office Professional Plus 2016’
2018/08/16 12:04:05:526::[14144] MSI(ACTIONSTART): ‘操作 12:04:05: Rollback。正在回退操作:’
2018/08/16 12:04:05:526::[14144] Log level changed from: Standard to: Verbose
2018/08/16 12:04:05:526::[14144] MSI(COMMONDATA): ‘消息類型: 2,參數: 1’
2018/08/16 12:04:05:526::[14144] MSI(COMMONDATA): ‘消息類型: 2,參數: 0’
2018/08/16 12:04:05:620::[14144] MSI(COMMONDATA): ‘消息類型: 0,參數: 0’
2018/08/16 12:04:05:620::[14144] MSI(COMMONDATA): ‘消息類型: 1,參數: Microsoft Office Professional Plus 2016’
2018/08/16 12:04:05:620::[14144] MSI(ACTIONSTART): ‘操作 12:04:05: Rollback。正在回退操作:’
那么錯誤到底是啥呢?很明顯是CARegisterHeartbeat錯了
2018/08/16 12:04:05:432::[14144] MSI(ACTIONSTART): ‘操作 12:04:05: CARegisterHeartbeat。’
2018/08/16 12:04:05:510::[14144] MSI(INFO): ‘CAQuietExec: ???’
2018/08/16 12:04:05:510::[14144] MSI(INFO): ‘CAQuietExec: Error 0x80070001: Command line returned an error.’
2018/08/16 12:04:05:510::[14144] MSI(INFO): ‘CAQuietExec: Error 0x80070001: CAQuietExec Failed’
2018/08/16 12:04:05:510::[14144] MSI(INFO): ‘CustomAction CARegisterHeartbeat returned actual error code 1603 (note this may not be 100% accurate if translation happened inside sandbox)’
如何解決?百度是不靠譜的,還是要在谷歌搜索。這里可以搜索CARegisterHeartbeat或者CAQuietExec。
##解決
在我的這個例子里,微軟自己的卸載工具https://support.office.com/zh-cn/article/%E4%BB%8E-pc-%E5%8D%B8%E8%BD%BD-office-9dd49b83-264a-477a-8fcc-2fdf5dbf61d8?ui=zh-CN&rs=zh-CN&ad=CN 用了是不好使的,但是還有用,因為大部分的東西他都會幫忙弄好。所以首先要先用對應版本的小工具把Office殘留的東西清理一下,清理完記得重啟系統。
在某個帖子里發現這個Heartbeat與“計划任務”相關,在注冊表里有表項。那么就查注冊表。原貼:https://social.technet.microsoft.com/Forums/office/en-US/cda04233-4b97-4c0a-a873-2d61f848f903/office-2016-proplus-failed-installation?forum=Office2016setupdeploy。
打開task schedule,任務計划程序,從左邊欄中找到Microsoft/Office,如果能正常刪除,那就刪除,然后重啟重裝應該就ok,不行往下看。(這里可以按帖子里的說法,在硬盤中把計划的任務Office文件夾刪了,但是我的硬盤中就沒有這個文件夾,所以就沒管,在"%windir%/system32/tasks"里面找)
但是Win+R,regedit打開注冊表之后,用帖子中給的"hklm/software/microsoft/windows nt/current version/Schedule/taskcache/tasks" 和"hklm/software/microsoft/windows nt/current version/Schedule/taskcache/tree"並不能正確找到注冊表項,實際位置在:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Schedule\TaskCache\Tree和HKEY_LOCAL_MACHINE\software/microsoft/windows nt/current version/Schedule/taskcache/tasks,就是需要在HKEY_LOCAL_MACHINE里面找這兩個表項。
之后就按照原貼的說法
When I opened up the …taskcache/tree registry entry there was a subkey for “Microsoft/Office”, Inside that key, there was an ID entry that contained a GUID that pointed to a folder inside the …taskcache/tasks registry entry. So I looked for the GUID under the “…taskcache/tree/Microsoft/Office"registry entry and used that GUID to locate the correct entry in the “…taskcache/tasks” registry key. Then I delete the key that matches the GUID under the …taskcache/tasks” key and then deleted the “Microsoft/Office” entry under the …taskcache/tree" registry entry.
在tree的子鍵"Microsoft/Office"中挨個點擊,查看該鍵的ID,就是"{}"的那個值,並且在tasks里面找對應的,把對應的見刪了,之后在把"Microsoft/Office"都刪了。
重啟系統,安裝Office,成功。
這個錯誤是微軟自己的清理工具沒清干凈,或者是本機注冊表亂了,因為在注冊表里能夠看到相關的鍵,但是在task schedule中並不能看到任何計划的任務。實際上就是老版本的Heartbeat已經在注冊表里存在了,清理程序又沒把它刪掉,導致新的版本在裝自己的heartbeat時出錯了(微軟這個東西做的也是夠了)。
最后
log做的還是比較詳細的,每個人碰到的情況不一定一樣,但是按照本文的方法一定能夠找到解決方案。