Startup Script Deployment

From EduVNC

Jump to: navigation, search

Note: Deploying EduVNC via start up script is very straight forward for a start up script, but there are easier ways to deploy EduVNC. We recommend using wither a software management system like wpkg or Active Directory Deployment where possible.

Contents

Choosing the Installer

Scripted install can be done with either the the EXE or MSI version of the installer. This page will focus on installing the EXE installer. This is partially because that installer allows for more features and customization and partially because there are a number of MSI resources available via a Google search which cover that approach. We recommend the Unattended project's installer summery page as a good external resource for both our MSI and EXE (which uses the Nullsoft Scriptable Install System) installers. The MSI installers are really designed for Active Directory Deployment.

Installing from a Script

If you do not have an existing start up script or wish to create a separate one for EduVNC then first create a basic start up script for the Users or OU you wish to deploy to. There are several guides for this process from Microsoft and www.tutorial5.com. If you have a existing start up script you can modify it to install EDuVNC as well. To instruct EduVNC to silently install add the following sample code to the start up script:

@if not exist "%ProgramFiles%\EduVNC\EduVNC.exe" call "\\server\share\path\to\file\InstallEduVNC.exe" /s

The @ symbol prevents the line from producing output, the if statement tests if the EduVNC.exe file is installed and if it is not, then the call command starts the EduVNC silent installer. Because start up scripts are run as system, there should be no permissions problems. If you use a log in script the install will only work for those users with access to install applications (typically those in the 'power users' and/or 'administrators' group).

Upgrading from a Script

To upgrade EduVNC we need to use a small vbs file called fileVersion.vbs to check the version of EduVNC.exe and see if an upgrade is needed. Typically you would create the fileVersion.vbs in the same folder as InstallEduVNC.exe.

fileVersion.vbs :

Dim verNum
Dim fso

Sub CheckStartMode
     ' Returns the running executable as upper case from the last \ symbol
     strStartExe = UCase( Mid( wscript.fullname, instrRev(wscript.fullname, "\") + 1 ) )

     If Not strStartExe = "CSCRIPT.EXE" Then
          ' This wasn't launched with cscript.exe, so relaunch using cscript.exe explicitly!
          ' wscript.scriptfullname is the full path to the actual script

          set           oSh = CreateObject("wscript.shell")
          oSh.Run "cscript.exe """ & wscript.scriptfullname & """"
          wscript.quit

     End If
End Sub

CheckStartMode
Set fso = CreateObject("scripting.filesystemobject")
verNum = fso.GetFileVersion (WScript.Arguments(0))
Set wsShell = CreateObject("Wscript.Shell")
Wscript.StdOut.Write(verNum)

The command to install is similar to the first time install, add the following code to the start up script:

@call cscript "\\server\share\path\to\file\fileVersion.vbs" "%ProgramFiles%\EduVNC\EduVNC.exe" >"%ProgramFiles%\EduVNC\version"
@set /P EduVNCVer=<"%ProgramFiles%\EduVNC\version"

@if not "%EduVNCVer%"=="new.EduVNC.version.number" goto EduVNCdone
@taskkill /f /t /im EduVNC.exe 
@call "\\server\share\path\to\file\InstallEduVNC.exe" /s
:EduVNCdone

The fileVersion.vbs script will read any file and print our its version number, which we redirect into the version file. We then set the %EduVNCVer% variable to have the same value as the version file's first line (ie the version of the installed EduVNC.exe). If that version is not identical to new.EduVNC.version.number we kill any running EduVNC.exe files so the install can start and then silently install. You will need to replace new.EduVNC.version.number with the version number the installer is installing.

Notes

This only deploys or update EduVNC, it does not setup and services. If you want to also setup services or change existing services follow the guide to Remotely Deploy Settings inside the start up script.

Personal tools