home *** CD-ROM | disk | FTP | other *** search
/ Chip 2004 March / CMCD0304.ISO / Software / Freeware / Programare / nullsoft / nsis20.exe / Contrib / VPatch / example.nsi next >
Text File  |  2003-05-21  |  1KB  |  43 lines

  1. ;VPatch example
  2. ;Written by Joost Verburg
  3.  
  4. ;--------------------------------
  5.  
  6. ; The name of the installer
  7. Name "VPatch Test"
  8.  
  9. ; The file to write
  10. OutFile "vpatchtest.exe"
  11.  
  12. ; The default installation directory
  13. InstallDir "$PROGRAMFILES\VPatch Test"
  14.  
  15. ; The text to prompt the user to enter a directory
  16. DirText "Choose a folder in which to install the VPatch Test!"
  17.  
  18. ; Show details
  19. ShowInstDetails show
  20.  
  21. ;--------------------------------
  22.  
  23. Section ""
  24.  
  25.   ; Set output path to the installation directory
  26.   SetOutPath $INSTDIR
  27.   
  28.   ; Extract the old file
  29.   File oldfile.txt
  30.  
  31.   ; Extract the patch to the plug-ins folder (temporary)
  32.   InitPluginsDir
  33.   File /oname=$PLUGINSDIR\patch.pat patch.pat
  34.   
  35.   ; Update the old file to the new file using the patch
  36.   DetailPrint "Updating oldfile.txt using patch..."
  37.   vpatch::vpatchfile "$PLUGINSDIR\patch.pat" "$INSTDIR\oldfile.txt" "$INSTDIR\newfile.txt"
  38.   
  39.   ; Show result
  40.   Pop $R0
  41.   DetailPrint "Result: $R0"
  42.   
  43. SectionEnd