One of the conditions for showing some UI controls in my Setup application is based on whether a file exists.
This check can't be done through custom actions since even the OnBeforeInstall event happens after install, and the dialog I want to alter is shown before that.
If I was using WiX it would be simple as
<Property Id="FILEEXISTS">
<DirectorySearch Id="CheckFileDir"
Path="[CommonAppDataFolder]Manufacturer\Product"
Depth="0">
<FileSearch Id="CheckFile"
Name="Filename.ext" />
</DirectorySearch>
</Property>
How to do it without WiX?