Old 29th October 2014, 21:05   #1
zewari
Junior Member
 
Join Date: Mar 2014
Posts: 17
Question Verifying the presence of a required application

I would like to verify a specific version of a required application is installed prior to executing my installer. I'm aiming for the most light-weight solution, and was hoping for some feedback/direction on how to proceed. After reviewing some of the samples, I'm thinking that the way to go about this would be as follows:
  1. In function .onInit, see if the registry hive for the required program is present in HKLM > Software
  2. If the hive is present, read the value of the version entry, which is expected in the format "9.2.1.1548"
  3. Compare this value with the required version (9.2.x.x). If the first two numbers of the version match, proceed with the installation. If the numbers differ, then abort the installation and report a relevant message.

I've seen some samples that check if a specific version of .NET is installed, but they seem to be far more complicated than what I'm aiming for. Is there an existing sample I can use as a skeleton? Am I on the right track as far as the process I've outlined above? What would I need to do to compare the version number effectively?
zewari is offline   Reply With Quote
Old 29th October 2014, 22:56   #2
Anders
Moderator
 
Anders's Avatar
 
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 5,442
Have you tried VersionCompare in WordFunc.nsh?

IntOp $PostCount $PostCount + 1
Anders is offline   Reply With Quote
Reply
Go Back   Winamp & Shoutcast Forums > Developer Center > NSIS Discussion

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