VPatch plug-in: Difference between revisions

From NSIS Wiki
Jump to navigationJump to search
(→‎Links: documentation)
 
(2 intermediate revisions by 2 users not shown)
Line 2: Line 2:


== Links ==
== Links ==
The latest version of VPatch is 3.1.<br>
The latest version of VPatch is 3.2<br/>
[http://www.tibed.net/vpatch/ VPatch Home Page]
[http://www.tibed.net/vpatch/ VPatch Home Page]<br/>
[http://nsis.sourceforge.net/Docs/VPatch/Readme.html Documentation]


== Description ==
== Description ==
Line 24: Line 25:


[http://sourceforge.net/projects/nsispatchgen http://sourceforge.net/projects/nsispatchgen]
[http://sourceforge.net/projects/nsispatchgen http://sourceforge.net/projects/nsispatchgen]
----------------------------------------------------
The nsisPatchGen has a little problem, the NSIS include file doesn't compile if the file to patch has 'blanks' in the name.
I was looking for a good way to fix the problem and the this is simplest one:
<highlight-nsis>
; PatchLib v4.0
; =============
;
; Library for use with VPatch (DLL version) in NSIS 2.0.5+
; Created by Koen van de Sande
; Macro enhanced by Herberth Alvarado
!macro VPatchFile PATCHDATA SOURCEFILE TEMPFILE
  InitPluginsDir
;  File /oname=$PLUGINSDIR\${PATCHDATA} ${PATCHDATA}
  File "/oname=$PLUGINSDIR\${PATCHDATA}" "${PATCHDATA}"
  vpatch::vpatchfile "$PLUGINSDIR\${PATCHDATA}" "${SOURCEFILE}" "${TEMPFILE}"
  Pop $1
  DetailPrint $1
  StrCpy $1 $1 2
;  StrCmp $1 "OK" ok_${SOURCEFILE}
  StrCmp $1 "OK" +2
  SetErrors
;ok_${SOURCEFILE}:
;  IfFileExists "${TEMPFILE}" +1 end_${SOURCEFILE}
  IfFileExists "${TEMPFILE}" +1 +3
  Delete "${SOURCEFILE}"
  Rename /REBOOTOK "${TEMPFILE}" "${SOURCEFILE}"
;end_${SOURCEFILE}:
  Delete "$PLUGINSDIR\${PATCHDATA}"
!macroend
</highlight-nsis>
The comments are the original lines.

Latest revision as of 10:14, 23 February 2008

Author: joost (talk, contrib)


Links

The latest version of VPatch is 3.2
VPatch Home Page
Documentation

Description

It calculates the difference between two (or more) similar files: a new version and several old versions. When you release a new version, you might want to offer a patch update to the users, instead of including the entire file again. So you include the small patch file generated by VPatch in your installation, together with the VPatch runtime DLL for NSIS (which is 8 KB), and you save your users a lot of downloading.

Credits

VPatch is a NSIS plugin written by Koen van de Sande.

Related Software

nsisPatchGen

The nsisPatchGen utility recursively compares two directory structures looking for changes to the files and subdirectories. It produces an NSIS include file containing functions that will perform a patch upgrade from the original structure to the new.

nsisPatchGen uses the VPatch genpat.exe utility to generate patch files, and calls VPatch plugin function calls from the generated NSIS file.

nsisPatchGen can be downloaded from:

http://sourceforge.net/projects/nsispatchgen