Posted by: the bigg
« on: January 30, 2011, 10:06:55 AM »That's because PATCH_FAIL (or other errors) inside REPLACE_EVALUATE don't block the installation. Fixed.
VERSION ~beta 0010~
BEGIN ~prova~
SILENT
ACTION_TRY
COPY - ~setup-prova.tp2~ ~trash.bin~
REPLACE_EVALUATE "VERSION\( *\)~\( *\)\(b?e?t?a?\)\( *[a-z]* *\)\([0-9]+\)"
BEGIN
PATCH_IF (~%MATCH3%~ STRING_EQUAL_CASE ~beta~) AND (%MATCH5%<13) BEGIN
PATCH_VERBOSE
PATCH_FAIL ~old version~
END
END
"VERSION%MATCH1%~%MATCH2%%MATCH3%%MATCH4%%MATCH5%"
BUT_ONLY
WITH
~old version~
BEGIN
PRINT ~check~
ACTION_RERAISE
END
DEFAULT
PRINT ~version not detected. Press any key to abort or c to continue~
ACTION_READLN abort
ACTION_IF ~%abort%~ STRING_MATCHES_REGEXP ~c.?~ BEGIN
FAIL ~aborted~
END
END
VERBOSE
I expected it to fail with error text "old version" (due to the ACTION_RERAISE), or at least to print "check". But neither of the two actions after WITH were performed, and the installation was successful.