Talk:Get .NET Version: Difference between revisions

From NSIS Wiki
Jump to navigationJump to search
No edit summary
 
No edit summary
Line 6: Line 6:
This is my solution for this problem:
This is my solution for this problem:


Function CheckDotNet
  Function CheckDotNet
  StrCpy $0 ''
      StrCpy $0 ''
  ClearErrors
      ClearErrors
  ReadRegStr $R0 HKLM 'SOFTWARE\Microsoft\ASP.NET\1.1.4322.0' 'Path'
      ReadRegStr $R0 HKLM 'SOFTWARE\Microsoft\ASP.NET\1.1.4322.0' 'Path'
  IfErrors 0 +2
      IfErrors 0 +2
      StrCpy $0 'not found'
        StrCpy $0 'not found'
  Push $0
      Push $0
  Exch $0
      Exch $0
FunctionEnd
  FunctionEnd
 


/T
/T

Revision as of 12:16, 14 July 2006

I would say that this isn't the optimal way to do it. Since V2.0 isn't always backwards compatible with V1.1.

I now made an installer for an ASP .NET V1.1 solution. And I needed to be sure that V1.1 was installed. This is my solution for this problem:

  Function CheckDotNet
     StrCpy $0 
     ClearErrors
     ReadRegStr $R0 HKLM 'SOFTWARE\Microsoft\ASP.NET\1.1.4322.0' 'Path'
     IfErrors 0 +2
        StrCpy $0 'not found'
     Push $0
     Exch $0
  FunctionEnd

/T