/usr/share/doc/nsis/Examples/VPatch/example.nsi is in nsis-doc 2.46-7.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 | ;VPatch example
;Written by Joost Verburg
;--------------------------------
; The name of the installer
Name "VPatch Test"
; The file to write
OutFile "vpatchtest.exe"
; The default installation directory
InstallDir "$PROGRAMFILES\VPatch Test"
; The text to prompt the user to enter a directory
DirText "Choose a folder in which to install the VPatch Test!"
; Show details
ShowInstDetails show
;--------------------------------
; The normal way to use VPatch
;--------------------------------
!include "VPatchLib.nsh"
Section "Update file"
; Set output path to the installation directory
SetOutPath $INSTDIR
; Extract the old file under name 'updatefile.txt'
File /oname=updatefile.txt oldfile.txt
; Update the file - it will be replaced with the new version
DetailPrint "Updating updatefile.txt using patch..."
!insertmacro VPatchFile "patch.pat" "$INSTDIR\updatefile.txt" "$INSTDIR\temporaryfile.txt"
SectionEnd
;-------------------------------
; The hard way to use VPatch
;-------------------------------
Section "New version in separate file"
; Set output path to the installation directory
SetOutPath $INSTDIR
; Extract the old file
File oldfile.txt
; Extract the patch to the plug-ins folder (temporary)
InitPluginsDir
File /oname=$PLUGINSDIR\patch.pat patch.pat
; Update the old file to the new file using the patch
DetailPrint "Updating oldfile.txt using patch to newfile.txt..."
vpatch::vpatchfile "$PLUGINSDIR\patch.pat" "$INSTDIR\oldfile.txt" "$INSTDIR\newfile.txt"
; Show result
Pop $R0
DetailPrint "Result: $R0"
SectionEnd
|