2013年7月18日 星期四

Visual Studio 2012 安裝失敗「安裝程式引擎存取被拒」

最近公司配的 Windows 7 筆電把原本的 Visual Studio 2010 授權升級成 2012 的版本,不過沒想到卻遇到了問題,在安裝沒幾個步驟就出現了錯誤訊息:安裝失敗!安裝無法繼續,因為某些必要元件失敗、「安裝程式引擎存取被拒」。

作業系統:Windows 7 x64
開發工具版本:Visual Studio 2012 Professional



雖然已經把2010移除,不過一開始懷疑是版本衝突,也把一些登錄檔刪除,試著更新.NET Framework,也有想過是VS版本或者檔案的問題,上官方網站下載其他版本的試用版,不過都是同樣的錯誤訊息,仍然沒辦法解決。

後來嘗試把防毒軟體、系統還原設定上的問題,最後搞了半天才真的去仔細檢閱紀錄檔,內容如下:

[23A8:23AC][2013-07-16T20:25:43]: MUX:  Free Disk Space before install:  SystemDrive C:\ 197995716608 bytes  AppDrive C:\ 197995716608 bytes
[2398:239C][2013-07-16T20:25:44]: Creating a system restore point.
[2398:239C][2013-07-16T20:25:58]: Created a system restore point.
[2398:239C][2013-07-16T20:26:04]: Error 0x80070005: Failed to secure cache path: C:\ProgramData\Package Cache\
[2398:239C][2013-07-16T20:26:04]: Error 0x80070005: Failed to secure cache directory: C:\ProgramData\Package Cache\
[2398:239C][2013-07-16T20:26:04]: Error 0x80070005: Failed to create completed cache path for bundle.
[2398:239C][2013-07-16T20:26:04]: Error 0x80070005: Failed to cache bundle from path: C:\Users\7485\AppData\Local\Temp\{dffbba4d-b573-4462-8549-b4ea1918d139}\.be\vs_professional.exe
[2398:239C][2013-07-16T20:26:04]: Error 0x80070005: Failed to begin registration session.
[23A8:23AC][2013-07-16T20:26:04]: Error 0x80070005: Failed to begin registration session in per-machine process.
[23A8:23AC][2013-07-16T20:26:04]: Error 0x80070005: Failed to register bundle.
[23A8:23AC][2013-07-16T20:26:04]: MUX:  Apply Complete: Disk Space Used in bytes for Installation:  MaxAppDrive: 0  MaxSysDrive: 553656320  AppDrive: 0  SysDrive: 95858688
[23A8:23AC][2013-07-16T20:26:04]: MUX:  Free Disk Space after install:  SystemDrive C:\ 197900234752 bytes  AppDrive C:\ 197900234752 bytes
[23A8:23AC][2013-07-16T20:26:04]: MUX:  Set Result: Return Code=-2147024891 (0x80070005), Error Message=, Result Detail=, Vital=True, Package Action=Install, Package Id=Apply Failure
[23A8:23AC][2013-07-16T20:26:04]: MUX:  Go to Finished page.
[23A8:23AC][2013-07-16T20:26:04]: Apply complete, result: 0x80070005, restart: None, ba requested restart:  No

馬上想到可能是資料夾權限的問題,解決方法如下:

在 C:\ProgramData\Package Cache\ 資料夾點選「右鍵」後按下「內容」並切換到「安全性」頁面,並點選「編輯」之後「新增」



此時會跳出「選取使用者、電腦、服務帳戶或群組」,因為這台筆電在公司的環境是AD帳號管理,請在此先點選「位置」然後切換至本機(圖中範例為我的電腦名稱NB0034)



此時輸入Administrators,注意最後面有一個s,代表的是群組,不要輸入成 Administrator 這一個使用者,然後點選「檢查名稱」通常電腦上都會有 Administrators 群組,系統會自動帶出來。


按下「確定」後,記得要給予該使用者「完全控制」之權限。


按下「確定」後,在安裝一次試看看吧,應該可以順利安裝了,如果還是不行,記得把記錄檔最後面的部份仔細觀察一遍看是不是還有其他權限上的問題。

相同的安裝程式拿去裝在其他電腦是正常的,而使用家裡的電腦去下載官方的試用版也是沒問題,所以我想這個問題主要原因可能是跟這台筆電帳戶的AD權限有關係(因為筆電是公司配的,也不方便重灌,所以就沒有花時間去驗證這個問題發生的根本原因了)

其實筆者一開始就有去查看Log,那個時候顯示的是系統還原無法開啟的錯誤訊息,後來把系統還原開啟後還是沒辦法解決問題,因此才去嘗試其他的方式,下次應該仔細好好地把Log看完整一點,可以節省不少時間。

1 則留言:

  1. 我也遇到跟版大一樣的問題,但是我照樣修改權限以後還是不能。
    'C:\Users\pc\Documents\Microsoft Visual Studio Professional 2012\autorun.inf'
    [2618:2794][2016-04-13T19:56:05]: Error 0x80070005: Failed to move C:\Users\pc\AppData\Local\Temp\{87f0e5de-f384-4de4-bfd4-38e1f321528b}\vs_professional_autorun_inf_NI to C:\Users\pc\Documents\Microsoft Visual Studio Professional 2012\autorun.inf
    [2618:2794][2016-04-13T19:56:05]: Error 0x80070005: Failed to layout payload from cached payload: C:\Users\pc\Documents\Microsoft Visual Studio Professional 2012\autorun.inf
    [2618:2794][2016-04-13T19:56:05]: Error 0x80070005: Failed to layout payload from: C:\Users\pc\AppData\Local\Temp\{87f0e5de-f384-4de4-bfd4-38e1f321528b}\vs_professional_autorun_inf_NI to C:\Users\pc\Documents\Microsoft Visual Studio Professional 2012\
    [0F3C:1530][2016-04-13T19:56:05]: MUX: Verify Failed. Retry acquiring, Retry Count: 3 of 3
    [0F3C:1530][2016-04-13T19:56:05]: MUX: Set Result: Return Code=-2147024891 (0x80070005), Error Message=, Result Detail=, Vital=False, Package Action=Verify, Package Id=
    [0F3C:1530][2016-04-13T19:56:05]: Failed to layout payload: vs_professional_autorun_inf_NI to layout directory: C:\Users\pc\Documents\Microsoft Visual Studio Professional 2012\, error: 0x80070005.
    [0F3C:1530][2016-04-13T19:56:05]: Application requested retry of payload: vs_professional_autorun_inf_NI, encountered error: 0x80070005. Retrying...
    [0F3C:1530][2016-04-13T19:56:05]: Acquiring bundle payload: vs_professional_autorun_inf_NI, copy from: F:\autorun.inf
    [0F3C:1530][2016-04-13T19:56:05]: MUX: Reset Result
    [2618:2794][2016-04-13T19:56:05]: Moving payload from working path 'C:\Users\pc\AppData\Local\Temp\{87f0e5de-f384-4de4-bfd4-38e1f321528b}\vs_professional_autorun_inf_NI' to path 'C:\Users\pc\Documents\Microsoft Visual Studio Professional 2012\autorun.inf'
    [2618:2794][2016-04-13T19:56:11]: Error 0x80070005: Failed to move C:\Users\pc\AppData\Local\Temp\{87f0e5de-f384-4de4-bfd4-38e1f321528b}\vs_professional_autorun_inf_NI to C:\Users\pc\Documents\Microsoft Visual Studio Professional 2012\autorun.inf
    [2618:2794][2016-04-13T19:56:11]: Error 0x80070005: Failed to layout payload from cached payload: C:\Users\pc\Documents\Microsoft Visual Studio Professional 2012\autorun.inf
    [2618:2794][2016-04-13T19:56:11]: Error 0x80070005: Failed to layout payload from: C:\Users\pc\AppData\Local\Temp\{87f0e5de-f384-4de4-bfd4-38e1f321528b}\vs_professional_autorun_inf_NI to C:\Users\pc\Documents\Microsoft Visual Studio Professional 2012\
    [0F3C:1530][2016-04-13T19:56:11]: MUX: Set Result: Return Code=-2147024891 (0x80070005), Error Message=, Result Detail=, Vital=False, Package Action=Verify, Package Id=
    [0F3C:1530][2016-04-13T19:56:11]: MUX: Set Result: Return Code=-2147024891 (0x80070005), Error Message=, Result Detail=, Vital=False, Package Action=Verify, Package Id=
    [0F3C:1530][2016-04-13T19:56:11]: Failed to layout payload: vs_professional_autorun_inf_NI to layout directory: C:\Users\pc\Documents\Microsoft Visual Studio Professional 2012\, error: 0x80070005.
    [0F3C:1670][2016-04-13T19:56:11]: MUX: Apply Complete: Disk Space Used in bytes for Installation: MaxAppDrive: 0 MaxSysDrive: 1175552 AppDrive: 0 SysDrive: 1171456
    [0F3C:1670][2016-04-13T19:56:11]: MUX: Free Disk Space after install: SystemDrive C:\ 292402925568 bytes AppDrive C:\ 292402925568 bytes
    [0F3C:1670][2016-04-13T19:56:11]: MUX: Set Result: Return Code=-2147024891 (0x80070005), Error Message=, Result Detail=, Vital=True, Package Action=Layout, Package Id=Apply Failure
    [0F3C:1670][2016-04-13T19:56:11]: MUX: Go to Finished page.
    [0F3C:1670][2016-04-13T19:56:11]: Apply complete, result: 0x80070005, restart: None, ba requested restart: No

    回覆刪除