To verify that Variant NULL uses VarIsNull :
if VarIsNull(XMLNode) then
However, in your case the problem is a little more complicated. The selectSingleNode method always returns a variant of the varDispatch type varDispatch actual data pointer points to the found XML DOM node or to nil if such a node is not found. Delphi (the language Inno Setup Pascal Script is written) has a VarIsClear function that also covers this situation. Unfortunately, it is not published in Inno Setup. However, you can verify this case with the following statement:
if (IDispatch(XMLNode) = nil) then
This will get the data from the returned varDispatch variant and that data for nil .
Martijn Laan added the VarIsClear function to the Unicode version of Inno Setup in this commit , since Inno Setup 5.5.6 you can use VarIsClear instead of the aforementioned hack.
TLama source share