+ Post New Thread
Page 2 of 2 FirstFirst 12
Results 16 to 24 of 24
Wired Networks Thread, Deploying .Net Framework 4 in Technical; Short answer is you don't :P That'd be a different script. But to modify the above script assuming you're using ...
  1. #16

    Steve21's Avatar
    Join Date
    Feb 2011
    Location
    Swindon
    Posts
    2,689
    Thank Post
    334
    Thanked 515 Times in 483 Posts
    Rep Power
    179
    Short answer is you don't :P 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:

    Code:
    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 :P (Saying that think I missed one of the "'s on the variable the way you're doing it :P

    If it does complain, just try it with:

    Code:
    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
    Last edited by Steve21; 27th July 2011 at 09:03 AM.

  2. Thanks to Steve21 from:

    Ben-UK (27th July 2011)

  3. #17
    Ben-UK's Avatar
    Join Date
    Jan 2010
    Location
    Nottingham
    Posts
    40
    Thank Post
    6
    Thanked 2 Times in 2 Posts
    Rep Power
    10
    Thanks for your help !

    All sorted now

  4. #18

    Join Date
    May 2008
    Posts
    60
    Thank Post
    1
    Thanked 7 Times in 7 Posts
    Rep Power
    23
    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.

  5. #19
    Steven's Avatar
    Join Date
    Apr 2007
    Location
    Morecambe
    Posts
    114
    Thank Post
    6
    Thanked 1 Time in 1 Post
    Rep Power
    0
    "\\server\NETLOGON\dotNetFx40_Full_x86_x64.exe " /q /norestart

    That works for me

  6. #20
    zag
    zag is offline
    zag's Avatar
    Join Date
    Mar 2007
    Posts
    3,762
    Thank Post
    897
    Thanked 416 Times in 350 Posts
    Blog Entries
    12
    Rep Power
    86
    Quote Originally Posted by Steve21 View Post
    Short answer is you don't :P 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:

    Code:
    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 :P (Saying that think I missed one of the "'s on the variable the way you're doing it :P

    If it does complain, just try it with:

    Code:
    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.

  7. #21

    Steve21's Avatar
    Join Date
    Feb 2011
    Location
    Swindon
    Posts
    2,689
    Thank Post
    334
    Thanked 515 Times in 483 Posts
    Rep Power
    179
    Quote Originally Posted by zag View Post
    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):

    Code:
    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

  8. #22
    zag
    zag is offline
    zag's Avatar
    Join Date
    Mar 2007
    Posts
    3,762
    Thank Post
    897
    Thanked 416 Times in 350 Posts
    Blog Entries
    12
    Rep Power
    86
    I ended up with this

    Code:
    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.

  9. #23
    bandgeekmafia78's Avatar
    Join Date
    May 2007
    Location
    Salford
    Posts
    382
    Thank Post
    88
    Thanked 22 Times in 14 Posts
    Rep Power
    21
    Have Microsoft released a .MSI of V4 yet?

  10. #24


    Join Date
    Mar 2009
    Location
    Leeds
    Posts
    6,577
    Thank Post
    228
    Thanked 853 Times in 732 Posts
    Rep Power
    294
    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

SHARE:
+ Post New Thread
Page 2 of 2 FirstFirst 12

Similar Threads

  1. .NET Framework 4
    By Chuckster in forum Windows
    Replies: 13
    Last Post: 27th June 2011, 01:06 PM
  2. .NET Framework
    By soapyfish in forum Office Software
    Replies: 3
    Last Post: 24th August 2010, 07:39 PM
  3. Deploying .net framework 2.0 via WSUS 3.0
    By randle in forum Windows
    Replies: 7
    Last Post: 3rd October 2007, 01:21 PM
  4. .net Framework 3.0
    By AnnDroyd in forum Windows
    Replies: 5
    Last Post: 25th September 2007, 09:18 AM
  5. Deploying .net Framework 3
    By sidewinder in forum Windows
    Replies: 6
    Last Post: 22nd June 2007, 07:49 AM

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •