Update: UltraVNC 1.4.3.6 and UltraVNC SC 1.4.3.6: viewtopic.php?t=37885
Important: Please update to latest version before to create a reply, a topic or an issue: viewtopic.php?t=37864

Join us on social networks and share our announcements:
- Website: https://uvnc.com/
- GitHub: https://github.com/ultravnc
- Mastodon: https://mastodon.social/@ultravnc
- Facebook: https://www.facebook.com/ultravnc1
- X/Twitter: https://twitter.com/ultravnc1
- Reddit community: https://www.reddit.com/r/ultravnc
- OpenHub: https://openhub.net/p/ultravnc

Best Practices - Unattended Install?

Post Reply
dyehardfan
Posts: 4
Joined: 2011-01-31 22:16
Location: Hattiesburg, MS

Best Practices - Unattended Install?

Post by dyehardfan »

I am currently using v. 1.08 as I can inject the ultravnc.ini file and rebuild the installer. That doesn't seem to be the case for 1.0.95, so what is everyone doing to complete an unattended installation?
dyehardfan
Posts: 4
Joined: 2011-01-31 22:16
Location: Hattiesburg, MS

Re: Best Practices - Unattended Install?

Post by dyehardfan »

Alright, well since no one chimed in I'll share what I was able to come up with.

I am using a nested script, below is the file structure and the scripts that I am employing to silently install UVNC v1.0.95:

*File Structure:

[UVNC_Install]
  • |_Install.bat
    |_[UltraVNC]
    • |_SecureVNCPlugin.dsm
      |_setup.inf (captured from manual installation)
      |_UVNC_Vwr.exe
      |_ultravnc.cer (trusted driver cert - exported from test machine after manual install)
      |_ultravnc.ini (captured from manual installation/config)

Install.bat:

Code: Select all

::copy installation files into temporary directory
robocopy UltraVNC "%temp%\UltraVNC" *.* /E
::create file structure and copy uvnc config file to uvnc directory
xcopy %temp%\UltraVNC\ultravnc.ini "c:\program files\UltraVNC\" /E
::copy newest version of SecureVNCPlugin to uvnc directory
xcopy %temp%\UltraVNC\SecureVNCPlugin.dsm "c:\program files\UltraVNC\" /E
::import driver certificate as trusted to prevent popup
certutil.exe -addstore "TrustedPublisher" "%temp%\UltraVNC\ultravnc.cer
::install uvnc using predefined parameters
start /wait %temp%\UltraVNC\Ultra.exe /silent /loadinf="%temp%\UltraVNC\setup.inf"
::cleanup installation files/folder
rmdir %temp%\UltraVNC /s /q 
Now I need to figure out what registry changes are made on the server host when you press the CAD button. If I can integrate those into this it will be a completely touch free installation.
Last edited by dyehardfan on 2011-02-09 02:54, edited 1 time in total.
valockar
Posts: 3
Joined: 2011-02-09 10:01

Re: Best Practices - Unattended Install?

Post by valockar »

Hi,

I'm working on a unattended Install too, but I made a VBS to do it ...

Regarding Registry Keys, here's what I found :

In [HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System\], you have to create a value named SoftwareSASGeneration and put it to "dword:00000001"

If your OS is a 64bits, you'll have to create the same value in [HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Policies\System\]

Putting these, I've been able to install it as silently as a ninja 8)
dyehardfan
Posts: 4
Joined: 2011-01-31 22:16
Location: Hattiesburg, MS

Re: Best Practices - Unattended Install?

Post by dyehardfan »

valockar wrote:Hi,

I'm working on a unattended Install too, but I made a VBS to do it ...

Regarding Registry Keys, here's what I found :

In [HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System\], you have to create a value named SoftwareSASGeneration and put it to "dword:00000001"

If your OS is a 64bits, you'll have to create the same value in [HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Policies\System\]

Putting these, I've been able to install it as silently as a ninja 8)
I'd be very interested in seeing your VBscript. I am trying to switch over to all vb, but still learning alot about it. And thanks for the heads up on the RegKey, I'll try that when I get to the office today.
valockar
Posts: 3
Joined: 2011-02-09 10:01

Re: Best Practices - Unattended Install?

Post by valockar »

dyehardfan wrote:I'd be very interested in seeing your VBscript. I am trying to switch over to all vb, but still learning alot about it. And thanks for the heads up on the RegKey, I'll try that when I get to the office today.
I'm not an expert in VBS, but here is the script you've been waiting for.
Hope it will help you (or anybody else).

First, some specs I used on this :

In the same folder you should have
  • Ultravnc setup files for x32 and x64 (named respectively UltraVNC.exe and UltraVNC_x64.exe)
  • A file named uvnc.conf, generated from a manual install on a "master-machine"
  • A ultravnc.ini file, generated from a manual install on a "master-machine"
  • A versiont.txt file, containing only the version number of Ultravnc (usefull to deploy new version)
And here is the script in itself ...

Of course it should be adapted to your environment. For instance, "InstallPath" is a shared folder on the Netlogon Server of my company

Code: Select all

Dim oFSO, VersionFromFile, Version, InstallPath, cmd, verFile
Set oFSO = CreateObject("Scripting.FileSystemObject")
Set WshShell = WScript.CreateObject("WScript.Shell")
InstallPath = xxSomeSharedFolderxx 'Put your path to UltraVNC here

'Beforehand, we overwrite ultravnc.ini
If Not oFSO.FolderExists("C:\Program Files\UltraVNC") Then oFSO.CreateFolder("C:\Program Files\UltraVNC")
oFSO.CopyFile "\" & InstallPath& "ultravnc.ini", "C:\Program Files\UltraVNC\ultravnc.ini", true

'We Test OS version to get correct setup
If oFSO.FolderExists("C:\Program Files (x86)") Then 
	cmd = "\" & InstallPath& "ultraVNC_x64.exe /verysilent /loadinf=" & chr(34) & "\" &  InstallPath& "uvnc.conf" & chr(34) 
Else 
	cmd = "\" & InstallPath & "ultraVNC.exe /verysilent /loadinf=" & chr(34) & "\" &  InstallPath & "uvnc.conf" & chr(34)
End If

'We manage deployment of new version with a text File
If oFSO.FileExists("\" & InstallPath & "Version.txt") Then

	Set VersionFromFile = oFSO.GetFile("\" & InstallPath & "Version.txt")
	
	If (VersionFromFile.Size > 0) Then 
		Version = VersionFromFile.OpenAsTextStream.ReadAll
		Version = RTrim(LTrim(Version))
		If (Len(Version) > 0) Then
			If oFSO.FileExists("C:\Program Files\UltraVNC\winvnc.exe") Then
				If Not oFSO.FileExists("C:\Program Files\UltraVNC" & Version & ".txt" ) Then
					set proc = WshShell.Exec(cmd)
					waitFor(proc)
					Set verFile = oFSO.CreateTextFile("C:\Program Files\UltraVNC" & Version & ".txt")
					verFile.WriteLine(chr(32))
					verFile.Close
				End If
			Else
				set proc = WshShell.Exec(cmd)
				waitFor(proc)
				Set verFile = oFSO.CreateTextFile("C:\Program Files\UltraVNC" & Version & ".txt")
				verFile.WriteLine(chr(32))
				verFile.Close	
			End If
		End If
	End If
End If

'# Registry Update to allow Ctrl+Alt+Del
WshShell.regWrite "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System\SoftwareSASGeneration",1,"REG_DWORD"
If oFSO.FolderExists("C:\Program Files (x86)") Then WshShell.regWrite"HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Policies\System\SoftwareSASGeneration",1,"REG_DWORD"


'# Free memory
Set oFSO = Nothing
Set WshShell = Nothing
Set cmd = Nothing
Set VersionFromFile = Nothing
Set VerFile = Nothing

'###
'# Little procedure to wait for a command execution to complete

Sub waitFor(cmd)
	Do While Not cmd.StdOut.AtEndOfStream
		Wscript.Sleep 100
	Loop
End Sub
The Version is managed very simply : in version.txt you put your UltraVNC version (here 1095), and change it when you want to update.

If you have any question about this script, I'll be glad to answer them
And of course, any suggestion or tip about my code is welcome :D
B
800
800
Posts: 2338
Joined: 2009-09-09 14:05

Re: Best Practices - Unattended Install?

Post by B »

valockar, are you sure you need that second key for 64 bit? I'm on Vista 64 and never even heard of that key. The normal SoftwareSASGeneration seems to do the trick?
valockar
Posts: 3
Joined: 2011-02-09 10:01

Re: Best Practices - Unattended Install?

Post by valockar »

Not 100% sure in fact ...

I just did a "fc /u /n" between 2 exports of my registry before and after applying changes enabling CAD on server, and there they were ...

The second key might be automatically generated by Windows though ...

Maybe the second key is only usefull if you use the x64 installer (which is what I did on my Win7 x64) ...

Anyway, I didn't think it would hurt to add it since regkeys in "Wow6432Node" seems to be used for compatibility purpose
Last edited by valockar on 2011-02-09 15:26, edited 1 time in total.
B
800
800
Posts: 2338
Joined: 2009-09-09 14:05

Re: Best Practices - Unattended Install?

Post by B »

Interesting. I haven't installed 1.0.9.x yet; I made the SAS change manually a while back (when using ColtB45's UAC-off CAD patch on 1.0.8.2).

My registry doesn't even HAVE a System key here:

HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Policies

That contains <b>only</b> an empty "NonEnum" subkey.

So yeah, maybe the UVNC installer did it...
Post Reply