MSI Major Upgrade overwriting rules

后端 未结 5 2020
天涯浪人
天涯浪人 2020-12-18 10:19

I think I read it somewhere, but couldn\'t find the source now and can\'t confirm it: when install(Major upgrade) a newer version from MSI, if the file has been modified (ei

5条回答
  •  没有蜡笔的小新
    2020-12-18 11:04

    When a major upgrade uninstalls an existing installation before the new version gets installed (RemoveExistingProducts before InstallInitialize) it will normally remove all files that were originally installed - this includes files that may have been modified. Then the new version is installed with a fresh bundle of files.

    If you schedule RemoveExistingProducts after InstallFinalize the install of the new version's files precedes the removal of obsolete files. In this scenario files are only replaced if they are versioned and newer than installed files, and for unversioned files like txt, pdf, etc... the file replacement rules basically states that the file will only be overwritten if it has not been changed on disk.

    It follows that moving RemoveExistingProducts after InstallFinalize may solve your file "replacement problem" which is really a case of the modified files being deleted during uninstalland reinstalled by your current upgrade strategy.

提交回复
热议问题