0

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;
NSR
  • 51
  • 1
  • 5
  • Will the solution mentioned in other question works for Windows Server? – NSR Aug 30 '17 at 06:43
  • Do you have any reason to assume it won't? Anyway, that's not a programming question. You should ask that on [su] or [sf]. – Martin Prikryl Aug 30 '17 at 08:07
  • The Reason for asking this is because, if we execute the exe file(dotnetframework installation file) in WindowsServer, it wont install. The process to enable the framework 3.5 is, going to "Turn Windows Features On and OFF" section and following the steps. – NSR Aug 30 '17 at 12:55
  • OK, so find out (or ask elsewhere), what do you need to do to install .NET framework on Windows server (what is not a programming question) and you can come here to ask us how to implement that in Inno Setup. – Martin Prikryl Aug 30 '17 at 13:05
  • You should probably remove the `DISM` from the parameter list. – Martin Prikryl Aug 30 '17 at 15:01
  • I removed it and got error like : An attempt was made to load a program with an incorrect format. Exec('Dism', ' /Online /Enable-Feature /FeatureName:NetFx3 /All /NoRestart', '', SW_SHOW, ewWaitUntilTerminated, ResultCode); – NSR Sep 01 '17 at 07:31
  • First, are you able to execute that `Dism` successfully from command line with the same arguments. – Martin Prikryl Sep 01 '17 at 07:54
  • Yes , I did. No issues there. – NSR Sep 01 '17 at 08:06
  • OK, so edit your question with your new code and the error message, including some screeshots. – Martin Prikryl Sep 01 '17 at 08:11

0 Answers0