Tuesday, September 25, 2012

.NET Framework in Windows 8

The only version included in Windows 8 by default is .NET Framework 4.5 which is new version of .NET Framework just appeared in 2012. The only version which you can install on Windows 8 machine is .NET Framework 3.5. What about earlier versions of .NET Framework and applications based on them?

.NET Framework 1.1 is considered fully deprecated in Windows 8, it can't be installed and applications with it can't be used any more - it should be OK since it is really deprecated long ago.

.NET Framework 2.0 and .NET Framework 3.0 is a different case. Since they are parts of .NET Framework 3.5, the applications which use them can be run successfully on Windows 8 but you should install .NET Framework 3.5 instead of 2.0 or 3.0. You can install .NET Framework through installer or you can enable it through Control Panel, more details are here:

http://msdn.microsoft.com/en-us/library/hh506443.aspx

Installers for .NET Framework 2.0 and 3.0 were removed from Microsoft site.

In one of our previous posts we described a function in Inno Setup installer which could check .NET Framework 3.0 presence on the machine, now it should be updated in such a way:
[CustomMessages]
en.dotnetmissing=Our program needs Microsoft .NET Framework 3.0. Would you like to download and install it now?
[Code]
function InitializeSetup(): Boolean;
var
    ErrorCode: Integer;
    netFrameWorkInstalled : Boolean;
    isInstalled: Cardinal;
begin
    result := true;
    isInstalled := 0;
    netFrameworkInstalled := RegQueryDWordValue(HKLM, 'SOFTWARE\Microsoft\NET Framework Setup\NDP\v3.0\Setup',
  'InstallSuccess', isInstalled);
    if ((netFrameworkInstalled)  and (isInstalled <> 1)) then netFrameworkInstalled := false;   
    if netFrameworkInstalled = false then
    begin
        if (MsgBox(ExpandConstant('{cm:dotnetmissing}'),
            mbConfirmation, MB_YESNO) = idYes) then
        begin
          ShellExec('open',
          'http://www.microsoft.com/en-us/download/details.aspx?id=21',
          '','',SW_SHOWNORMAL,ewNoWait,ErrorCode);
        end;
        result := false;
    end;
end;
The only difference is that URL for downloading of .NET Framework should point to .NET Framework 3.5 now, not 3.0. 

Please note that registry key 'SOFTWARE\Microsoft\NET Framework Setup\NDP\v3.0\Setup' should not be changed since .NET 3.5 installer proceeds this key in the correct way also.


2 comments:

  1. Hey hi. Nice posting. Thanks for sharing it.

    ReplyDelete
  2. Nice blog, here I had an opportunity to learn something new in my interested domain. I have an expectation about your future post so please keep updates.

    ReplyDelete