I am trying to install the .NET 3.5 Framework using inno setup script file. I have found a way to check if its installed or not online. However, I can not find the inno setup script code to install the .NET framework 3.5 . I should check if the machine is Windows server or Windows user machine (7,8,10 etc) and then install the .NET framework.
Can some one please provide the links/code to install this?
[EDIT]: While executing below code, I am getting an error like "The parameter is incorrect". Can someone explain whats wrong in this code?
[Code]
function EnableDotnet():Boolean;
var ResultCode: Integer;
begin
Exec('Dism', ' DISM /Online /Enable-Feature /FeatureName:NetFx3 /All /NoRestart', '', SW_SHOW, ewWaitUntilTerminated, ResultCode);
if ResultCode = 0 then
Result := True
else
MsgBox('The DotNet Enabling failed!'+SysErrorMessage(ResultCode), mbCriticalError, MB_OK);
end;
function InitializeSetup(): Boolean;
var test: Boolean;
begin
test:=EnableDotnet()
result := false;
end;