[英]NSIS patching (multiple patches in one file)

I'm able to generate patch files from one version to another using NSIS' Vpatch. Let's say I have mydll.dll version 1, and I have a patch to update it to version 2. Then I have a new version again, thus I generate another patch to update it to version 3.


What bothers me though is, what if user cancels updating to version 2 and so forth. Then my latest version let's say is version 20. User decides to update to version 20. Is there a way to generate a patch that's like accumulative in nature? whereas user can jump from version any old version to the newest version (i.e ver 3 to ver 20) without passing through the versions in between?


I've read this line in vpatch's documentation ---> "if you want to be able to upgrade version 1 and 2 to version 3, you can put a 1 > 3 and 2 > 3 patch in one file." But how do I that?

我在vpatch的文檔中讀到了這一行--->“如果你想將版本1和2升級到版本3,你可以在一個文件中放置1> 3和2> 3補丁。”但那我該怎么辦?

What if I alread have like 30 versions. Does that mean I have to create a patch whose arguments are old files(versions 1-29) and new file(version20)?


2 个解决方案


I'd say you have two options:


  • Every time you have a new version you GENPAT a patch for every previous version to the new version
  • 每次有新版本時,都會為每個以前的版本生成新版本的補丁

  • GENPAT just from New-1 to New (Appending to a patch file that already had New-2 to New-1 etc) and keep calling vpatch::vpatchfile at install-time till the return value is "OK, new version already installed" and not just "OK" (You don't need a archive of all old versions for this, but it will take longer for the user to apply the update if they had skipped many updates)
  • GENPAT只是從New-1到New(附加到已經有New-2到New-1的補丁文件等)並且在安裝時繼續調用vpatch :: vpatchfile,直到返回值為“OK,已安裝新版本”而不只是“確定”(您不需要為此存檔所有舊版本,但如果用戶跳過許多更新,則需要更長時間才能應用更新)


VPatch is an open source project in itself so you could ask in their forum. The guy wrote it says you can ask him questions. There is a link from his page to the email form: http://www.tibed.net/vpatch/




粤ICP备14056181号  © 2014-2020 ITdaan.com