VPatch
git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@2556 212acab6-be3b-0410-9dea-997c60f758d6
This commit is contained in:
parent
9a092cb98f
commit
fbc323c3db
11 changed files with 689 additions and 4 deletions
43
Contrib/VPatch/example.nsi
Normal file
43
Contrib/VPatch/example.nsi
Normal file
|
@ -0,0 +1,43 @@
|
|||
;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
|
||||
|
||||
;--------------------------------
|
||||
|
||||
Section ""
|
||||
|
||||
; 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..."
|
||||
vpatch::vpatchfile "$PLUGINSDIR\patch.pat" "$INSTDIR\oldfile.txt" "$INSTDIR\newfile.txt"
|
||||
|
||||
; Show result
|
||||
Pop $R0
|
||||
DetailPrint "Result: $R0"
|
||||
|
||||
SectionEnd
|
Loading…
Add table
Add a link
Reference in a new issue