Old 21st July 2014, 05:53   #1
abramar
Junior Member
 
Join Date: Jul 2014
Posts: 1
Create PatchInstaller NSH-Script from Template

we have introduced a patch installer for our software. Therefore we are using CMake with NSIS with WPatch Plugin to identify modified files between two releases and generate a WGenPatDir.nsh file. Our goal is to modify the Patch function like this:
code:

Function Patch

StrCmp $3 "CHECK" after_save
IfFileExists '$INSTDIR\$0' 0 after_save
DetailPrint "Rename orignal file $INSTDIR\$0 to $INSTDIR\$0.orig"
Rename '$INSTDIR\$0' '$INSTDIR\$0.orig'
after_save:
DetailPrint 'Patch: $0'
StrCpy $0 '$INSTDIR\$0'
retry:
WPatch::PatchFile /NOUNLOAD ; expects $0:file path, $1:options, $2:patch path
IntCmp $1 0 continue can_skip 0
SetErrors
can_skip:
SetDetailsPrint listonly
DetailPrint '=> Error $1'
SetDetailsPrint both
IntCmp $1 1 0 continue continue
MessageBox MB_RETRYCANCEL|MB_ICONEXCLAMATION $(^FileError_NoIgnore) /SD IDCANCEL IDRETRY retry
Abort
continue:
FunctionEnd



This function ensure, that original files will be renamed to new ending “.orig”.

Is there a possibility to adapt the generated WGenPatDir-File? Maybe a template file, which is used during generation process.
abramar is offline   Reply With Quote
Reply
Go Back   Winamp & Shoutcast Forums > Developer Center > NSIS Discussion

Tags
patch nsh template

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump