Steven Posted May 23, 2011 Posted May 23, 2011 Hi All, I need to upgrade PARS to the latest version but also need to deploy .Net Framework 4 to enable this to work correctly. Could someone point me in the right direction of deploying Framework 4 (We don't have a WSUS) Thank you.
Mcshammer_dj Posted May 23, 2011 Posted May 23, 2011 if you have a wsus setup then allow it and this will update all PC etc If not then a network share and a batch file will also work
Steven Posted May 23, 2011 Author Posted May 23, 2011 Do you have a link to a script I could maybe use? Thanks.
robyholmes Posted May 23, 2011 Posted May 23, 2011 Look what I worked on today! It pretty simple VBS to run the install if the PC's name doesn't have a text file in a folder. (I'm pretty new to VBS to all you expects out there tear it apart please, feedback is welcome). If you delete the txt file it should reinstall (If needed, update etc?) On Error Resume Next 'VBS DotNet Install Script - Rob Holmes 2011 'Sets objects Set objshell = CreateObject("WScript.Shell") Set WshNetwork = WScript.CreateObject("WScript.Network") Set objFSO = CreateObject("Scripting.FileSystemObject") Set WSHShell = WScript.CreateObject("WScript.Shell") 'Set variables - /////EDIT FROM HERE\\\\ 'Get the host name from the PC running the script pcname = WshNetwork.ComputerName 'Path to folder where the PC named text file will be created. dotnetpc = "\\server\REMINST\Applications\DotNet\Installed PCs\" & pcname & ".txt" 'Path to the exe installer, could be used for future versions as well. dotnetexe = "\\server\REMINST\Applications\DotNet\4.0\dotNetFx40_Full_x86_x64.exe /q /norestart" 'End of variables /////EDIT TO HERE\\\\\ 'You shouldn't need to edit below this line 'Check if PC already has DotNet installed from folder on server If objFSO.FileExists (dotnetpc) Then 'Do nothing, DotNet is installed. Else 'Installs DotNet WshShell.Run(dotnetexe) 'Create file to show PC has had Dotnet installed objFSO.CreateTextFile dotnetpc End If 1
jcollings Posted May 23, 2011 Posted May 23, 2011 I don't know if PARS is an additional product and you have SIMS as well but if you do SOLUS3 will also allow you to deploy .Net 4 framework too.
Steven Posted May 24, 2011 Author Posted May 24, 2011 Hi, Tried your script but can't seem to get the setup file to run, it leaves the text document on the server to say its been installed but it hasn't? Any ideas? Thanks
robyholmes Posted May 24, 2011 Posted May 24, 2011 Umm, well one problem I did find was it wouldn't wait for the installer to finish before writing the text file, but it should run it even if it doesn't install. You made the change to the EXE location and its somewhere that users can read and exc? Are you running it by GPO startup scripts or just manually? I will try and find away of making the script wait for the installer to finish before writing the file. Maybe some on on here knows. (Maybe this thread would be better in the scripts section?)
Arthur Posted May 24, 2011 Posted May 24, 2011 You can create an AIP with the MSI... http://blogs.msdn.com/b/astebner/archive/2010/06/04/10020299.aspx
d13373d Posted June 24, 2011 Posted June 24, 2011 Thanks for the script. Modified it slightly to just check for the Dotnet 4 reg key to skip installed PCs. Can now have this run at startup from GPO and can just apply to container with all staff PC. 'VBS DotNet 4 Install Script - Micheal Cross 2011 'Credit to Rob Holmes 2011 [url]http://www.edugeek.net/forums/networks/76186-deploying-net-framework-4-a.html[/url] Option Explicit 'Declare variables Dim dotnetexe Dim WSHShell 'Set path to the exe installer. dotnetexe = "\\cpsictserver\netlogon\msi\dotNetFx40_Full_x86_x64.exe /q /norestart" Set WSHShell = WScript.CreateObject("WScript.Shell") 'Check if PC already has DotNet installed If KeyExists("HKLM\SOFTWARE\Microsoft\NET Framework Setup\NDP\v4\Full\Install") Then 'Do nothing, DotNet is installed. Else 'Installs DotNet WshShell.Run(dotnetexe) End If Function KeyExists(key) Dim objShell 'On Error Resume Next Set objShell = CreateObject("WScript.Shell") objShell.RegRead (key) Set objShell = Nothing If Err = 0 Then KeyExists = True End Function 3
Steve_T Posted July 18, 2011 Posted July 18, 2011 (edited) Thanks for the script. Modified it slightly to just check for the Dotnet 4 reg key to skip installed PCs. Can now have this run at startup from GPO and can just apply to container with all staff PC. 'VBS DotNet 4 Install Script - Micheal Cross 2011 'Credit to Rob Holmes 2011 [url]http://www.edugeek.net/forums/networks/76186-deploying-net-framework-4-a.html[/url] Option Explicit 'Declare variables Dim dotnetexe Dim WSHShell 'Set path to the exe installer. dotnetexe = "\\cpsictserver\netlogon\msi\dotNetFx40_Full_x86_x64.exe /q /norestart" Set WSHShell = WScript.CreateObject("WScript.Shell") 'Check if PC already has DotNet installed If KeyExists("HKLM\SOFTWARE\Microsoft\NET Framework Setup\NDP\v4\Full\Install") Then 'Do nothing, DotNet is installed. Else 'Installs DotNet WshShell.Run(dotnetexe) End If Function KeyExists(key) Dim objShell 'On Error Resume Next Set objShell = CreateObject("WScript.Shell") objShell.RegRead (key) Set objShell = Nothing If Err = 0 Then KeyExists = True End Function Hi, i wonder if you can help. I have just got round to testing this out for one of my environments that do not have WSUS in place. During my testing i was receiving errors regarding the registry key. (Error attached) Whilst looking at a few machine i think that the reg path is one step further "HKLM\SOFTWARE\Microsoft\NET Framework Setup\NDP\v4\Full\1003\Install" and have highlighted the section in bold. If i amend the script to this path and run it on a machine that has it installed it is correct and does nothing. However if i run this on a machine that DOES require Dot Net 4 i recevie the same error as attached. Can anyone help, very new to VBS. Edited July 18, 2011 by Steve_T
d13373d Posted July 19, 2011 Posted July 19, 2011 (edited) Hi Steve, I have noticed a slight error in my code that must have been carried over from testing. The Function to check the registry key has a line commented out that shouldn't be. If you replace the function with this code it should work. Function KeyExists(key) Dim objShell On Error Resume Next Set objShell = CreateObject("WScript.Shell") objShell.RegRead (key) Set objShell = Nothing If Err = 0 Then KeyExists = True End Function EDIT: Looking in my registry I have an "Install" key in both "Full" and "Full\1033" folders so either will work. Edited July 19, 2011 by d13373d 2
Ben-UK Posted July 26, 2011 Posted July 26, 2011 Hello, Trying to make use of your script at the moment, thanks ! However cant seem to get it to work I have the script set to run at start up but nothings happening, windows displays running start up scripts for 5 seconds then displays the user login box (win xp sp3) If I try running the script while logged on it runs and opens the "open file security warning" box for dotNetFx40_Full_x86_x64.exe with Run or Cancel options that i have to manually select. I was under the understanding the /q switch in the script should stop this ?? Any help would be great !
Steve21 Posted July 26, 2011 Posted July 26, 2011 Isn't it a /s you want? Silent run of exe, My understanding was /Q only mutes echo replies, Not everything? (May be misunderstanding but worth trying it) Steve
Ben-UK Posted July 27, 2011 Posted July 27, 2011 Thanks for the reply. Tired it but did not work This is what i need to do, The Open File - Security Warning dialog box is displayed when you try to silently install a hotfix or an update by using a Visual Basic script in Windows XP Service Pack 2 Where would i add this code to your script to get it to work ?? set oShell= CreateObject("Wscript.Shell") set oEnv = oShell.Environment("PROCESS") oEnv("SEE_MASK_NOZONECHECKS") = 1 oShell.Run "c:\ms04-038\WindowsXP-KB834707-x86-enu /quiet /passive /norestart",0,True oEnv.Remove("SEE_MASK_NOZONECHECKS")
Steve21 Posted July 27, 2011 Posted July 27, 2011 (edited) Short answer is you don't That'd be a different script. But to modify the above script assuming you're using the one I think you are it'd be: Option Explicit 'Declare variables Dim dotnetexe Dim WSHShell 'Set path to the exe installer. dotnetexe = "\\cpsictserver\netlogon\msi\dotNetFx40_Full_x86_x64.exe /quiet /passive /norestart",0,True" Set WSHShell = WScript.CreateObject("WScript.Shell") 'Check if PC already has DotNet installed If KeyExists("HKLM\SOFTWARE\Microsoft\NET Framework Setup\NDP\v4\Full\Install") Then 'Do nothing, DotNet is installed. Else 'Installs DotNet set oEnv = WshShell.Environment("PROCESS") oEnv("SEE_MASK_NOZONECHECKS") = 1 WshShell.Run(dotnetexe) oEnv.Remove("SEE_MASK_NOZONECHECKS") End If Function KeyExists(key) Dim objShell 'On Error Resume Next Set objShell = CreateObject("WScript.Shell") objShell.RegRead (key) Set objShell = Nothing If Err = 0 Then KeyExists = True End Function Think that's right, unless I missed an edit (Saying that think I missed one of the "'s on the variable the way you're doing it If it does complain, just try it with: wshShell.Run("\\cpsictserver\netlogon\msi\dotNetFx40_Full_x86_x64.exe /quiet /passive /norestart",0,True) Instead of the var to see if it does fix it. Steve Edited July 27, 2011 by Steve21 1
zippo Posted August 1, 2011 Posted August 1, 2011 You can extract the MSI required from dotNetfx40_full_x86_x64 by using the /x switch. This will extract the core and extended versions as MSI's - as x86 and x64 msi installers (ie 4 MSI's) - you will need to deploy as appropriate to your target OS. Probably a bit late to be of any use in this case, but perhaps useful for somebody else having this issue.
Steven Posted August 2, 2011 Author Posted August 2, 2011 "\\server\NETLOGON\dotNetFx40_Full_x86_x64.exe" /q /norestart That works for me
zag Posted August 23, 2011 Posted August 23, 2011 Short answer is you don't That'd be a different script. But to modify the above script assuming you're using the one I think you are it'd be: Option Explicit 'Declare variables Dim dotnetexe Dim WSHShell 'Set path to the exe installer. dotnetexe = "\\cpsictserver\netlogon\msi\dotNetFx40_Full_x86_x64.exe /quiet /passive /norestart",0,True" Set WSHShell = WScript.CreateObject("WScript.Shell") 'Check if PC already has DotNet installed If KeyExists("HKLM\SOFTWARE\Microsoft\NET Framework Setup\NDP\v4\Full\Install") Then 'Do nothing, DotNet is installed. Else 'Installs DotNet set oEnv = WshShell.Environment("PROCESS") oEnv("SEE_MASK_NOZONECHECKS") = 1 WshShell.Run(dotnetexe) oEnv.Remove("SEE_MASK_NOZONECHECKS") End If Function KeyExists(key) Dim objShell 'On Error Resume Next Set objShell = CreateObject("WScript.Shell") objShell.RegRead (key) Set objShell = Nothing If Err = 0 Then KeyExists = True End Function Think that's right, unless I missed an edit (Saying that think I missed one of the "'s on the variable the way you're doing it If it does complain, just try it with: wshShell.Run("\\cpsictserver\netlogon\msi\dotNetFx40_Full_x86_x64.exe /quiet /passive /norestart",0,True) Instead of the var to see if it does fix it. Steve Thanks but It doesnt work. I get an error about the " missing. Can you post the working script? I dont really understand your instructions.
Steve21 Posted August 23, 2011 Posted August 23, 2011 Thanks but It doesnt work. I get an error about the " missing. Can you post the working script? I dont really understand your instructions. I meant like this, (should work): Option Explicit 'Declare variables Dim dotnetexe Dim WSHShell 'Set path to the exe installer. Set WSHShell = WScript.CreateObject("WScript.Shell") 'Check if PC already has DotNet installed If KeyExists("HKLM\SOFTWARE\Microsoft\NET Framework Setup\NDP\v4\Full\Install") Then 'Do nothing, DotNet is installed. Else 'Installs DotNet set oEnv = WshShell.Environment("PROCESS") oEnv("SEE_MASK_NOZONECHECKS") = 1 wshShell.Run("\\cpsictserver\netlogon\msi\dotNetFx40_Full_x86_x64.exe /quiet /passive /norestart",0,True) oEnv.Remove("SEE_MASK_NOZONECHECKS") End If Function KeyExists(key) Dim objShell 'On Error Resume Next Set objShell = CreateObject("WScript.Shell") objShell.RegRead (key) Set objShell = Nothing If Err = 0 Then KeyExists = True End Function
zag Posted August 23, 2011 Posted August 23, 2011 I ended up with this Option Explicit 'Declare variables Dim dotnetexe Dim WSHShell Dim oEnv 'Set path to the exe installer. dotnetexe = "\\rgnew\packages\dotNetFx40_Full_x86_x64.exe /q /norestart" Set WSHShell = WScript.CreateObject("WScript.Shell") 'Check if PC already has DotNet installed If KeyExists("HKLM\SOFTWARE\Microsoft\NET Framework Setup\NDP\v4\Full\Install") Then 'Do nothing, DotNet is installed. Else 'Installs DotNet set oEnv = WshShell.Environment("PROCESS") oEnv("SEE_MASK_NOZONECHECKS") = 1 WshShell.Run(dotnetexe) oEnv.Remove("SEE_MASK_NOZONECHECKS") End If Function KeyExists(key) Dim objShell On Error Resume Next Set objShell = CreateObject("WScript.Shell") objShell.RegRead (key) Set objShell = Nothing If Err = 0 Then KeyExists = True End Function Seems to work for me.
bandgeekmafia78 Posted August 23, 2011 Posted August 23, 2011 Have Microsoft released a .MSI of V4 yet?
sted Posted October 7, 2011 Posted October 7, 2011 incase it any use o anyone (or i lose my pendrive lol) this works for me tested on xp and win7x64 as a startup script (runs on win7 in the background setlocal reg query "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\NET Framework Setup\NDP\v4\Full" if NOT %errorlevel%==1 (goto end) "\\server\packages$\ms msi\Dotnet4\dotNetFx40_Full_x86_x64.exe" /passive /norestart /showfinalerror :End
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