添加删除程序在我的msi产品每次重新安装后显示增加的大小

时间:2014-11-13 19:51:53

标签: windows wix windows-installer addremoveprograms

运行我的应用程序时,它会连接到联机存储库并检查是否有更高版本可用。如果有更高版本可用,则下载MSI并进行升级(即使用不同的产品版本进行微小更新)。升级完成后,它会正常运行。

问题是,每次升级时,ARP都显示我的产品尺寸增加了。每次升级后都会累积大小。我检查了我的应用程序文件夹和其他目标文件夹中的所有重新安装的文件,但没有重复的文件或额外的日志文件。

我正在使用MsiInstallProduct(msiFile,cmdLine)来执行重新安装。 ' CMDLINE'是: ALLUSERS = 1 REINSTALLMODE = vamus REINSTALL = ALL CONFIGURATIONFILE = C:\ ProgramData \ myapp \ ngsetup.ini

我在Verbose msi日志中观察到了可疑的事情:

  1. 在升级过程中,我的应用程序在后台启动了一个使用2个dll(ngcommon.dll和ngevent.dll)的进程ngupdate.exe。这可能是ARP增加规模的原因吗?
  2. 日志片段:

    :
    MSI (s) (1C:6C) [10:16:21:958]: Executing op: SetTargetFolder(Folder=C:\Windows\system32\)
    MSI (s) (1C:6C) [10:16:21:958]: Executing op: SetSourceFolder(Folder=1\SYSTEM~1\|System Folder\)
    MSI (s) (1C:6C) [10:16:21:958]: Executing op: RegisterSharedComponentProvider(,,File=_B08FC512AED74917BAF4D6EAF379944E,Component={2DE76099-CD98-FD91-F426-2B97BB134A59},ComponentVersion=11.2.0.118,ProductCode={A2A78788-2792-49BF-AF22-5E9296E568F3},ProductVersion=11.20.118,PatchSize=0,PatchAttributes=0,PatchSequence=0,SharedComponent=0,IsFullFile=0)
    MSI (s) (1C:6C) [10:16:21:964]: Executing op: FileCopy(SourceName=NGCOMMON.DLL|ngcommon.dll,SourceCabKey=_B08FC512AED74917BAF4D6EAF379944E,DestName=ngcommon.dll,Attributes=512,FileSize=182056,PerTick=65536,,VerifyMedia=1,,,,,CheckCRC=0,Version=11.2.0.118,Language=1033,InstallMode=130023424,,,,,,,)
    MSI (s) (1C:6C) [10:16:21:965]: File: C:\Windows\system32\ngcommon.dll; Overwrite;  Won't patch;    REINSTALLMODE specifies all files to be overwritten
    MSI (s) (1C:6C) [10:16:21:965]: Source for file '_B08FC512AED74917BAF4D6EAF379944E' is compressed
    MSI (s) (1C:6C) [10:16:21:965]: Re-applying security from existing file.
    MSI (s) (1C:6C) [10:16:21:966]: Note: 1: 2262 2: Error 3: -2147287038 
    MSI (s) (1C:6C) [10:16:22:324]: Product: My App. The file C:\Windows\system32\ngcommon.dll is being used by the following process: Name: ngupdate , Id 3104.
    MSI (s) (1C:6C) [10:16:22:326]: Verifying accessibility of file: ngcommon.dll
    MSI (s) (1C:6C) [10:16:22:332]: Executing op: FileCopy(SourceName=NGHELP.CHM|nghelp.chm,SourceCabKey=_C8D0297F24AD4BA5A9D4AAA0D3BAC0CC,DestName=nghelp.chm,Attributes=512,FileSize=90244,PerTick=65536,,VerifyMedia=1,,,,,CheckCRC=0,,,InstallMode=130023424,,,,,,,)
    MSI (s) (1C:6C) [10:16:22:333]: File: C:\Windows\system32\nghelp.chm;   Overwrite;  Won't patch;    REINSTALLMODE specifies all files to be overwritten
    MSI (s) (1C:6C) [10:16:22:333]: Source for file '_C8D0297F24AD4BA5A9D4AAA0D3BAC0CC' is compressed
    MSI (s) (1C:6C) [10:16:22:333]: Re-applying security from existing file.
    MSI (s) (1C:6C) [10:16:22:335]: Verifying accessibility of file: nghelp.chm
    MSI (s) (1C:6C) [10:16:22:339]: Executing op: SetTargetFolder(Folder=C:\Windows\)
    MSI (s) (1C:6C) [10:16:22:339]: Executing op: SetSourceFolder(Folder=1\WINDOW~1\|Windows Folder\)
    MSI (s) (1C:6C) [10:16:22:339]: Executing op: RegisterSharedComponentProvider(,,File=_DDBE1E1CB35A4E12AB1FA25F9D72738D,Component={30F988F9-ED4E-07C5-C3C3-30FECE7447FF},ComponentVersion=11.2.0.118,ProductCode={A2A78788-2792-49BF-AF22-5E9296E568F3},ProductVersion=11.20.118,PatchSize=0,PatchAttributes=0,PatchSequence=0,SharedComponent=0,IsFullFile=0)
    MSI (s) (1C:6C) [10:16:22:345]: Executing op: FileCopy(SourceName=NGEVENT.DLL|ngevent.dll,SourceCabKey=_DDBE1E1CB35A4E12AB1FA25F9D72738D,DestName=ngevent.dll,Attributes=512,FileSize=64296,PerTick=65536,,VerifyMedia=1,,,,,CheckCRC=0,Version=11.2.0.118,Language=1033,InstallMode=130023424,,,,,,,)
    MSI (s) (1C:6C) [10:16:22:346]: File: C:\Windows\ngevent.dll;   Overwrite;  Won't patch;    REINSTALLMODE specifies all files to be overwritten
    MSI (s) (1C:6C) [10:16:22:346]: Source for file '_DDBE1E1CB35A4E12AB1FA25F9D72738D' is compressed
    MSI (s) (1C:6C) [10:16:22:347]: Re-applying security from existing file.
    MSI (s) (1C:6C) [10:16:22:347]: Note: 1: 2262 2: Error 3: -2147287038 
    MSI (s) (1C:6C) [10:16:22:348]: Product: My App. The file C:\Windows\ngevent.dll is being used by the following process: Name: ngupdate , Id 3104.
    MSI (s) (1C:6C) [10:16:22:350]: Verifying accessibility of file: ngevent.dll
    MSI (s) (1C:6C) [10:16:22:354]: Executing op: SetTargetFolder(Folder=C:\Program Files\myapp\Install\)
    MSI (s) (1C:6C) [10:16:22:354]: Executing op: SetSourceFolder(Folder=1\INSTALL\|Install\)
    :
    
    1. 从日志中,在ProductRegister(...,)中有一个参数" EstimatedSize = 1776"。这与ARP中的大小增加问题有关吗?它做了什么?
    2. Log Snippet:

      MSI (s) (1C:F8) [10:16:22:449]: Created Custom Action Server with PID 1176 (0x498).
      MSI (s) (1C:B4) [10:16:22:475]: Running as a service.
      MSI (s) (1C:B4) [10:16:22:477]: Hello, I'm your 32bit Elevated custom action server.
      MSI (s) (1C:6C) [10:16:29:059]: Executing op: ActionStart(Name=RegisterProduct,Description=Registering product,Template=[1])
      MSI (s) (1C:6C) [10:16:29:059]: Executing op: ChangeMedia(,MediaPrompt=Please insert the disk: ,MediaCabinet=_B80BF92501A9CB366CEFEB8C382A3536,BytesPerTick=0,CopierType=2,ModuleFileName=C:\Windows\Installer\1e88d181.msi,,,,,IsFirstPhysicalMedia=1)
      MSI (s) (1C:6C) [10:16:29:059]: Executing op: DatabaseCopy(DatabasePath=C:\Windows\Installer\1e88d181.msi,ProductCode={A2A78788-2792-49BF-AF22-5E9296E568F3},,,)
      MSI (s) (1C:6C) [10:16:29:061]: Verifying accessibility of file: 1e88d180.msi
      MSI (s) (1C:6C) [10:16:29:074]: File will have security applied from OpCode.
      MSI (s) (1C:6C) [10:16:29:079]: Executing op: ProductRegister(UpgradeCode={81E3FF66-F6BB-49D7-A544-2FF3353BC128},VersionString=11.20.118,HelpLink=https://help.myapp.com/help.asp,,,InstallSource=C:\ProgramData\myapp\,Publisher=App Inc.,URLInfoAbout=http://www.myapp.com/us/en/support/contact.html#e-class,,,,,,,Contact=App Inc.,,,,EstimatedSize=1776,,,,)
      MSI (s) (1C:6C) [10:16:29:084]: Executing op: ProductCPDisplayInfoRegister()
      MSI (s) (1C:6C) [10:16:29:086]: Executing op: ActionStart(Name=PublishFeatures,Description=Publishing Product Features,Template=Feature: [1])
      MSI (s) (1C:6C) [10:16:29:086]: Executing op: FeaturePublish(Feature=DefaultFeature,,Absent=2,Component=c-?rk6J{f`&VZ0V-m239QWWxn`42T!4sSaIbbqY$%@s+O!{e,ph8~k4Wa^db=K8^)f(XvC.[Z?4[1voA[7dAyT[uBZFb[ZmBwlaC=j@i2PXJj[=ptVPS'k94kxu_4f(ROJYf+,KX=m(T.q&t7Wyg9RpF3Ov)ytF6lF@f[{1iy=Oh9nB5F`QG66mtjyXbeECC5(@Wm72Bd(t(CJFEv4bPNG&vGUTovbUqYauSv[iXFCNfgIRV@uZPZ4=3!3+7Nq5)taHoE3t`T2w')&LTx?SSIjTvjERXC[Av(gc6=O]f.GGO)Ia7J+o=Q?P~^eP-%,oc)B~[fpsD}Clgdo0g.b07M.@&+utmClhlX.l_E.rMjs$+*P-'?Z.VBu)yyNNnZb@SZ^'yZRu87v3bQ6?h3U&i2tF8Rz[LiYXEG@dDt!eA[iHgB&S*%P99eBR(%Wxg3,*FR%0=5dz^4y&{izS_KJ=(dZo%i0Pboj'$[3&laN']V-wYa.k*@c$jM}`.J[bJ-z@B,Sl^[fIL?H@G*03wMC]@qrXyqA^N)
      MSI (s) (1C:6C) [10:16:29:088]: Executing op: ActionStart(Name=PublishProduct,Description=Publishing product information,)
      MSI (s) (1C:6C) [10:16:29:088]: Executing op: PackageCodePublish(PackageKey={5C921CC3-02D7-4BDF-BC56-6E2853B5E4FF})
      MSI (s) (1C:6C) [10:16:29:088]: Executing op: CleanupConfigData()
      MSI (s) (1C:6C) [10:16:29:088]: Executing op: RegisterPatchOrder(Continue=0,SequenceType=1,Remove=0)
      MSI (s) (1C:6C) [10:16:29:090]: Executing op: ProductPublishUpdate()
      MSI (s) (1C:6C) [10:16:29:091]: Executing op: SourceListRegisterLastUsed(SourceProduct={A2A78788-2792-49BF-AF22-5E9296E568F3},LastUsedSource=C:\ProgramData\myapp\)
      MSI (s) (1C:6C) [10:16:29:091]: Entering CMsiConfigurationManager::SetLastUsedSource.
      :
      :
      

      谢谢, KUNAL

1 个答案:

答案 0 :(得分:4)

Visual Studio安装项目充满了错误 - 它们一直都是。我认真建议您立即切换到 Wix ,并花时间学习它。你会为自己省去很多悲伤和问题。

Wix工具包中有一个名为 dark.exe 的工具,它允许您将现有的MSI反编译为Wix源XML。通过一些清理,您可以使用反编译的XML源作为新Wix包的基础(必须使用somy剪切和粘贴技能以及MSI洞察力)。 Wix是功能齐全且可靠的,Visual Studio项目不是,你会继续遇到各种限制。

反编译VSPROJ的注释 - 尝试消除所有GUI元素并与标准Wix GUI类型链接以避免使事情复杂化。请参阅此问题:How can I add an optional UI to WiX toolsetthis tutorial

在基本级别,您可以通过插入此Wix XML来获得正常的安装程序Wix GUI:

<UIRef Id="WixUI_Minimal" />

这将MSI与默认GUI相关联,除非您需要自定义对话框,否则该GUI对您的安装程序来说已经足够了。因此,反编译的VSPROJ MSI的工作是找到GUI元素,删除整个段,并插入上面的一个线性GUI链接。完成。您对Windows Installer的了解越多,显然就越容易进行清理。

其他一些文章还有其他Wix建议和链接(大多数都是旧版):