DOT NET FRAMEWORK Silent Installer

DOT NET FRAMEWORK Silent Installer

I am worling on an Windows Installer program in .net. It required to .Net to work. So we created a Html Application as a start up of our Setup. It first check .net. If .net is not available our Html Application installed it first then start our actual setup.exe. Below is the code for our Html Application.

 

<HTML>
  <HEAD>
    <TITLE>Test for the .NET Framework 3.5</TITLE>
    <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=utf-8" />

    <SCRIPT LANGUAGE="JavaScript">

    <!--

    var dotNet4IndexC;
    var dotNet4IndexE;
    function window::onload()
    {
 var today = new Date();
 //alert(navigator.userAgent);
 dotNet4IndexC=navigator.userAgent.indexOf(".NET4.0C");
 dotNet4IndexE=navigator.userAgent.indexOf(".NET4.0E");
 //alert(dotNet4Index);

 if(dotNet4IndexC!=-1&&dotNet4IndexE!=-1)
  result.innerText = today+"  Dot Net Installed Successfully"
    }

 function installDotNet()
 {
  if(dotNet4IndexC==-1&&dotNet4IndexE==-1)
  { 
   var shell=new ActiveXObject("WScript.Shell");
   var output = shell.Run("cmd /c \"dotNetFx40_Full_x86_x64 /q /norestart\"", 1,true);
   //var output = shell.Exec("cmd /k \"dotNetFx40_Full_x86_x64 /q /norestart\"");
   alert(output);
  }

 }
    
     
    -->
    </SCRIPT>
  </HEAD>
  
  <BODY>
 <div id="result">
  <input type="Button"  value="Install .Net" onclick="installDotNet()"/>
 </div>

  </BODY>
</HTML>
0 Comments
Leave A Comment

Please login to post your valuable comments.

Join the newsletter

Get the latest vLemonn news first

share