sohfeyr Posted April 12, 2006 Share Posted April 12, 2006 We have some in-house applications that need the .Net framework to run, but nobody around here wants to install it if they don't already have it. I wrote this little setup bootstrap to detect whether the framework was installed, and if not, to install it silently from a location where it is already downloaded. $HasNet10=(RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\.NETFramework\Policy\v1.0", "3705")="3321-3705") $HasNet11=(RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\.NETFramework\Policy\v1.1", "4322")="3706-4322") $HasNet20=(RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\.NETFramework\Policy\v2.0", "50727")="50727-50727") $Proc = StringUpper(@ProcessorArch); just to be sure it will be recognized ConsoleWrite("Microsoft .Net Version 1.0 Installed? " & $HasNet10 & @cr) ConsoleWrite("Microsoft .Net Version 1.1 Installed? " & $HasNet11 & @cr) ConsoleWrite("Microsoft .Net Version 2.0 Installed? " & $HasNet20 & @cr) Consolewrite("Processor Architecture: " & $Proc & @cr) ;~ Based on http://support.microsoft.com/default.aspx?scid=kb;%5BLN%5D;315291 ;~ For a full list of command-line switches for the .Net installer, see: ;~ http://blogs.msdn.com/astebner/archive/2005/11/07/490167.aspx (1.0, 1.1) ;~ http://blogs.msdn.com/astebner/archive/2005/11/07/490167.aspx (2.0) If $HasNet20=False then if $Proc="X86" then RunWait(@ScriptDir & "\dotnet20\X86\dotnetfx.exe /q") elseif $Proc = "X64" Then RunWait(@ScriptDir & "\dotnet20\X64\netfx64.exe /q") ElseIf $Proc = "IA64" Then RunWait(@ScriptDir & "\dotnet20\IA64\netfx64.exe /q") Else $msg = "The Microsoft .Net Framework 2.0 is not installed, and your system archetecture is not recognized. " $msg = $msg & "The program will take now you to the Microsoft site where you may download the correct package manually." MsgBox(0,"Installer", $msg ) RunWait("http://msdn.microsoft.com/netframework/downloads/updates/default.aspx") EndIf EndIf Run("MyProgram.exe") Mine:Time Functions - Manipulate the system clock! | WinControlList (WinGetClassList++) | .Net Setup Wrapper, Detect or install .Net | Writing and using a VB .NET COM object in AutoItNot mine, but highly recommended:AutoItTreeViewExtension plugin | Menu code | Callback helper dll | Auto3Lib - Control the uncontrollable | Creating COM objects in AutoIt | Using .Net framework classes in AutoIt Link to comment Share on other sites More sharing options...
ramasjang Posted May 19, 2006 Share Posted May 19, 2006 looks great but I get this error: net.au3(4,35) : ERROR: undefined macro. $Proc = StringUpper(@ProcessorArch) Link to comment Share on other sites More sharing options...
Jefflec Posted May 24, 2006 Share Posted May 24, 2006 looks great but I get this error:net.au3(4,35) : ERROR: undefined macro.$Proc = StringUpper(@ProcessorArch)Hi !It seems that sohfeyr is using a beta version of Autoit, it doesn't work on Autoit 3.1.1.Jefflec Link to comment Share on other sites More sharing options...
rbhkamal Posted May 24, 2006 Share Posted May 24, 2006 Nice "When the power of love overcomes the love of power, the world will know peace"-Jimi Hendrix Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now