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


如圖所示,我利用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。

網友

帖子里指出“返回值 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.Prerequisite
2.Launch Conditions

以上兩處必須統一。

此外,更重要的問題是,Visual Studio 2013 生成的 Windows Installer 與 Windows XP 不兼容。

 

解決方法
1.Close Visual Studio 2013
2.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\bin
3.Open Project
4.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!!!

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM