Post reply

Warning: this topic has not been posted in for at least 120 days.
Unless you're sure you want to reply, please consider starting a new topic.
Name:
Email:
Subject:
Message icon:

Verification:
Type the letters shown in the picture
Listen to the letters / Request another image

Type the letters shown in the picture:
What color is grass?:
What is the seventh word in this sentence?:
What is five minus two (use the full word)?:

shortcuts: hit alt+s to submit/post or alt+p to preview


Topic Summary

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.
Posted by: -Turambar90-
« on: January 30, 2011, 09:13:25 AM »

The default section actions are not performed either.
DEFAULT
VERBOSE
PRINT ~%ERROR_MESSAGE%~
PRINT ~other string~
ACTION_READLN ...
END
did not result in any output, and the readln did not work either
Posted by: the bigg
« on: January 30, 2011, 09:02:16 AM »

WITH checks against the exception string (which you can see by putting PRINT ~%ERROR_MESSAGE%~ in the DEFAULT section). In this case, ~%ERROR_MESSAGE%~ is ~Failure("old version")~; as such, you must use WITH ~Failure(\"old version\")~ rather than WITH ~old version~.
Posted by: -Turambar90-
« on: January 30, 2011, 08:49:51 AM »

I was testing some new code for my mod, which was using an ACTION_TRY:
Code: [Select]
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.
It behaved, though, as expected (performing the DEFAULT actions, prompting and, if the input was not c, FAILing with message ~aborted~), when I copied a non existing file instead of setup-prova.tp2.
Is it the expected behaviour for a FAIL command in a TRY action?