Normally, you would run the cleanup utility in GUI mode. It performs uninstall activities and adds a “run once” registry key to continue after the reboot. After the reboot, it finishes the cleanup, which is the ideal scenario.
However, in real life, some PCs may be in a pending reboot state, which can be fixed by adding “restart computer” as the first step. Another issue that may arise is that the cleanup utility sometimes runs but cannot uninstall everything it needs and throws an error. In this case, your only choice is to reboot and repeat the process.
So TS steps for VDA cleanup utility in my case are like this:
1. Reboot
2. cmd /c VDACleanupUtility.exe /silent /noreboot
3. cmd.exe /c REG DELETE HKLM\Software\Microsoft\Windows\CurrentVersion\RunOnce /v CitrixVdaCleanup /f
4. Reboot
5. cmd /c VDACleanupUtility.exe /silent /noreboot
6. Reboot
7. cmd /c VDACleanupUtility.exe /silent /noreboot
8. cmd.exe /c REG DELETE HKLM\Software\Microsoft\Windows\CurrentVersion\RunOnce /v CitrixVdaCleanup /f
9. Reboot
10. cmd /c VDACleanupUtility.exe /silent /noreboot
11. Reboot
Then there is the VDA install part
Using /noresume so it wouldn’t run after reboot and we will call it from TS instead
12.VDAWorkstationSetup_1912.exe /quiet /noreboot /noresume /enable_hdx_ports /enable_framehawk_port /enable_hdx_udp_ports /Enable_REAL_TIME_TRANSPORT /optimize /remotepc /enable_remote_assistance /components VDA /virtualmachine /controllers “
sy4ctxdcp01.corp.ad sy4ctxdcp02.corp.ad nrdctxdcp01.corp.ad nrdctxdcp02.corp.ad” /Exclude “Citrix Telemetry Service”
13. Reboot
14. Repeating step 12 as sometimes it unpacks the content of .exe file and then dies or tries to install and dies half way.
Run this step only if both of the conditions are false
Check if folder C:\ProgramData\Citrix\XenDesktopSetup exists
Check if file C:\Program Files\Citrix\Virtual Desktop Agent\BrokerAgent.exe exists with file version 7.24.3000.9 (that was for 1912 CU3)
15. Reboot
16. Continue install using the unpacked installer
cmd /c continue.bat
Run this step only if this condition is false
Check if file C:\Program Files\Citrix\Virtual Desktop Agent\BrokerAgent.exe exists with file version 7.24.3000.9 (that was for 1912 CU3)
==conttinue.bat==
“C:\ProgramData\Citrix\XenDesktopSetup\XenDesktopVdaSetup.exe” /quiet /noreboot /enable_hdx_ports /enable_framehawk_port /enable_hdx_udp_ports /Enable_REAL_TIME_TRANSPORT /optimize /remotepc /enable_remote_assistance /components VDA /virtualmachine /controllers “
sy4ctxdcp01.corp.ad sy4ctxdcp02.corp.ad nrdctxdcp01.corp.ad nrdctxdcp02.corp.ad” /Exclude “Citrix Telemetry Service”
=============
17. Reboot
18. Repeat step 16
cmd /c continue.bat
Run this step only if this condition is false
Check if file C:\Program Files\Citrix\Virtual Desktop Agent\BrokerAgent.exe exists with file version 7.24.3000.9 (that was for 1912 CU3)
==conttinue.bat==
“C:\ProgramData\Citrix\XenDesktopSetup\XenDesktopVdaSetup.exe” /quiet /noreboot /enable_hdx_ports /enable_framehawk_port /enable_hdx_udp_ports /Enable_REAL_TIME_TRANSPORT /optimize /remotepc /enable_remote_assistance /components VDA /virtualmachine /controllers “
sy4ctxdcp01.corp.ad sy4ctxdcp02.corp.ad nrdctxdcp01.corp.ad nrdctxdcp02.corp.ad” /Exclude “Citrix Telemetry Service”
=============
19. Install Workspace app
Workspace app installer returns some crazy error codes so I just set it “continue on error”
“CitrixWorkspaceApp.exe” /AllowAddStore=N /AutoUpdateCheck=disabled /noreboot /silent /includeSSON /EnableCEIP=false
20. cmd /c “gpupdate /force&shutdown /r”