Awesome, I'll give this a try.

As far as why not use the VNC deployment tool.... I'm really not sure. It's not 
my environment. I'm just trying to help someone get VNC into ConfigMgr.


________________________________
John Marcum
Sr. Desktop Architect
Bradley Arant Boult Cummings LLP
________________________________

From: listsad...@lists.myitforum.com [mailto:listsad...@lists.myitforum.com] On 
Behalf Of Ryan
Sent: Tuesday, October 01, 2013 6:08 AM
To: scripting@lists.myitforum.com
Subject: Re: [scripting] Script to install VNC

Give this a try... I edited below the line!

I just commented out the parts that reference the temp directory and network 
drive, and then removed those variables from the part of the script that call 
the exe and reg files. As long as I didn't miss anything, it should now install 
if it is in the same directory as the install and reg files.


' *********************************************************
' ** VBScript to deploy VNC Enterprise 4.5 **
'
'Copies VNC setup and .reg file to local temp folder
'Imports .reg file containing VNC settings
'Runs setup file
'Creates license key
'Generates security key
'
' *********************************************************

Set wshShell = CreateObject("WScript.Shell")
Set objFSO = CreateObject("Scripting.FileSystemObject")                         
                                   ' Create the File System Object

strVNCRegKey =                               
"HKEY_LOCAL_MACHINE\SOFTWARE\RealVNC\WinVNC4\"                        ' VNC 
registry key (HKLM) - Keep trailing slash
'strVNCSetupPath =         "\\192.168.1.250\Netapps\VNC Enterprise 
4.5\<file:///\\192.168.1.250\Netapps\VNC%20Enterprise%204.5\>"                  
             ' Path to setup and .reg file on network share - Keep trailing 
slash
strVNCSetupFile =           "vnc-E4_5-x86_x64_win32.exe"                        
                                        ' Full name of setup file with extension
strVNCRegFile =               "vnc_settings.reg"                                
                                          ' Full name of reg file with extension
strVNCInstallPath =         """C:\Program Files\RealVNC\VNC4\"                  
                  ' VNC installation path within 'Program Files' folder - Start 
with """ and end with trailing slash
strVNCConfigExe =          "vncconfig.exe"                                      
                                                          ' Full name of VNC 
config program with extension
strDeployVersion =         "4.5.4"                                              
                                                    ' VNC version to be deployed
'strTempDir =                      "C:\Temp\"                                   
                                                     ' Local temp folder to 
copy files to - Keep trailing slash
strVNCLicKey =                 "XXXXX-XXXXX-XXXX-XXXXX-XXXXX"                   
                                  ' VNC license key
strStartMenuFolder =    wshShell.Environment("PROCESS")("ALLUSERSPROFILE") _
                          & "\Start Menu\Programs\RealVNC"                      
                      ' Path to VNC Start menu folder - NO trailing slash !

' ------------- DO NOT EDIT BELOW THIS LINE -------------


on error resume next

strCurrentVersion = wshShell.RegRead(strVNCRegKey & "Version")                  
                     ' Check for existing VNC version

If strCurrentVersion = strDeployVersion Then                                    
                                ' If already has latest version ...
  wscript.quit                                                                  
                                                                    ' ... end 
script
End If

'If Not objFSO.FolderExists(strTempDir) Then                                    
                                  ' Check for local temp folder
 ' objFSO.CreateFolder(strTempDir)                                              
                                           ' Create local temp folder
'End If

'objFSO.CopyFile strVNCSetupPath & strVNCSetupFile, strTempDir, True            
                   ' Copy VNC setup file to local temp folder
'objFSO.CopyFile strVNCSetupPath & strVNCRegFile, strTempDir, True              
     ' Copy VNC reg settings file to local temp folder

strReturnCode = wshShell.run _
  ("reg import " & strVNCRegFile,0,false)                                       
            ' Import reg settings
strReturnCode = wshShell.run _
  (strVNCSetupFile _
  & " /sp- /silent /norestart " _
  & "/COMPONENTS=WinVNC,WinVNC/VNCMirror",0,true)                               
         ' Run VNC setup file
strReturnCode = wshShell.run _
  (strVNCInstallPath & strVNCConfigExe & """ -license " & strVNCLicKey,0,false) 
' Generate license key
strReturnCode = wshShell.run _
  (strVNCInstallPath & strVNCConfigExe & """ -service -generatekeys",0,false)   
' Generate security key

wshShell.RegWrite strVNCRegKey & "Version", strDeployVersion, "REG_SZ"          
            ' Write VNC version to registry

If objFSO.FolderExists(strStartMenuFolder) Then                                 
                                            ' Check for VNC Start menu group
  objFSO.DeleteFolder(strStartMenuFolder)                                       
                                 ' Delete VNC Start menu group
End If

On Mon, Sep 30, 2013 at 9:12 PM, Marcum, John 
<jmar...@babc.com<mailto:jmar...@babc.com>> wrote:
I was given the script below as how someone is installing Real VNC. It works 
outside of ConfigMgr. I have not tried it within ConfigMgr. I'd like it to use 
the configmgr cache as the source directory rather than the network location 
that's specified in the script. I don't think it needs to copy from the local 
cache to the temp directory like they are doing when they install from the 
network. Can anyone tell me how to accomplish this? Could I simply replace 
\\192.168.1.250\Netapps\VNC<file:///\\192.168.1.250\Netapps\VNC> Enterprise 
4.5\ with "."? The comments say that the strVNCSetupPath needs the trailing 
backslash. If I just put a "." Is that sufficient?



' *********************************************************
' ** VBScript to deploy VNC Enterprise 4.5 **
'
'Copies VNC setup and .reg file to local temp folder
'Imports .reg file containing VNC settings
'Runs setup file
'Creates license key
'Generates security key
'
' *********************************************************

Set wshShell = CreateObject("WScript.Shell")
Set objFSO = CreateObject("Scripting.FileSystemObject")                         
                                   ' Create the File System Object

strVNCRegKey =                               
"HKEY_LOCAL_MACHINE\SOFTWARE\RealVNC\WinVNC4\"                        ' VNC 
registry key (HKLM) - Keep trailing slash
strVNCSetupPath =         "\\192.168.1.250\Netapps\VNC Enterprise 
4.5\<file:///\\192.168.1.250\Netapps\VNC%20Enterprise%204.5\>"                  
             ' Path to setup and .reg file on network share - Keep trailing 
slash
strVNCSetupFile =           "vnc-E4_5-x86_x64_win32.exe"                        
                                        ' Full name of setup file with extension
strVNCRegFile =               "vnc_settings.reg"                                
                                          ' Full name of reg file with extension
strVNCInstallPath =         """C:\Program Files\RealVNC\VNC4\"                  
                  ' VNC installation path within 'Program Files' folder - Start 
with """ and end with trailing slash
strVNCConfigExe =          "vncconfig.exe"                                      
                                                          ' Full name of VNC 
config program with extension
strDeployVersion =         "4.5.4"                                              
                                                    ' VNC version to be deployed
strTempDir =                      "C:\Temp\"                                    
                                                    ' Local temp folder to copy 
files to - Keep trailing slash
strVNCLicKey =                 "XXXXX-XXXXX-XXXX-XXXXX-XXXXX"                   
                                  ' VNC license key
strStartMenuFolder =    wshShell.Environment("PROCESS")("ALLUSERSPROFILE") _
                          & "\Start Menu\Programs\RealVNC"                      
                      ' Path to VNC Start menu folder - NO trailing slash !

' ------------- DO NOT EDIT BELOW THIS LINE -------------


on error resume next

strCurrentVersion = wshShell.RegRead(strVNCRegKey & "Version")                  
                     ' Check for existing VNC version

If strCurrentVersion = strDeployVersion Then                                    
                                ' If already has latest version ...
  wscript.quit                                                                  
                                                                    ' ... end 
script
End If

If Not objFSO.FolderExists(strTempDir) Then                                     
                                 ' Check for local temp folder
  objFSO.CreateFolder(strTempDir)                                               
                                          ' Create local temp folder
End If

objFSO.CopyFile strVNCSetupPath & strVNCSetupFile, strTempDir, True             
                  ' Copy VNC setup file to local temp folder
objFSO.CopyFile strVNCSetupPath & strVNCRegFile, strTempDir, True               
    ' Copy VNC reg settings file to local temp folder

strReturnCode = wshShell.run _
  ("reg import " & strTempDir & strVNCRegFile,0,false)                          
                         ' Import reg settings
strReturnCode = wshShell.run _
  (strTempDir & strVNCSetupFile _
  & " /sp- /silent /norestart " _
  & "/COMPONENTS=WinVNC,WinVNC/VNCMirror",0,true)                               
         ' Run VNC setup file
strReturnCode = wshShell.run _
  (strVNCInstallPath & strVNCConfigExe & """ -license " & strVNCLicKey,0,false) 
' Generate license key
strReturnCode = wshShell.run _
  (strVNCInstallPath & strVNCConfigExe & """ -service -generatekeys",0,false)   
' Generate security key

wshShell.RegWrite strVNCRegKey & "Version", strDeployVersion, "REG_SZ"          
            ' Write VNC version to registry

If objFSO.FolderExists(strStartMenuFolder) Then                                 
                                            ' Check for VNC Start menu group
  objFSO.DeleteFolder(strStartMenuFolder)                                       
                                 ' Delete VNC Start menu group
End If

________________________________

Confidentiality Notice: This e-mail is from a law firm and may be protected by 
the attorney-client or work product privileges. If you have received this 
message in error, please notify the sender by replying to this e-mail and then 
delete it from your computer.

=====================
Is managing company email taking up way too much time?
Let users manage archived email through Outlook and drastically
reduce email storage requirements.

Download trial at http://www.gfi.com/mailarchiver/?adv=930&loc=1


=====================
Is managing company email taking up way too much time?
Let users manage archived email through Outlook and drastically
reduce email storage requirements.

Download trial at http://www.gfi.com/mailarchiver/?adv=930&loc=1
________________________________

Confidentiality Notice: This e-mail is from a law firm and may be protected by 
the attorney-client or work product privileges. If you have received this 
message in error, please notify the sender by replying to this e-mail and then 
delete it from your computer.

________________________________

Confidentiality Notice: This e-mail is from a law firm and may be protected by 
the attorney-client or work product privileges. If you have received this 
message in error, please notify the sender by replying to this e-mail and then 
delete it from your computer.

=====================
Is managing company email taking up way too much time? 
Let users manage archived email through Outlook and drastically
reduce email storage requirements. 

Download trial at http://www.gfi.com/mailarchiver/?adv=930&loc=1

Reply via email to