Prev Previous Post   Next Post Next
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
Go Back   Winamp & Shoutcast Forums > Developer Center > NSIS Discussion

.net, regex

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump