This function ensure, that original files will be renamed to new ending “.orig”.
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😳ptions, $2😛atch 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
Is there a possibility to adapt the generated WGenPatDir-File? Maybe a template file, which is used during generation process.