[wpkg-users] RegExp matching of uninstall string is done before checking against string literal

Rainer Meier r.meier at wpkg.org
Tue Sep 22 21:20:16 CEST 2009


Hi Stefan,

Pendl Stefan wrote:
> Hi Rainer,
>    it seems that the uninstall entry is first checked against the regexp and afterwards against the string literal.
> 
> I get the following entries in the log file:
> 2009-09-22 14:10:21, DEBUG   : Unable to match uninstall key with regular expression: Unerwarteter Quantifizierer
> 2009-09-22 14:10:21, DEBUG   : Uninstall entry 'Notepad++' matches string 'Notepad++'.
> 2009-09-22 14:10:21, DEBUG   : Uninstall entry for Notepad++ was found: test successful
> <<

Well, the output might be slightly "irritating" I admit. Let me explain. WPKG
iterates through all uninstall entries and checks first if it matches directly.
Let's assume in your case an uninstall entry - let's say "2007 Office System" -
is found. Now WPKG tries to match this string directly to "Notepad++". It will
fail of course. Then WPKG will try if the regular expression "^Notepad++$"
matches the string which will throw an exception because ++ is not a valid
expression.

As a result the first message you see (unless Notepad++ is the first uninstall
registry entry) will be a failed regex match.

Then WPKG disables further regex matching to prevent further errors. This has no
drawbacks since the first try (with the first uninstall key approached) showed
that the string does not qualify for regex usage.

I've slightly changed the output in this case:
dinfo("Unable to match uninstall key with regular expression. " +
		"Usually this means that the string '" + nameSearched +
		"'does not qualify as a regular expression: "
		+ error.description);

So you will see an output like
"Unable to match uninstall key with regular expression. Usually this means that
the strin 'Notepad++' does not qualify as a regular expression: Unexpected
Quantifier".

This change will be included with the next checkin which hopefully finally adds
environment variable expansion for check values.

br,
Rainer



More information about the wpkg-users mailing list