解決msi檔案在XP上安裝未完成(提示安裝程式被中斷,未能安裝app。需要重新啟動該安裝程式進行重試)的問題。

來源:互聯網
上載者:User

標籤:

,我利用Visual Studio 2015製作了一個小程式。基於.Net 4.0。用VS的Install擴充,建立Install項目進行打包。打包為.msi檔案。該安裝檔案在已經安裝了 .Net Framework4.0的情況下仍然出現這個問題,百思不得其解。

查閱了Stack Overflow的相關資料,得到了追蹤故障源的方法——命令列安裝.msi程式,可以看到log日誌。即 msiexec /i a.msi /l*v a.log 將會產生名為“a.log”的日誌。在日誌中發現如下代碼

=== 記錄開始: 2016-8-26  21:49:10 ===
MSI (c) (84:68) [21:49:10:453]: Note: 1: 2262 2: PatchPackage 3: -2147287038
MSI (c) (84:68) [21:49:10:453]: Machine policy value ‘DisableRollback‘ is 0
MSI (c) (84:68) [21:49:10:453]: User policy value ‘DisableRollback‘ is 0
MSI (c) (84:68) [21:49:10:453]: PROPERTY CHANGE: Adding UILevel property. Its value is ‘5‘.
MSI (c) (84:68) [21:49:10:453]: PROPERTY CHANGE: Adding ACTION property. Its value is ‘INSTALL‘.
MSI (c) (84:68) [21:49:10:453]: Doing action: INSTALL
MSI (c) (84:68) [21:49:10:453]: Note: 1: 2262 2: ActionText 3: -2147287038
操作 21:49:10: INSTALL.
操作開始 21:49:10: INSTALL。
MSI (c) (84:68) [21:49:10:453]: UI Sequence table ‘InstallUISequence‘ is present and populated.
MSI (c) (84:68) [21:49:10:453]: Running UISequence
MSI (c) (84:68) [21:49:10:453]: PROPERTY CHANGE: Adding EXECUTEACTION property. Its value is ‘INSTALL‘.
MSI (c) (84:68) [21:49:10:453]: Doing action: DIRCA_CheckFX
操作 21:49:10: DIRCA_CheckFX.
操作開始 21:49:10: DIRCA_CheckFX。
MSI (c) (84:4C) [21:49:10:453]: Invoking remote custom action. DLL: C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\MSI164.tmp, Entrypoint: CheckFX
MSI (c) (84:48) [21:49:10:453]: Cloaking enabled.
MSI (c) (84:48) [21:49:10:453]: Attempting to enable all disabled priveleges before calling Install on Server
MSI (c) (84:48) [21:49:10:453]: Connected to service for CA interface.
操作結束 21:49:10: DIRCA_CheckFX。傳回值 3。
MSI (c) (84:68) [21:49:10:546]: Doing action: FatalErrorForm
操作 21:49:10: FatalErrorForm.
操作開始 21:49:10: FatalErrorForm。
MSI (c) (84:6C) [21:49:10:546]: Note: 1: 2262 2: Error 3: -2147287038
資訊 2898。VSI_MS_Sans_Serif13.0_0_0, 宋體, 134
MSI (c) (84:6C) [21:49:10:546]: Note: 1: 2262 2: Error 3: -2147287038
資訊 2898。VSI_MS_Sans_Serif16.0_1_0, 宋體, 134
MSI (c) (84:6C) [21:49:10:546]: Note: 1: 2262 2: Error 3: -2147287038
DEBUG: Error 2826:  Control Line2 on dialog FatalErrorForm extends beyond the boundaries of the dialog to the right by 3 pixels
安裝程式在安裝此軟體包時遇到一個錯誤。這可能表示此軟體包有錯。錯誤碼是 2826。參數是: FatalErrorForm, Line2, to the right
MSI (c) (84:6C) [21:49:10:546]: Note: 1: 2262 2: Error 3: -2147287038
DEBUG: Error 2826:  Control BannerBmp on dialog FatalErrorForm extends beyond the boundaries of the dialog to the right by 3 pixels
安裝程式在安裝此軟體包時遇到一個錯誤。這可能表示此軟體包有錯。錯誤碼是 2826。參數是: FatalErrorForm, BannerBmp, to the right
MSI (c) (84:6C) [21:49:10:546]: Note: 1: 2262 2: Error 3: -2147287038
資訊 2898。VsdDefaultUIFont.524F4245_5254_5341_4C45_534153783400, 宋體, 134
MSI (c) (84:6C) [21:49:10:546]: Note: 1: 2262 2: Error 3: -2147287038
DEBUG: Error 2826:  Control Line1 on dialog FatalErrorForm extends beyond the boundaries of the dialog to the right by 3 pixels
安裝程式在安裝此軟體包時遇到一個錯誤。這可能表示此軟體包有錯。錯誤碼是 2826。參數是: FatalErrorForm, Line1, to the right
操作 21:49:10: FatalErrorForm. Dialog created
MSI (c) (84:6C) [21:49:10:625]: Note: 1: 2731 2: 0
操作結束 21:49:12: FatalErrorForm。傳回值 1。
操作結束 21:49:12: INSTALL。傳回值 3。

網友Aaron Stebner

                                                   

Aaron Stebner

Microsoft

MSFT

264,416 Points                11                6                5                        Recent Achievements            Proposed Answerer I                                            Ratings Board President                                            Forums Replies III                                                             View Profile           

在文章裡指出“傳回值 3”往往與程式安裝失敗復原有密切聯絡。

Open the verbose log in a text editor such as notepad and search for the string “return value 3”.  In nearly all cases, this takes me to the section in the verbose log that lists the action that failed that initially caused setup to rollback.

 

從我的a.log中可以看出DIRCA_CheckFX應該是問題的源頭。在反覆查看了目標機的安裝環境(組策略、.net)之後,確定應該是安裝包msi檔案有問題。

查閱資料正好發現CsharpStyle兄的文章【Setup Project】Windows XP 無法安裝

裡面提到

問題現象使用 Visual Studio 2013 的 Setup Project 製作的 Windows Installer 在 Windows XP 上無法運行,通過以下方法擷取日誌:  msiexec /i <msipath>setup.msi /l*v c:\temp\msi.log通過查看日誌的內容,發現以下錯誤:  DIRCA_CHECKFX Return Value 3 問題原因CHECKFX 的作用是檢查 .NET Framework 版本,在 Setup Project 的設定中有兩處:1.Prerequisite2.Launch Conditions以上兩處必須統一。此外,更重要的問題是,Visual Studio 2013 產生的 Windows Installer 與 Windows XP 不相容。 解決方案1.Close Visual Studio 20132.Copy file with replace dpca.dll from C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\Tools\Deployment to C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE\CommonExtensions\Microsoft\VSI\bin3.Open Project4.Rebuild

無奈再安裝VS2010還是太費勁,況且未必能解決2015的問題,遂另尋其他可能途徑。最終在Github上找到了便捷方法:
在Installation problem Windows XP文章的討論中,bh3605提到:

Find and download Orca. Use it to open up the msi file and look for two Actions. "DIRCA_CheckFx" and "VSDCA_VsdLaunchConditions". Delete them. You‘ll find them in tables InstallExecuteSequence and InstallUISequence. They‘re also in the CustomAction table, but I‘ve found deleting them in just the execution sequence tables sufficed.I don‘t know why it crashes on XP only, but I believe it‘s because XP doesn‘t have MSVBDPCA.dll. You can find more information on the Actions I mentioned here: http://stackoverflow.com/a/8613979+1 for building something related to Pandora!

在網上查了好多文章,都說msi安裝包的DIRCA_CheckFX和VSDCA_VsdLaunchConditions這兩個操作容易出問題。

也就是說,下載Ocra工具,然後刪除"DIRCA_CheckFx"和"VSDCA_VsdLaunchConditions"這兩個Action即可。
第一步,下載並開啟Ocra工具中的Ocra.exe,

第二步,開啟產生的(需要更改的)msi檔案,找到CustomAction表,從表中找到兩個Action

第三部,對這兩個Action,分別右鍵,刪除行,然後儲存即可。安裝就能成功安裝了。

注意:修改完,開啟記錄追蹤安裝過程的話,還是存在有Error的問題。不過程式可以成功安裝並正常運行。要想徹底解決還是要考慮替換dpca.dll檔案或者等VSI小組更新(XP已經報廢,這恐怕是癡心妄想)。替換dpca.dll不知道會不會有別的影響。

Stack Overflow的文章DIRCA_CHECKFX Return Value 3 - VS 2013 Deployment Project中還有其他辦法,比如

Here‘s what I did to workaround this issue for a 32-bit deployment project.1.Build the setup project in VS2010 once. This package is not dogged by the issue but I didn‘t want to have to keep building in a different VS version.2.Open the resulting msi with Orca, select the Binary table and export the content of MSVBDPCADLL to a file.3.Now after you build it in VS2013 use Orca to import the exported data into Binary\MSVBDPCADLL to fix the package.I have to do a similar thing with the 64-bit project but in this case it‘s to import the correct InstallUtil binary (being C:\Windows\Microsoft.NET\Framework64\v4.0.30319\InstallUtilLib.dll).


網友分析,安裝包出問題的原因為

The preview of the .vdproj resurrection uses DLLs that don‘t support Windows XP or Server 2003. Microsoft posted an update that might have fixed that bug.

 

唉~

 

希望各個單位早點淘汰古董XP!!!

 

解決msi檔案在XP上安裝未完成(提示安裝程式被中斷,未能安裝app。需要重新啟動該安裝程式進行重試)的問題。

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.