title: Is there any way that we can read the registry version number key in a generic way using NSIS?
body: <p>Using NSIS when installing the newer version of the software, from specific older version no (for eg., 3.01.00) i am upgrading it to the newer version automatically by uninstalling the older version and installing newer version like as shown below:</p>
  
  <p><strong>Note: Here my older version of the software installer is using WIX and the newer installer is using NULLSOFT</strong></p>
  
  <pre><code> ReadRegStr $R1 HKLM "SOFTWARE\Millinnium\3.01.00" "InstallPath"
    ReadRegStr $R2 HKLM "SOFTWARE\Millinnium\3.02.00" "InstallPath"
  
  ${If} $R1 != ""
  
  MessageBox MB_YESNO|MB_ICONQUESTION "$(UninstallPrevVer)" IDYES noUninstOld
  
  Abort
   noUninstOld:
   ExecWait '"MsiExec.exe" /X{8ED262EE-FC73-47A9-BB86-D92223246881} /qb!'  
  
  
  ${ElseIf} $R2 != ""
  
  MessageBox MB_YESNO|MB_ICONQUESTION "$(UninstallPrevVer)" IDYES noUninstOld
  
  Abort
   noUninstOld:
   ExecWait '"MsiExec.exe" /X{8ED262EE-FC73-47A9-BB86-D92223246881} /qb!'  
  
  ${EndIf}
  </code></pre>
  
  <p>But if i have much older versions for eg., &lt;3.01.00 (i.e., 3.0 or 3.0.0.1 or 2.0 or lesser) I wanted to display a generic message displayed stating to uninstall the existing version manually before installing the newer version.</p>
  
  <p><strong>Is there any way that we can read the registry version number key in a generic way?</strong> </p>
  
  <p><strong>or do i need to follow for each version like as shown below?</strong></p>
  
  <pre><code> ReadRegStr $R1 HKLM "SOFTWARE\Millinnium\3.0" "InstallPath"
    ReadRegStr $R2 HKLM "SOFTWARE\Millinnium\3.0.0.1" "InstallPath"
  ReadRegStr $R2 HKLM "SOFTWARE\Millinnium\2.0" "InstallPath"
  </code></pre>