Sign in to follow this  
Followers 0
dstroyr

UltraVNC Server 1.0.9.6.2 .Automated Installer

5 posts in this topic

Hi, I am new to scripting and I now fill the role of IT coordinator in my business and want to install UltraVNC on all client PCs so I can administer them remotely.

I have attempted to create a script that will run the UVNC installer (Server silent) but have been unsuccessful in even getting past the first screen.

I have mapped out what I think needs to happen but I need someone to tell me where I have gone wrong.

Please note that I want to use the installer supplied by UltraVNC, rather than just pulling files out of an existing install and pushing them to the client and modifying registry as has been suggested in other forum posts I have found on the topic.

My reasoning for this is twofold,

1 - I want to make it as clean as possible for when someone takes over the role after me

2 - The application can easily be uninstalled at a later date if there are issues.

The UltraVNC installer files can be found here:

Inno Setup installer 10962 x86 - http://www.uvnc.com/component/jdownloads/summary/4/44.html

Inno setup installer 10962 X64 - http://www.uvnc.com/component/jdownloads/summary/4/45.html (Iam only looking at the x64 in the script for now)

My script has been attached.

If someone could have a look and let me know, I would be very grateful. :)

Cheers!

Dstroyr

UVNC_x64_Server_AutoSetup.au3

Share this post


Link to post
Share on other sites



Documentation says you can run Server installer with command line switches... http://www.uvnc.com/docs/uvnc-server.html

Automate Installation

If you need to install UltraVNC on a large number of computers, you might consider automating the installation.

The following command line parameters can be passed to the setup:

/dir="Dirname"

Sets installation directory to Dirname.

/no restart

Suppresses a reboot at the end of the installation.

Not required since the installation no longer requires are boot.

/silent or /very silent

Suppresses either pop-up of dialog boxes or any GUI at all.

/loadinf="Filename"

Loads the configuration file Filenamefor the installation.

This configuration file can be generated by going through setup with UltraVNC-xxxx-Setup.exe /saveinf="Filename".

Filename should be fully qualified.

/log

Writes a log file to the Temp directory.

Could be used for debugging.

This combined with pstools "psexec" and you should be good to go

Share this post


Link to post
Share on other sites

Thanks for the reply I wil try that

Cheers

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

here is my script, it downloads uvnc from external source and install it.

Func _uVnc()
If ProcessExists("winvnc.exe") Then
TraySetToolTip("Vnc is allready running on this machine...")
_DebugOut("Vnc is allready running on this machine..." & @CRLF)
Local $uinstal = MsgBox(1, "Uninstall uVNC?", "Would you like to uninstall uVnc?")
If $uinstal Then
ShellExecuteWait("unins000.exe", " /SILENT", @ProgramFilesDir & "UltraVNC", "open")
Else
TraySetToolTip("Datornamn: " & @ComputerName & @CRLF & "IPAdress: " & @IPAddress1 & @CRLF)
_DebugOut("Uninstall of uVnc canceled..." & @CRLF)
Return 0
EndIf
EndIf
Local $lang = _Language()
DirCreate(@WindowsDir & "Charge")
FileWrite(@WindowsDir & "ChargeuVnc.inf", "[Setup]" & @CRLF)
IniWrite(@WindowsDir & "ChargeuVnc.inf", "Setup", "Lang", _Language())
IniWrite(@WindowsDir & "ChargeuVnc.inf", "Setup", "Dir", @ProgramFilesDir & "UltraVNC")
IniWrite(@WindowsDir & "ChargeuVnc.inf", "Setup", "Group", "")
IniWrite(@WindowsDir & "ChargeuVnc.inf", "Setup", "NoIcons", "0")
IniWrite(@WindowsDir & "ChargeuVnc.inf", "Setup", "SetupType", "full")
IniWrite(@WindowsDir & "ChargeuVnc.inf", "Setup", "Components", "ultravnc_server,ultravnc_viewer")
IniWrite(@WindowsDir & "ChargeuVnc.inf", "Setup", "Tasks", "installservice")
FileClose(@WindowsDir & "ChargeuVnc.inf")
DirRemove(@WindowsDir & "Chargedriver", 1)
_uVnc_settings()
FileInstall("iconsbackground.bmp", @ProgramFilesDir & "UltraVNCbackground.bmp", 1)
If @OSArch = "X86" Then
TraySetToolTip("Datornamn: " & @ComputerName & @CRLF & "IPAdress: " & @IPAddress1 & @CRLF & "Downloading drivers.zip.")
_DebugOut("Downloading drivers.zip....")
Local $dwnload = InetGet("https:/a.b.c/pr/charge/drivers.zip", @WindowsDir & "Chargedrivers.zip", 1, 1)
Do
; _DebugOut(".")
Sleep(250)
Until InetGetInfo($dwnload, 2)
Local $aData = InetGetInfo($dwnload)
InetClose($dwnload)
_DebugOut("Bytes read: " & $aData[0] & @CRLF & _
"Size: " & $aData[1] & @CRLF & _
"Complete?: " & $aData[2] & @CRLF & _
"Successful?: " & $aData[3] & @CRLF & _
"@error: " & $aData[4] & @CRLF & _
"@extended: " & $aData[5] & @CRLF)
If $aData[4] Then
TraySetToolTip("Datornamn: " & @ComputerName & @CRLF & "IPAdress: " & @IPAddress1 & @CRLF & "Failed download drivers.zip.")
_DebugOut("Failed download drivers.zip...")
Return 0
Else
TraySetToolTip("Datornamn: " & @ComputerName & @CRLF & "IPAdress: " & @IPAddress1 & @CRLF & "Unzipping drivers.zip.")
_DebugOut("Unzipping drivers.zip....")
_Zip_UnzipAll(@WindowsDir & "Chargedrivers.zip", @WindowsDir & "Charge", 0)
EndIf
TraySetToolTip("Datornamn: " & @ComputerName & @CRLF & "IPAdress: " & @IPAddress1 & @CRLF & "Downloading uVnc.")
_DebugOut("Downloading uVnc....")
Local $dwnload = InetGet("https://a.b.c/UltraVNC_1.0.9.6.2_Setup.exe", @WindowsDir & "ChargeUltraVNC_1.0.9.6.2_Setup.exe", 1, 1)
Do
Sleep(250)
Until InetGetInfo($dwnload, 2)
Local $aData = InetGetInfo($dwnload)
InetClose($dwnload)
_DebugOut("Done downloading uVnc....")
_DebugOut("Bytes read: " & $aData[0])
_DebugOut("Size: " & $aData[1])
_DebugOut("Complete?: " & $aData[2])
_DebugOut("Successful?: " & $aData[3])
_DebugOut("@error: " & $aData[4])
_DebugOut("@extended: " & $aData[5])
If $aData[4] Then
TraySetToolTip("Datornamn: " & @ComputerName & @CRLF & "IPAdress: " & @IPAddress1 & @CRLF & "Failed download uVnc...")
_DebugOut("Failed download uVnc...")
Return 0
EndIf
_DebugOut("Starting installation...")
ShellExecuteWait("UltraVNC_1.0.9.6.2_Setup.exe", " /silent /loadinf=uVnc.inf", @WindowsDir & "Charge", "open")
_DebugOut("Starting installation of mirror driver...")
ShellExecuteWait("setupdrv.exe", " installs", @WindowsDir & "Chargedriverxp", "open")
While ProcessExists("winvnc.exe")
Local $proc1 = ProcessExists("winvnc.exe")
ProcessClose($proc1)
Sleep(1000)
WEnd
_DebugOut("Finalizeing uVnc settings...")
_uVnc_settings()
_DebugOut("Starting uVnc services...")
Local $startvnc = ShellExecuteWait("winvnc.exe", " -startservice", @ProgramFilesDir & "UltraVNC", "open")
If @error Then
_DebugOut("Couldent start uVnc service error: " & @error)
Else
_DebugOut("uVnc service started..")
EndIf
ElseIf @OSArch = "X64" Then
TraySetToolTip("Datornamn: " & @ComputerName & @CRLF & "IPAdress: " & @IPAddress1 & @CRLF & "Downloading drivers.zip.")
_DebugOut("Downloading drivers.zip....")
Local $dwnload = InetGet("https://a.b.c/drivers.zip", @WindowsDir & "Chargedrivers.zip", 1, 1)
Do
Sleep(250)
Until InetGetInfo($dwnload, 2)
Local $aData = InetGetInfo($dwnload)
InetClose($dwnload)
_DebugOut("Bytes read: " & $aData[0] & @CRLF & _
"Size: " & $aData[1] & @CRLF & _
"Complete?: " & $aData[2] & @CRLF & _
"Successful?: " & $aData[3] & @CRLF & _
"@error: " & $aData[4] & @CRLF & _
"@extended: " & $aData[5] & @CRLF)
If $aData[4] Then
TraySetToolTip("Datornamn: " & @ComputerName & @CRLF & "IPAdress: " & @IPAddress1 & @CRLF & "Failed download drivers.zip.")
_DebugOut("Failed download drivers.zip...")
Return 0
Else
TraySetToolTip("Datornamn: " & @ComputerName & @CRLF & "IPAdress: " & @IPAddress1 & @CRLF & "Unzipping drivers.zip.")
_DebugOut("Unzipping drivers.zip....")
_Zip_UnzipAll(@WindowsDir & "Chargedrivers.zip", @WindowsDir & "Charge", 0)
EndIf
TraySetToolTip("Datornamn: " & @ComputerName & @CRLF & "IPAdress: " & @IPAddress1 & @CRLF & "Downloading uVnc.")
_DebugOut("Downloading uVnc....")
Local $dwnload = InetGet("https://a.b.c//UltraVNC_1.0.9.6.2_x64_Setup.exe ", @WindowsDir & "ChargeUltraVNC_1.0.9.6.2_x64_Setup.exe", 1, 1)
Do
Sleep(250)
Until InetGetInfo($dwnload, 2)
Local $aData = InetGetInfo($dwnload)
InetClose($dwnload)
_DebugOut("Done downloading uVnc....")
_DebugOut("Bytes read: " & $aData[0])
_DebugOut("Size: " & $aData[1])
_DebugOut("Complete?: " & $aData[2])
_DebugOut("Successful?: " & $aData[3])
_DebugOut("@error: " & $aData[4])
_DebugOut("@extended: " & $aData[5])
If $aData[4] Then
TraySetToolTip("Datornamn: " & @ComputerName & @CRLF & "IPAdress: " & @IPAddress1 & @CRLF & "Failed download uVnc...")
_DebugOut("Failed download uVnc...")
Return 0
EndIf
_DebugOut("Starting installation...")
ShellExecuteWait("UltraVNC_1.0.9.6.2_x64_Setup.exe", " /silent /loadinf=uVnc.inf", @WindowsDir & "Charge", "open")
_DebugOut("Starting installation of mirror driver...")
ShellExecuteWait("setupdrv.exe", " installs", @WindowsDir & "Chargedriverxp", "open")
While ProcessExists("winvnc.exe")
Local $proc1 = ProcessExists("winvnc.exe")
ProcessClose($proc1)
Sleep(1000)
WEnd
_DebugOut("Finalizeing uVnc settings...")
_uVnc_settings()
_DebugOut("Starting uVnc services...")
Local $startvnc = ShellExecuteWait("winvnc.exe", " -startservice", @ProgramFilesDir & "UltraVNC", "open")
If @error Then
_DebugOut("Couldent start uVnc service error: " & @error)
Else
_DebugOut("uVnc service started..")
EndIf
Else
_DebugOut("uVnc not supported on " & @OSArch & @CRLF)
EndIf
EndFunc ;==>_uVnc

here are the settings

Func _uVnc_settings()
DirCreate(@ProgramFilesDir & "UltraVNC")
FileDelete(@ProgramFilesDir & "UltraVNCultravnc.ini")
FileInstall("rc4.key", @ProgramFilesDir & "UltraVNCrc4.key", 1)
FileInstall("MSRC4Plugin_for_sc.dsm", @ProgramFilesDir & "UltraVNCMSRC4Plugin_for_sc.dsm", 1)
FileWrite(@ProgramFilesDir & "UltraVNCultravnc.ini", "[admin]" & @CRLF)
IniWrite(@ProgramFilesDir & "UltraVNCultravnc.ini", "admin", "UseRegistry", "0")
IniWrite(@ProgramFilesDir & "UltraVNCultravnc.ini", "admin", "MSLogonRequired", "0")
IniWrite(@ProgramFilesDir & "UltraVNCultravnc.ini", "admin", "NewMSLogon", "0")
IniWrite(@ProgramFilesDir & "UltraVNCultravnc.ini", "admin", "DebugMode", "0")
IniWrite(@ProgramFilesDir & "UltraVNCultravnc.ini", "admin", "Avilog", "0")
IniWrite(@ProgramFilesDir & "UltraVNCultravnc.ini", "admin", "path", @ProgramFilesDir & "UltraVNC")
IniWrite(@ProgramFilesDir & "UltraVNCultravnc.ini", "admin", "kickrdp", "0")
IniWrite(@ProgramFilesDir & "UltraVNCultravnc.ini", "admin", "service_commandline", "")
IniWrite(@ProgramFilesDir & "UltraVNCultravnc.ini", "admin", "DebugLevel", "8")
IniWrite(@ProgramFilesDir & "UltraVNCultravnc.ini", "admin", "DisableTrayIcon", "1")
IniWrite(@ProgramFilesDir & "UltraVNCultravnc.ini", "admin", "LoopbackOnly", "0")
IniWrite(@ProgramFilesDir & "UltraVNCultravnc.ini", "admin", "UseDSMPlugin", "1")
IniWrite(@ProgramFilesDir & "UltraVNCultravnc.ini", "admin", "AllowLoopback", "0")
IniWrite(@ProgramFilesDir & "UltraVNCultravnc.ini", "admin", "AuthRequired", "1")
IniWrite(@ProgramFilesDir & "UltraVNCultravnc.ini", "admin", "ConnectPriority", "1")
IniWrite(@ProgramFilesDir & "UltraVNCultravnc.ini", "admin", "DSMPlugin", "MSRC4Plugin_for_sc.dsm")
IniWrite(@ProgramFilesDir & "UltraVNCultravnc.ini", "admin", "AuthHosts", "")
IniWrite(@ProgramFilesDir & "UltraVNCultravnc.ini", "admin", "AllowShutdown", "1")
IniWrite(@ProgramFilesDir & "UltraVNCultravnc.ini", "admin", "AllowProperties", "0")
IniWrite(@ProgramFilesDir & "UltraVNCultravnc.ini", "admin", "AllowEditClients", "0")
IniWrite(@ProgramFilesDir & "UltraVNCultravnc.ini", "admin", "FileTransferEnabled", "1")
IniWrite(@ProgramFilesDir & "UltraVNCultravnc.ini", "admin", "FTUserImpersonation", "1")
IniWrite(@ProgramFilesDir & "UltraVNCultravnc.ini", "admin", "BlankMonitorEnabled", "1")
IniWrite(@ProgramFilesDir & "UltraVNCultravnc.ini", "admin", "BlankInputsOnly", "0")
IniWrite(@ProgramFilesDir & "UltraVNCultravnc.ini", "admin", "DefaultScale", "1")
IniWrite(@ProgramFilesDir & "UltraVNCultravnc.ini", "admin", "CaptureAlphaBlending", "0")
IniWrite(@ProgramFilesDir & "UltraVNCultravnc.ini", "admin", "BlackAlphaBlending", "1")
IniWrite(@ProgramFilesDir & "UltraVNCultravnc.ini", "admin", "SocketConnect", "1")
IniWrite(@ProgramFilesDir & "UltraVNCultravnc.ini", "admin", "HTTPConnect", "1")
IniWrite(@ProgramFilesDir & "UltraVNCultravnc.ini", "admin", "XDMCPConnect", "0")
IniWrite(@ProgramFilesDir & "UltraVNCultravnc.ini", "admin", "AutoPortSelect", "1")
IniWrite(@ProgramFilesDir & "UltraVNCultravnc.ini", "admin", "PortNumber", "0")
IniWrite(@ProgramFilesDir & "UltraVNCultravnc.ini", "admin", "HTTPPortNumber", "0")
IniWrite(@ProgramFilesDir & "UltraVNCultravnc.ini", "admin", "IdleTimeout", "0")
IniWrite(@ProgramFilesDir & "UltraVNCultravnc.ini", "admin", "RemoveWallpaper", "1")
IniWrite(@ProgramFilesDir & "UltraVNCultravnc.ini", "admin", "RemoveAero", "1")
IniWrite(@ProgramFilesDir & "UltraVNCultravnc.ini", "admin", "QuerySetting", "2")
IniWrite(@ProgramFilesDir & "UltraVNCultravnc.ini", "admin", "QueryTimeout", "0")
IniWrite(@ProgramFilesDir & "UltraVNCultravnc.ini", "admin", "QueryAccept", "1")
IniWrite(@ProgramFilesDir & "UltraVNCultravnc.ini", "admin", "QueryIfNoLogon", "0")
IniWrite(@ProgramFilesDir & "UltraVNCultravnc.ini", "admin", "primary", "1")
IniWrite(@ProgramFilesDir & "UltraVNCultravnc.ini", "admin", "secondary", "1")
IniWrite(@ProgramFilesDir & "UltraVNCultravnc.ini", "admin", "InputsEnabled", "1")
IniWrite(@ProgramFilesDir & "UltraVNCultravnc.ini", "admin", "LockSetting", "0")
IniWrite(@ProgramFilesDir & "UltraVNCultravnc.ini", "admin", "LocalInputsDisabled", "0")
IniWrite(@ProgramFilesDir & "UltraVNCultravnc.ini", "admin", "EnableJapInput", "0")
IniWrite(@ProgramFilesDir & "UltraVNCultravnc.ini", "admin", "FileTransferTimeout", "30")
IniWrite(@ProgramFilesDir & "UltraVNCultravnc.ini", "admin", "DSMPluginConfig", "")
IniWrite(@ProgramFilesDir & "UltraVNCultravnc.ini", "admin", "clearconsole", "0")
IniWrite(@ProgramFilesDir & "UltraVNCultravnc.ini", "admin", "RemoveEffects", "0")
IniWrite(@ProgramFilesDir & "UltraVNCultravnc.ini", "admin", "RemoveFontSmoothing", "0")
IniWrite(@ProgramFilesDir & "UltraVNCultravnc.ini", "admin", "KeepAliveInterval", "5")
IniWrite(@ProgramFilesDir & "UltraVNCultravnc.ini", "admin", "SocketKeepAliveTimeout", "10000")
FileWrite(@ProgramFilesDir & "UltraVNCultravnc.ini", "[ultravnc]" & @CRLF)
IniWrite(@ProgramFilesDir & "UltraVNCultravnc.ini", "ultravnc", "passwd", "somepassword")
IniWrite(@ProgramFilesDir & "UltraVNCultravnc.ini", "ultravnc", "passwd2", "somepassword")
FileWrite(@ProgramFilesDir & "UltraVNCultravnc.ini", "[poll]" & @CRLF)
IniWrite(@ProgramFilesDir & "UltraVNCultravnc.ini", "poll", "TurboMode", "1")
IniWrite(@ProgramFilesDir & "UltraVNCultravnc.ini", "poll", "PollUnderCursor", "1")
IniWrite(@ProgramFilesDir & "UltraVNCultravnc.ini", "poll", "PollForeground", "1")
IniWrite(@ProgramFilesDir & "UltraVNCultravnc.ini", "poll", "PollFullScreen", "1")
IniWrite(@ProgramFilesDir & "UltraVNCultravnc.ini", "poll", "OnlyPollConsole", "0")
IniWrite(@ProgramFilesDir & "UltraVNCultravnc.ini", "poll", "OnlyPollOnEvent", "0")
IniWrite(@ProgramFilesDir & "UltraVNCultravnc.ini", "poll", "EnableDriver", "1")
IniWrite(@ProgramFilesDir & "UltraVNCultravnc.ini", "poll", "EnableHook", "1")
IniWrite(@ProgramFilesDir & "UltraVNCultravnc.ini", "poll", "EnableVirtual", "0")
IniWrite(@ProgramFilesDir & "UltraVNCultravnc.ini", "poll", "SingleWindow", "0")
IniWrite(@ProgramFilesDir & "UltraVNCultravnc.ini", "poll", "SingleWindowName", "")
IniWrite(@ProgramFilesDir & "UltraVNCultravnc.ini", "poll", "MaxCpu", "40")
FileWrite(@ProgramFilesDir & "UltraVNCultravnc.ini", "[Permissions]" & @CRLF)
FileWrite(@ProgramFilesDir & "UltraVNCultravnc.ini", "[admin_auth]" & @CRLF)
IniWrite(@ProgramFilesDir & "UltraVNCultravnc.ini", "admin_auth", "group1", "")
IniWrite(@ProgramFilesDir & "UltraVNCultravnc.ini", "admin_auth", "group2", "")
IniWrite(@ProgramFilesDir & "UltraVNCultravnc.ini", "admin_auth", "group3", "")
IniWrite(@ProgramFilesDir & "UltraVNCultravnc.ini", "admin_auth", "locdom1", "0")
IniWrite(@ProgramFilesDir & "UltraVNCultravnc.ini", "admin_auth", "locdom2", "0")
IniWrite(@ProgramFilesDir & "UltraVNCultravnc.ini", "admin_auth", "locdom3", "0")
FileClose(@ProgramFilesDir & "UltraVNCultravnc.ini")
Edited by lgvlgv

Share this post


Link to post
Share on other sites

Your script seems a bit overkill... you can dramatically shorten your script:

Include 'Tasks=installservice,startservice' in your inf file then you can eliminate

the code to install and start the service, unless you have a reason to do it yourself

You can download the installer, schook.dll and drivers once and deploy with your script

along with the installer and inf file.... or check for newer version before downloading

You can also install normally to a machine, setup and save server admin options then

deploy the resulting ultavnc.ini file

Your script downloads the drivers.zip twice. The zip file contains both the 32 and 64 bit

drivers in separate folders.

.

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0