User Tools

Site Tools


userspace:ultravnc_viewer

Table of Contents


This is a master copy. Click on <edit this page> and copy the contents under “snipp”. Then create the page for your own script, paste the content to the editor and modify it as you need it.

UltraVNC Viewer

Tested with opsi 4.0.1
requiredWinstVersion >= 4.11.3.6
By MrNiceguy 2013/08/05 16:58

Files can be downloaded at http://www.uvnc.com/downloads/ultravnc.html

Tree:
setup.ins
uninstall.ins
delsub.ins
start.ins
killtask.ins by tobias
ultravnc.ini
ultravncInstall.inf

setup.ins

; Copyright (c) uib gmbh (www.uib.de)
; This sourcecode is owned by uib
; and published under the Terms of the General Public License.
; credits: http://www.opsi.org/credits/
 
[Actions]
requiredWinstVersion >= "4.10.8.6"
 
DefVar $MsiId$
DefVar $UninstallProgram$
DefVar $LogDir$
DefVar $ProductId$  
DefVar $MinimumSpace$
DefVar $InstallDir$
DefVar $ExitCode$
DefVar $LicenseRequired$
DefVar $LicenseKey$
DefVar $LicensePool$
 
Set $LogDir$ = "%SystemDrive%\tmp"
 
; ----------------------------------------------------------------
; - Please edit the following values                             -
; ----------------------------------------------------------------
;$ProductId$ should be the name of the product in opsi
; therefore please: only lower letters, no umlauts, 
; no white space use '-' as a seperator
Set $ProductId$       = "UltraVNC"
Set $MinimumSpace$    = "5 MB"
; the path were we find the product after the installation
Set $InstallDir$      = "%ProgramFiles32Dir%\uvnc bvba\UltraVNC"
Set $LicenseRequired$ = "false"
Set $LicensePool$     = "p_" + $ProductId$
; ----------------------------------------------------------------
 
if not(HasMinimumSpace ("%SystemDrive%", $MinimumSpace$))
	LogError "Not enough space on %SystemDrive%, " + $MinimumSpace$ + " on drive %SystemDrive% needed for " + $ProductId$
	isFatalError
	; Stop process and set installation status to failed
else
	comment "Show product picture"
	ShowBitmap "%ScriptPath%\" + $ProductId$ + ".png" $ProductId$
 
	if FileExists($InstallDir$ + "\winvnc.exe")
		comment "Start uninstall sub section"
		Sub "%ScriptPath%\killtask.ins"	
		Sub "%ScriptPath%\delsub32.ins"
	endif
 
	Message "Installing " + $ProductId$ + " ..."
 
	if $LicenseRequired$ = "true"
		comment "Licensing required, reserve license and get license key"
		Sub_get_licensekey
	endif
 
	comment "Start setup program"
	Winbatch_install
	Sub_check_exitcode
 
	comment "Copy files"
	Files_install /32Bit
 
	comment "Start application"
	Sub "%ScriptPath%\start.ins" 
endif
 
[Winbatch_install]
 "%ScriptPath%\Setup.exe" /verysilent /LOADINF="%ScriptPath%\ultravncInstall.inf" /log /norestart
 
[Files_install]
 copy -s "%ScriptPath%\ultravnc.ini" $InstallDir$
 
[Sub_get_licensekey]
if opsiLicenseManagementEnabled
	comment "License management is enabled and will be used"
 
	comment "Trying to get a license key"
	Set $LicenseKey$ = demandLicenseKey ($LicensePool$)
	; If there is an assignment of exactly one licensepool to the product the following call is possible:
	; Set $LicenseKey$ = demandLicenseKey ("", $ProductId$)
	;
	; If there is an assignment of a license pool to a windows software id, it is possible to use:
	; DefVar $WindowsSoftwareId$
	; $WindowsSoftwareId$ = "..."
	; Set $LicenseKey$ = demandLicenseKey ("", "", $WindowsSoftwareId$)
 
	DefVar $ServiceErrorClass$
	set $ServiceErrorClass$ = getLastServiceErrorClass
	comment "Error class: " + $ServiceErrorClass$
 
	if $ServiceErrorClass$ = "None"
		comment "Everything fine, we got the license key '" + $LicenseKey$ + "'"
	else
		if $ServiceErrorClass$ = "LicenseConfigurationError"
			LogError "Fatal: license configuration must be corrected"
			LogError getLastServiceErrorMessage
			isFatalError
		else 
			if $ServiceErrorClass$ = "LicenseMissingError"
				LogError "Fatal: required license is not supplied"
				isFatalError
			endif
		endif
	endif
else
	LogError "Fatal: license required, but license management not enabled"
	isFatalError
endif
 
 
[Sub_check_exitcode]
comment "Test for installation success via exit code"
set $ExitCode$ = getLastExitCode
; informations to exit codes see
; http://msdn.microsoft.com/en-us/library/aa372835(VS.85).aspx
; http://msdn.microsoft.com/en-us/library/aa368542.aspx
if ($ExitCode$ = "0")
	comment "Looks good: setup program gives exitcode zero"
else
	comment "Setup program gives a exitcode unequal zero: " + $ExitCode$
	if ($ExitCode$ = "1605")
		comment "ERROR_UNKNOWN_PRODUCT	1605	This action is only valid for products that are currently installed."
		comment "Uninstall of a not installed product failed - no problem"
	else
		if ($ExitCode$ = "1641")
			comment "looks good: setup program gives exitcode 1641"
			comment "ERROR_SUCCESS_REBOOT_INITIATED	1641	The installer has initiated a restart. This message is indicative of a success."
		else
			if ($ExitCode$ = "3010")
				comment "looks good: setup program gives exitcode 3010"
				comment "ERROR_SUCCESS_REBOOT_REQUIRED	3010	A restart is required to complete the install. This message is indicative of a success."
			else
				logError "Fatal: Setup program gives an unknown exitcode unequal zero: " + $ExitCode$
				isFatalError
			endif
		endif
	endif
endif

uninstall.ins

; Copyright (c) uib gmbh (www.uib.de)
; This sourcecode is owned by uib gmbh
; and published under the Terms of the General Public License.
; credits: http://www.opsi.org/credits/
 
[Actions]
requiredWinstVersion >= "4.10.8.6"
 
DefVar $MsiId$
DefVar $UninstallProgram$
DefVar $LogDir$
DefVar $ExitCode$
DefVar $ProductId$
DefVar $InstallDir$
DefVar $LicenseRequired$
DefVar $LicensePool$
 
Set $LogDir$ = "%SystemDrive%\tmp"
 
; ----------------------------------------------------------------
; - Please edit the following values                             -
; ----------------------------------------------------------------
Set $ProductId$       = "opsi-template"
Set $InstallDir$      = "%ProgramFiles32Dir%\uvnc bvba\UltraVNC"
Set $LicenseRequired$ = "false"
Set $LicensePool$     = "p_" + $ProductId$
; ----------------------------------------------------------------
 
 
comment "Show product picture"
ShowBitmap "%ScriptPath%\" + $ProductId$ + ".png" $ProductId$
 
Message "Uninstalling " + $ProductId$ + " ..."
 
if FileExists("%ScriptPath%\killtask.ins")
	comment "Sart task kill sub section"
	Sub "%ScriptPath%\killtask.ins"
endif
 
if FileExists("%ScriptPath%\delsub32.ins")
	comment "Start uninstall sub section"
	Sub "%ScriptPath%\delsub32.ins"
endif
 
if $LicenseRequired$ = "true"
	comment "Licensing required, free license used"
	Sub_free_license
endif
 
;[Sub_free_license]
;comment "License management is enabled and will be used"
 
;comment "Trying to free license used for the product"
;DefVar $result$
;Set $result$ = FreeLicense($LicensePool$)
; If there is an assignment of a license pool to the product, it is possible to use
; Set $result$ = FreeLicense("", $ProductId$)
;
; If there is an assignment of a license pool to a windows software id, it is possible to use
; DefVar $WindowsSoftwareId$
; $WindowsSoftwareId$ = "..."
; set $result$ = FreeLicense("", "", $WindowsSoftwareId$)

delsub.ins

; Copyright (c) uib gmbh (www.uib.de)
; This sourcecode is owned by uib gmbh
; and published under the Terms of the General Public License.
; credits: http://www.opsi.org/credits/
 
 
Set $MsiId$ = '{XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX}'
Set $UninstallProgram$ = $InstallDir$ + "\unins000.exe"
 
Message "Uninstalling " + $ProductId$ + " ..."
 
if FileExists($UninstallProgram$)
;	comment "Uninstall program found, starting uninstall"
	Winbatch_uninstall
;	uninstall_exe
	sub_check_exitcode
endif
;if not (GetRegistryStringValue32("[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\" + $MsiId$ + "] DisplayName") = "")
;	comment "MSI id " + $MsiId$ + " found in registry, starting msiexec to uninstall"
;	Winbatch_uninstall_msi
;	sub_check_exitcode
;endif
 
;comment "Uninstall Exe"
;Uninstall_exe /32Bit
 
;comment "Uninstall"
winbatch_uninstall
 
comment "Delete files"
Files_uninstall /32Bit
 
comment "Cleanup registry"
Registry_uninstall /32Bit
 
comment "Delete program shortcuts"
LinkFolder_uninstall
 
[Winbatch_uninstall]
; Choose one of the following examples as basis for program uninstall
;
; === Nullsoft Scriptable Install System ================================================================
; "$UninstallProgram$" /S
  ;net stop uvnc_service
  ;sc delete uvnc_service
  ;Sub "%ScriptPath%\killtask.ins"
  "$UninstallProgram$" /silent /norestart /SUPPRESSMSGBOXES
;
; === Inno Setup ========================================================================================
 
;[uninstall_exe]
; net stop uvnc_service
; sc delete uvnc_service
; "$UninstallProgram$" /silent /norestart /SUPPRESSMSGBOXES
 
;[Winbatch_uninstall_msi]
;msiexec /x $MsiId$ /qb! REBOOT=ReallySuppress
 
[Files_uninstall]
; Example for recursively deleting the installation directory (don't forget the trailing backslash):
;
 delete -sf "$InstallDir$\"
 
[Registry_uninstall]
; Example of deleting a registry key:
;
; deletekey [HKEY_LOCAL_MACHINE\Software\$ProductId$]
 
[LinkFolder_uninstall]
; Example of deleting a folder from AllUsers startmenu:
;
; set_basefolder common_programs
; delete_subfolder $ProductId$
;
; Example of deleting a shortcut from AllUsers desktop:
;
; set_basefolder common_desktopdirectory
; set_subfolder ""
; delete_element $ProductId$
 
[Sub_check_exitcode]
comment "Test for installation success via exit code"
set $ExitCode$ = getLastExitCode
; informations to exit codes see
; http://msdn.microsoft.com/en-us/library/aa372835(VS.85).aspx
; http://msdn.microsoft.com/en-us/library/aa368542.aspx
if ($ExitCode$ = "0")
	comment "Looks good: setup program gives exitcode zero"
else
	comment "Setup program gives a exitcode unequal zero: " + $ExitCode$
	if ($ExitCode$ = "1605")
		comment "ERROR_UNKNOWN_PRODUCT	1605	This action is only valid for products that are currently installed."
		comment "Uninstall of a not installed product failed - no problem"
	else
		if ($ExitCode$ = "1641")
			comment "looks good: setup program gives exitcode 1641"
			comment "ERROR_SUCCESS_REBOOT_INITIATED	1641	The installer has initiated a restart. This message is indicative of a success."
		else
			if ($ExitCode$ = "3010")
				comment "looks good: setup program gives exitcode 3010"
				comment "ERROR_SUCCESS_REBOOT_REQUIRED	3010	A restart is required to complete the install. This message is indicative of a success."
			else
				logError "Fatal: Setup program gives an unknown exitcode unequal zero: " + $ExitCode$
				isFatalError
			endif
		endif
	endif
endif

killtask.ins

[Actions]
setloglevel = 6
requiredWinstVersion >= "4.11.2.9"
 
DefVar $process2$
DefVar $subvar$
DefVar $killtask$
 
DefStringList $processlist$
DefStringList $process$
DefStringList $SearchProcess$
 
;----------Definiere hier welche Programme gesucht und geschlossen werden sollen--------------------------------
set $searchProcess$ = createStringList ('winvnc.exe')
;sollen die Programme automatisch geschlossen werden? ACHTUNG: Datenverlust möglich!
set $killtask$ = "true"
;----------------------------------------------------------------------------------------------------------------
 
for %s% in $SearchProcess$ do sub_checkfunktion
 
[sub_checkfunktion]
set $subvar$ = "%s%"
set $processlist$ = getOutStreamFromSection('DosInAnIcon_checkprocess')
set $process$ = splitString(takeString(1,$processlist$), ",")
set $process2$ = unquote(takeString(1,$processlist$), '"')
 
DosBatch_1
 
if ($process2$ = $subvar$)
Message = "Prozess gefunden"
	if ($killtask$ = "true")
		killtask $subvar$	
	else
		message "killtask is set false"
	endif
else
message = "Prozess nicht gefunden"
endif
 
 
 
[DosInAnIcon_checkprocess]
@echo off
TASKLIST /FI "IMAGENAME eq $subvar$" /fo CSV
 
[DosBatch_1]
	net stop uvnc_service
	sc delete uvnc_service

start.ins

 [Actions]
setloglevel = 6
requiredWinstVersion >= "4.11.2.9"

DefVar $InstallDir$

Set $InstallDir$ = "%ProgramFiles32Dir%\uvnc bvba\UltraVNC\winvnc.exe"


;if FileExist("%ProgramFiles32Dir%\uvnc bvba\UltraVNC\winvnc.exe")
	comment "Start Application"
	DosBatch_1
;endif


[DosBatch_1]
	"%ProgramFiles32Dir%\uvnc bvba\UltraVNC\winvnc.exe"

ultravnc.ini

[ultravnc]
passwd = <password1>      full control password
passwd2 = <password2>     view only password
[admin] 		
FileTransferEnabled=1
FTUserImpersonation=1
BlankMonitorEnabled=1 		
BlankInputsOnly=0 		
CaptureAlphaBlending=1 		
BlackAlphaBlending=0 		
DefaultScale=1
UseDSMPlugin=0
DSMPlugin=path to DSM Plugin
DSMPluginConfig=configuration DSM Plugin
primary=1 		
secondary=0 		
SocketConnect=1 		
HTTPConnect=1
XDMCPConnect=0 		
AutoPortSelect=1
InputsEnabled=1 		
LocalInputsDisabled=0
IdleTimeout=0
EnableJapInput=0 		
QuerySetting=2 		
QueryTimeout=10 		
QueryAccept=0 		
LockSetting=0 		
RemoveWallpaper=1
RemoveEffects=0
RemoveFontSmoothing=0 		
RemoveAero=1
DebugMode=2
Avilog=0 		
path=C:\Programme\uvnc bvba\UltraVnc\log                             		path to ultravnc
DebugLevel=10 		
AllowLoopback=0 		
LoopbackOnly=0 		
AllowShutdown=0 		
AllowProperties=1 		
AllowEditClients=1 		
FileTransferTimeout=30
KeepAliveInterval=5 		
SocketKeepAliveTimeout=10000 		
DisableTrayIcon=0 		
MSLogonRequired=0
NewMSLogon=0 		
ConnectPriority=0 		
UseRegistry=0 		
AuthRequired=1 		
AuthHosts= 		
PortNumber=5900 		
HTTPPortNumber=5800 		
QueryIfNoLogon=1 		
kickrdp=0 		
clearconsole=0 		
[admin_auth] 		
group1=Domain\Admingroup
group2=
group3= 		
locdom1=0
locdom2=0
locdom3=0 		
[poll] 		
TurboMode=1 		
PollUnderCursor=0 		
PollForeground=0 		
PollFullScreen=1 		
OnlyPollConsole=0 		
OnlyPollOnEvent=0 		
MaxCpu=40 		
EnableDriver=0 		
EnableHook=1 		
EnableVirtual=0 		
SingleWindow=0 		
SingleWindowName=
[Permissions]

ultravncinstall.inf

[Setup]
Lang=de
Dir=C:\Program Files\uvnc bvba\UltraVNC
Group=UltraVNC
NoIcons=0
SetupType=server_silent
Components=ultravnc_server
Tasks=installservice,startservice

Steps

  1. install ultravnc server and config it like needed
  2. run the exe with the command “UltraVNC-101-Setup.exe /saveinf=c:\someconfigfile.inf” , this will save the main config file to a path of your choosing.
  3. copy the ultravnc.ini of your installation path and edit it like needed

Change the following headlines to the names of your scripts

myvbs.vbs

;this is my vbs-script...
echo click on "edit this page" to see the complete source.
userspace/ultravnc_viewer.txt · Last modified: 2021/08/23 08:37 (external edit)