cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Pellepop
Level 3

Enable .Net 3.51 in Windows 8, Windows 2008/2012 Server

Hi

We have several products that need .Net 3.5 SP1 to run. It´s no problem to install on XP, Vista and Win 7, but in Win 8, Win 2008/2012 Server is there a feature for this. You cannot install .Net from the prerequisite that is included in the installation. You must active the “.Net Framework 3.5 (includes .NET 2.0and 3.0)” under Windows Feature manual. Microsoft has invented a new thing calles Fod (Feature on Demand) :mad: . Is there a way from InstallShield there you can activate Windows Features with out to involve the user with questions?

http://blogs.technet.com/b/askcore/archive/2012/05/14/windows-8-and-net-framework-3-5.aspx


We us InstallShield 20012 Premium

Best regard

Pelle
Labels (1)
0 Kudos
(9) Replies
hidenori
Level 17

We're looking into the issue. I'll post information as soon as we find out a solution.

Regards.
0 Kudos
NeilHayes
Level 5

I need an update on this too, I have the same issue as Pellepop.
0 Kudos
NeilHayes
Level 5

An interesting blog, worth reading.

http://blogs.msdn.com/b/astebner/archive/2008/04/04/8358995.aspx

I think the catch with Windows 8 and Windows 2012 will be that the source will be required or internet connectivity.

OCSetup might fail should it not be available.

Interesting to note that the .NET framework could be disabled.

Neil
0 Kudos
hidenori
Level 17

0 Kudos
DLee65
Level 13

I had to create a C# executable to handle this and insert it as a prerequisite to enable the feature.

I imagine this is what InstallShield has done with their prerequisite as well. It is good that they have created something that can be easily distributed with their software.

[CODE]using System;
using System.Diagnostics;
using System.IO;
using System.Text;
using System.Windows.Forms;


namespace ActivateDotNetFramework
{

/**
* @brief helper library to activate .Net Framework on certain operating systems
*
* @args None
*
*
* @author Daniel Lee
* @date Jan 17,2012
* @version 1.0
* @bug 6540 Role Management tool required for 2008R2 to install .NET 3.5 SP1
**/
class ActivateDotNetFramework
{

[STAThread]
static void Main(string[] args)
{

Process p = null;
ProcessStartInfo startInfo = null;

try
{


//open powershell process to activate the .net framework feature. See:
//http://community.flexerasoftware.com/archive/index.php?t-182914.html
startInfo = new ProcessStartInfo();
startInfo.FileName = "powershell.exe";
startInfo.Arguments = "Import-Module ServerManager ; Add-WindowsFeature as-net-framework";
startInfo.WindowStyle = ProcessWindowStyle.Hidden;
startInfo.UseShellExecute = true;

p = new Process();
p.StartInfo = startInfo;


p.Start();
p.WaitForExit();

}
catch (System.ComponentModel.Win32Exception ex)
{
string sTitle = "AmazingCharts Installer Error";
string sMsg = "";
if (ex.NativeErrorCode == 2)//Win.h FILE_NOT_FOUND define
{
sMsg = "powershell.exe not found. \nMicrosoft .NET Framework Service not enabled. "+
"\nEnable Microsoft .Net Framework using Service Manager manually." +
"\nusing Service Manager in Control Panel, System and Services, Administrative Tools.";
}
else
{
sMsg = "An unhandled exception has occurred. \n Microsoft .NET Framework Service may not have been successfully " +
"activated and will need to be manually activated \nusing Service Manager in Control Panel, System and Services, Administrative Tools.";
}
string sLogMsg = sMsg + "\n\nMessage: " + ex.Message + "\nSource: " + ex.Source +
"\nData: " + ex.Data;
MessageBox.Show(sLogMsg, sTitle, MessageBoxButtons.OK);

}
catch (Exception ex)
{
string sTitle = "AmazingCharts Installer Error";
string sMsg = "An unhandled exception has occurred. \nMicrosoft .NET Framework Service may not have been successfully " +
"activated and will need to be manually activated \nusing Service Manager in Control Panel, System and Services, Administrative Tools.";
string sLogMsg = sMsg + "\n\nMessage: " + ex.Message + "\nSource: " + ex.Source +
"\nData: " + ex.Data;
MessageBox.Show(sLogMsg, sTitle, MessageBoxButtons.OK);


}
finally
{
if (p != null)
p.Close();
}
}
}
}
[/CODE]

Obviously I just copied and pasted the entire C# namespace to the code and if you choose to use it you can clean it up for your own use. Hopefully the code is pretty well self documenting.
0 Kudos
DLee65
Level 13

I just read through the white paper for Windows 8 FoD; not having tested yet on Windows 8 I had no idea of the complications. I doubt that my code solution will work. I am working on getting a copy of Win8 from MSDN sometime today to test. The code solution only works for W2K8r2 systems where .NET 3.5 is installed but disabled and powershell enables the FoD.

Here is the quote from their white paper:

When a user runs a legacy application requiring .NET Framework 3.5, the Windows 8 application compatibility feature detects this condition (via a compatibility shim) and prompts the user to download and install the necessary .NET Framework 3.5 files from Windows Update using a new feature called ‘Features on Demand’ (FoD). This process requires internet access. Only the metadata required to enable the .NET Framework 3.5 is contained in the default Windows image (\sources\install.wim) but the actual binaries are not in the image - this feature state is called “disabled with payload removed”. The .NET Framework 3.5 payload files can only be acquired either from Windows Update or from the installation media in the \sources\sxs folder. For more information, see the Installing the .NET Framework 3.5 on Demand topic on Microsoft Developers Network (MSDN). Once the .NET Framework 3.5 feature is enabled on a PC, the files are serviced just like other operating system files from Windows Update.
0 Kudos
SOHansO
Level 3

Sorry for resurrecting this thread, but I have a question regarding .net 3.5 and win8/win2012.

We are experiencing that the PRQ from Flexera don't always work. Is there any other way to install .net 3.5 offline for instance using redistributables?
0 Kudos
skubiakiv
Level 3

@SOHansO: What exactly are you experiencing? Does it fail to install .NET 3.51? Does the Windows FOD dialog appear instead of the IS prerequisite screen? Something else?

I just downloaded the PRQ the other day and so far it seems to be working fine for me. However, now that I hear you're having problems, I'm a little concerned.
0 Kudos
datamine
Level 6

I've just downloaded and tried to use this prerequisite and it's not working for me either. The Helper.exe seems to be kicking off Windows Modules Installer but after a while all goes quiet and the helper never exits.

Does anyone know if there have been any updates to this?
0 Kudos