View Agent 5.1: Best Solution to Install Silently
I had a big problem on last week for upgrade my clients View Agent from 5.0 to 5.1. We are using Windows XP 64-bit form 2 years ago for our Call Center’s clients and I have a plan for upgrade my View servers from 5.1 to 5.2, so I have to upgrade View agents t0 5.1 for compatibility with View 5.2 at least.
As you may know, this OS is not supporting by View agent officially but View agent 4.6, 5.0 and 5.1 can working on that properly. I had upgrade from 4.6 to 5.0 before but I faced with some issues in test step and wrote a script for upgrade agents completely silent.
First Step, Prepare Client for View Agent Installation
First, I want to mention that if you have plan for deploy the agent by SCCM, you should forget that, because it’s impossible.
Anyway, you have 3 issues that you should resolve them to do silent installation:
- Windows XP 64-bit can’t detect digitally sign of USB driver on this release. So you need to change driver signing before start to install. (Figure 1)
- The driver doesn’t be installed automatically. So you should install that manually. (Figure 2)
- After installing audio device by installer, old audio device remains in device manager. (Figure 3)
First step, copy your installation data and scripts to a shared folder with everyone access.
Second step, if you have very secure environment like me that administrative share is disabled on that by your security manager, you have to enable it via registry.
You should run following command lines to enable that:
reg add \\RemoteSystem\hklm\system\currentcontrolset\services\lanmanserver\parameters /v autosharewks /t REG_DWORD /d 1 /fThen you should restart your remote machine:
shutdown /m \\RemoteSystem /f /rNote: Run all command lines from a Windows XP because some of them will not run from Windows 7.
Third step, create a scheduled task and run that manually on target machine, the task will be run by System privilege, you can do it for one or more machine as a batch file:
schtasks /create /S RemoteSystem /RU “NT AUTHORITY\SYSTEM” /TN Support /TR \\Server\shared$\BatchFileName /SC Daily /SD 01/01/2020 /fYou should place the below batch file on your installation folder:
@Echo off REM Detect machine architecture. if defined ProgramFiles(x86) goto INS64 goto INS32 REM Start installation for 32-bit machines. :INS32 REM Create source folder for installation. md c:\Windows\Install REM Copy installation files on local disk of the machine. xcopy \\Server\shared$\Install C:\Windows\Install /s/e/y REM Time-out for complete background processes. timeout /t 100 REM Detect version number of OS. ver | findstr /i “5\.1\.” > nul IF %ERRORLEVEL% EQU 0 goto XP_x86 ver | findstr /i “6\.1\.” > nul IF %ERRORLEVEL% EQU 0 goto Win7_x86 REM Start installation for XP 32-bit. :XP_x86 REM Time-out for complete background processes. timeout /t 10 REM Stop View Agent service. net stop wsnm REM Remove any pending installation application form registry. reg delete hklm\software\microsoft\windows\currentversion\runonce /f reg add hklm\software\microsoft\windows\currentversion\Runonce /f REM Time-out for complete background processes. timeout /t 10 REM Run View Agent executable file and install that with all features silently. C:\Windows\Install\VMware-viewagent-5.1.0-704644.exe /s /v”/qn ADDLOCAL=ALL REBOOT=Reallysuppress” REM Time-out for complete background processes. timeout /t 10 REM Remove installation folder from local drive. RD /s /q C:\Windows\Install REM Time-out for complete background processes. timeout /t 10 REM Disable administrative share that enabled in pre-install step. reg add hklm\system\currentcontrolset\services\lanmanserver\parameters /v autosharewks /t REG_DWORD /d 0 /f REM Time-out for complete background processes. timeout /t 10 REM Force machine to restart for apply changes. shutdown /f /r :Win7_x86 REM Stop View Agent service. net stop wsnm REM Remove any pending installation application form registry. reg delete hklm\software\microsoft\windows\currentversion\runonce /f reg add hklm\software\microsoft\windows\currentversion\Runonce /f REM Time-out for complete background processes. timeout /t 10 REM Run View Agent executable file and install that with all features silently. C:\Windows\Install\VMware-viewagent-5.1.0-704644.exe /s /v”/qn ADDLOCAL=ALL REBOOT=Reallysuppress” REM Time-out for complete background processes. timeout /t 10 REM Remove installation folder from local drive. RD /s /q C:\Windows\Install REM Time-out for complete background processes. timeout /t 10 REM Disable administrative share that enabled in pre-install step. reg add hklm\system\currentcontrolset\services\lanmanserver\parameters /v autosharewks /t REG_DWORD /d 0 /f timeout /t 10 REM Force machine to restart for apply changes. shutdown /f /r REM Start installation for 64-bit machine. :INS64 REM Create source folder for installation. md c:\Windows\Install REM Copy installation files on local disk of the machine. xcopy \\T1vdi049\shared$\Install C:\Windows\Install /s/e/y REM Time-out for complete background processes. timeout /t 10 REM Detect version number of OS. ver | findstr /i “5\.2\.” > nul IF %ERRORLEVEL% EQU 0 goto XP_x64 ver | findstr /i “6\.1\.” > nul IF %ERRORLEVEL% EQU 0 goto Win7_x64 REM Start Installation :XP_x64 REM Time-out for complete background processes. timeout /t 10 taskkill /IM df.exe /F REM Time-out for complete background processes. timeout /t 10 taskkill /IM df64.exe /F REM Edit policy for allow Windows to install unsigned drivers. secedit /configure /db %temp%\temp.sdb /cfg C:\Windows\Install\security.inf REM Time-out for complete background processes. timeout /t 10 REM Stop View Agent service. net stop wsnm REM Remove any pending installation application form registry. reg delete hklm\software\microsoft\windows\currentversion\runonce /f reg add hklm\software\microsoft\windows\currentversion\Runonce /f REM Time-out for complete background processes. timeout /t 10 REM Run View Agent executable file and install that with all features silently. C:\Windows\Install\VMware-viewagent-x86_64-5.1.0-704644.exe /s /v”/qn ADDLOCAL=ALL REBOOT=Reallysuppress” REM Time-out for complete background processes. timeout /t 10 REM Kill Rundll32.exe to close “New Found Hardware Wizard” window. taskkill /IM rundll32.exe /F REM Time-out for complete background processes. timeout /t 10 REM Kill Rundll32.exe to close “New Found Hardware Wizard” window. taskkill /IM rundll32.exe /F REM Time-out for complete background processes. timeout /t 10 REM Kill Rundll32.exe to close “New Found Hardware Wizard” window. taskkill /IM rundll32.exe /F REM Time-out for complete background processes. timeout /t 10 REM Try to install USB driver by DPINST tool. C:\Windows\Install\DPinst\x64\dpinst.exe /lm /sh /sw REM Time-out for complete background processes. timeout /t 10 REM Delete Legal Notice from registry. reg delete hklm\software\microsoft\windows\currentversion\policies\system /v legalnoticecaption /f reg delete hklm\software\microsoft\windows\currentversion\policies\system /v legalnoticetext /f REM Enable auto login on the remote system. REG ADD “HKLM\Software\Microsoft\Windows NT\CurrentVersion\Winlogon” /v AutoAdminLogon /t REG_SZ /d 1 /f REG ADD “HKLM\Software\Microsoft\Windows NT\CurrentVersion\Winlogon” /v DefaultDomainName /t REG_SZ /d “” /f REG ADD “HKLM\Software\Microsoft\Windows NT\CurrentVersion\Winlogon” /v DefaultUserName /t REG_SZ /d DefaultUsername /f REG ADD “HKLM\Software\Microsoft\Windows NT\CurrentVersion\Winlogon” /v DefaultPassword /t REG_SZ /d DefaultPassword /f REM Add registry value for run driver installation after auto login. reg add hklm\software\microsoft\windows\currentversion\runonce /v dpinst /d “c:\windows\install\dpinst\x64\installdrvs.cmd” /f REM Disable administrative share that enabled in pre-install step. reg add hklm\system\currentcontrolset\services\lanmanserver\parameters /v autosharewks /t REG_DWORD /d 0 /f REM Enable auto login on the remote system. timeout /t 10 REM Force machine to restart for apply changes. shutdown /f /r :Win7_x64 REM Stop View Agent service. net stop wsnm REM Remove any pending installation application form registry. reg delete hklm\software\microsoft\windows\currentversion\runonce /f reg add hklm\software\microsoft\windows\currentversion\Runonce /f REM Time-out for complete background processes. timeout /t 10 REM Run View Agent executable file and install that with all features silently. C:\Windows\Install\VMware-viewagent-x86_64-5.1.0-704644.exe /s /v”/qn ADDLOCAL=ALL REBOOT=Reallysuppress” REM Time-out for complete background processes. timeout /t 10 REM Remove installation folder from local drive. RD /s /q C:\Windows\Install REM Time-out for complete background processes. timeout /t 10 REM Disable administrative share that enabled in pre-install step. reg add hklm\system\currentcontrolset\services\lanmanserver\parameters /v autosharewks /t REG_DWORD /d 0 /f timeout /t 10 REM Force machine to restart for apply changes. shutdown /f /r :ENDThen run the task:
schtasks /run /S RemoteSystem /TN SupportIf you run batch file on Windows XP 64-bit another batch file will run after auto logon for install USB driver, remove old devices and remove installation folder.
@echo off @echo Installing drivers in silent mode now… REM Time-out for complete background processes. timeout /t 10 REM Kill Rundll32.exe to close “New Found Hardware Wizard” window. taskkill /IM rundll32.exe /F REM Time-out for complete background processes. timeout /t 10 REM Kill Rundll32.exe to close “New Found Hardware Wizard” window. taskkill /IM rundll32.exe /F REM Time-out for complete background processes. timeout /t 10 REM Kill Rundll32.exe to close “New Found Hardware Wizard” window. taskkill /IM rundll32.exe /F REM Time-out for complete background processes. timeout /t 10 REM Try to install USB driver by DPINST tool. C:\Windows\install\DPinst\x64\dpinst.exe /lm /sh /sw REM Kill Rundll32.exe to close “New Found Hardware Wizard” window. timeout /t 10 REM Remove old audio device. C:\Windows\install\DPinst\x64\DevManView.exe /uninstall ROOT\MEDIA\0001 REM Kill Rundll32.exe to close “New Found Hardware Wizard” window. Timeout /t 10 REM Disable auto login. reg delete “HKLM\Software\Microsoft\Windows NT\CurrentVersion\Winlogon” /v DefaultPassword /f reg delete “HKLM\Software\Microsoft\Windows NT\CurrentVersion\Winlogon” /v DefaultUserName /f REG ADD “HKLM\Software\Microsoft\Windows NT\CurrentVersion\Winlogon” /v AutoAdminLogon /t REG_SZ /d 0 /f REM Reboot machine. shutdown /r /f /t 60 REM Refresh policies. gpupdate /force REM Remove installation folder from local drive. RD /s /q C:\Windows\Install @echo done. exitI’ve uploaded batch files and extracted USB driver for Windows XP 64-bit, also tools on this link.
Further Reading
NFS Client Configuration For My Dummy Colleagues
VMware Horizon View Connection (Session) Duration Report