View Single Post
Old 24th April 2013, 16:01   #1
Junior Member
Join Date: Apr 2013
Posts: 2
Check if file exists by regular expression

I'm attempting to create an installer that checks if the user has Microsoft .Net 4.0 installed, and if he/she doesn't install it for them. The code I have so far to check if .Net is installed is as follows:

!define NETVersion "4.0"
IfFileExists "$WINDIR\Microsoft.NET\Framework\v${NETVersion}" NETFrameworkInstalled 0

The problem is that the version is almost never exactly 4.0, on my computer it's 4.0.30319 so the installer thinks I don't have .Net installed. In addition there's also .Net 4.5 out as well which may complicate things. Is there some way to use regular expressions (or some other technique) to check if a user has a file v${NETVersion}(\.\d+)?? or something similar?

Thanks in advance.
lukbys is offline   Reply With Quote