Archive: How to check if a file exists?


How to check if a file exists?
Hello all

I need to have my installer check if a file is installed (specifically to see if WMI is installed) and if it is not, somehow inform them that they need to download and install it, possibly giving them a link righ tin the installer that leads to the correct download page.

I have read that the existence of:

<windows system dir>\WBEM\Wbemcore.dll

is one good way to tell whether ot not WMI is installed or not. How would i make my installer check for this file and report back if it was found or not?

Thanks in advance.


IfFileExists $WINDIR\WBEM\Wbemcore.dll 0 +2
MessageBox MB_OK "WMI is installed"


Read help about


Or $SYSDIR :)