Announcement

Collapse
No announcement yet.

.net 4.6.2

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • .net 4.6.2

    Hi

    I've upgraded my app from .NET 4.5 to 4.6.2

    I currently have the .NET 4.5 detection script in my installer but I'm struggling to understand how that could be adapted to 4.6.2.

    Any advice on that?

    Let me know

    Pete

  • #2
    Please see here: https://docs.microsoft.com/en-us/dot...-are-installed

    Ulrich

    Comment


    • #3
      Here's a function we use:

      Code:
      function VerifyDotNetVersion(DotNetKey, MinimumDotNetVersionNumber, MinimumDotNetVersionName)
       
          local DotNetVersionFound = false;
          if (Registry.DoesKeyExist(HKEY_LOCAL_MACHINE, DotNetKey)) then
          
              local DotNetVersion = Registry.GetValue(HKEY_LOCAL_MACHINE, DotNetKey, "Release", true);
          
              if DotNetVersion >= MinimumDotNetVersionNumber then
                  DotNetVersionFound = true;
              end
          end
       
          if not DotNetVersionFound then
              Dialog.Message(SessionVar.Expand("%ProductName%").." Setup",
                  "Installation of the Microsoft .NET Framework " .. MinimumDotNetVersionName ..
                  SessionVar.Expand(" or above is a prerequisite to run the %ProductName%. It is not included with this installation.  It will need to be downloaded from Microsoft's website and installed on the workstation before continuing.\r\n\r\nPlease contact eFreedom Annual Statement Support at %SupportPhone% for additional information and further instructions.\r\n\r\nClick OK to exit this installation."),
                  MB_OK, MB_ICONSTOP);        
              Application.Exit(3);        
          end;
       
      end

      Then we call it from OnStartup with (use the correct version number for the .NET version you are checking for)

      Code:
      -- .NET 4 Reg Key
      local DotNetKey = "SOFTWARE\\Microsoft\\NET Framework Setup\\NDP\\v4\\Full";
      -- .NET 4.5.2 Build Number
      local MinimumDotNetVersion = "461308";
      local MinimumDotNetVersionName = "v4.7.1";
      
      VerifyDotNetVersion(DotNetKey, MinimumDotNetVersion, MinimumDotNetVersionName);
      Hope that helps.

      Greg

      Comment

      Working...
      X