When sequencing FolioView 2012 or 2015 with AppV5 SP3, launching the application after sequencing generates an error:
—————————
Folio Views
—————————
No object handler is registered for this object type.
—————————
OK
—————————
When sequencing FolioView 2012 or 2015 with AppV5 SP3, launching the application after sequencing generates an error:
—————————
Folio Views
—————————
No object handler is registered for this object type.
—————————
OK
—————————
This is the AppV5 Data Precache script we use to load our AppV5 packages on our Citrix XenApp servers. Because we use PVS and store the AppV package installation root folder on a persistent disk, we sometimes encounter issues that require us to ‘clean up’ the package installation root folder before the AppV5 packages will load. What this script attempts to do is setup AppV5 as if it’s a new install, grab any packages from the publishing server, then, if sharedcontentstore is disabled, fully mount/load the packages.
AppV5DataPrecache.cmd
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 |
:: =========================================================================================================== :: :: Created by: Saman Salehian :: Intel Server Team :: IBM Canada Ltd. :: :: Creation Date: Oct 16, 2012 :: Modified Date: Nov 20, 2013 -- Saman Salehian & Trentent Tye - Added load all applications sequentially - App-V 5 :: :: File Name: AppV5_Data_PreCache.cmd :: :: Description: Pre-Cache App-V Applications/Packages on XenApp Server :: Updates: Updated to remove the 15min timeout and added a cleanup to remove stale AppV5 packages :: Updates: Feb 05, 2015 -- TTYE - delete "C:\ProgramData\Microsoft\AppV\Client" added to prevent vDisk from caching faulty junctions :: :: =========================================================================================================== @ECHO OFF CLS ::Check to see if BLD server. If it is, exit the AppV5 precache script ECHO %COMPUTERNAME% | FINDSTR /I /C:"BLD" IF [%ERRORLEVEL%] EQU [0] EXIT IF NOT EXIST "C:\Program Files\Microsoft Application Virtualization\Client\AppVClient.exe" EXIT :: ================================================================================ :: App-V 5 - Set server into offline workergroup :: ================================================================================ ::check for 'T' at the end of the computer name. If 't' exists, set ZDC to test SET ZDC=CTX301 IF /I [%COMPUTERNAME:~-1,1%] EQU [T] SET ZDC=CTX301T >%WINDIR%\Temp\Set-Server-Offline.ps1 ECHO. >>%WINDIR%\Temp\Set-Server-Offline.ps1 ECHO if ( (Get-PSSnapin -Name Citrix.XenApp.Commands -ErrorAction SilentlyContinue) -eq $null ) >>%WINDIR%\Temp\Set-Server-Offline.ps1 ECHO { >>%WINDIR%\Temp\Set-Server-Offline.ps1 ECHO Add-PSSnapin Citrix.XenApp.Commands >>%WINDIR%\Temp\Set-Server-Offline.ps1 ECHO $offline = @() >>%WINDIR%\Temp\Set-Server-Offline.ps1 ECHO $offlineNames = Get-XAWorkerGroup "Offline" -Computername %ZDC% >>%WINDIR%\Temp\Set-Server-Offline.ps1 ECHO $offline += $offlineNames.ServerNames >>%WINDIR%\Temp\Set-Server-Offline.ps1 ECHO $offline += $env:computername >>%WINDIR%\Temp\Set-Server-Offline.ps1 ECHO Set-XAWorkerGroup "Offline" -ServerNames $offline -Computername %ZDC% >>%WINDIR%\Temp\Set-Server-Offline.ps1 ECHO } "%SystemRoot%\system32\WindowsPowerShell\v1.0\powershell.exe" -ExecutionPolicy bypass -file "%WINDIR%\Temp\Set-Server-Offline.ps1" PING LOCALHOST -n 120 >NUL gpupdate /target:computer /force :: Disable Logons reg.exe add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon" /v WinStationsDisabled /t REG_SZ /d 1 /f :: ================================================================================ :: App-V 5 - Set a loop with a break point so this script will retry itself only :: 5 times. :: ================================================================================ IF '%1' GEQ '5' EXIT IF '%1' EQU '' SET COUNT=0 SET /A COUNT=%1+1 :START EVENTCREATE /ID 3 /L SYSTEM /T INFORMATION /SO "AppV5_Data_PreCache.cmd" /D "Starting AppV5_Data_PreCache.cmd %COUNT%" :: ================================================================================ :: App-V 5 - Check if folders still exist in registry, if so create them then :: try removing them again :: ================================================================================ net start appvclient FOR /F "tokens=1-5" %%A IN ('sc query appvclient ^| findstr /i /c:"STATE"') DO IF /I '%%D' EQU 'STOPPED' ( for /f "tokens=1-6" %%a IN ('reg query HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\AppV\Client\Streaming\Packages /s ^| findstr /i /c:"PackageRoot"') DO mkdir %%c ) net start appvclient :: ================================================================================ :: App-V 5 - Remove old packages :: ================================================================================ IF EXIST %SYSTEMROOT%\SysWOW64\notepad.exe ( >Appv5ClientRefresh-01.ps1 ECHO. >>Appv5ClientRefresh-01.ps1 ECHO Import-Module AppVClient >>Appv5ClientRefresh-01.ps1 ECHO Stop-AppvClientConnectionGroup * >>Appv5ClientRefresh-01.ps1 ECHO Stop-AppvClientPackage * >>Appv5ClientRefresh-01.ps1 ECHO Stop-AppvClientConnectionGroup * >>Appv5ClientRefresh-01.ps1 ECHO Stop-AppvClientPackage * >>Appv5ClientRefresh-01.ps1 ECHO Remove-AppvClientConnectionGroup * >>Appv5ClientRefresh-01.ps1 ECHO Remove-AppvClientPackage * "%SystemRoot%\system32\WindowsPowerShell\v1.0\powershell.exe" -ExecutionPolicy bypass -File .\Appv5ClientRefresh-01.ps1 rmdir /s /q "C:\ProgramData\Microsoft\AppV\Client" DEL /F /Q Appv5ClientRefresh-01.ps1 >NUL ) EVENTCREATE /ID 2 /L SYSTEM /T INFORMATION /SO "AppV5_Data_PreCache.cmd" /D "App-V 5 - Remove old packages, ERRORLEVEL %ERRORLEVEL%" :: ================================================================================ :: App-V 5 - Stop Service :: ================================================================================ IF EXIST %SYSTEMROOT%\SysWOW64\notepad.exe ( net stop AppVClient ) EVENTCREATE /ID 2 /L SYSTEM /T INFORMATION /SO "AppV5_Data_PreCache.cmd" /D "App-V 5 - Stop Service, ERRORLEVEL %ERRORLEVEL%" :: ================================================================================ :: App-V 5 - Remove Directory PackageInstallationRoot :: ================================================================================ IF EXIST %SYSTEMROOT%\SysWOW64\notepad.exe ( rmdir /s /q D:\AppVData\PackageInstallationRoot ) mkdir D:\AppVData\PackageInstallationRoot ping 127.0.0.1 >NUL :: ================================================================================ :: App-V 5 - Shorten package paths to hopefully take ownership/delete them :: ================================================================================ D: cd /d D:\AppVData\PackageInstallationRoot IF NOT EXIST D:\AppVData\PackageInstallationRoot GOTO SKIPPATH ECHO. >%TEMP%\shortenPath.ps1 ECHO for ($i=1; $i -le 40; $i++) { >>%TEMP%\shortenPath.ps1 ECHO gci ^| rename-item -newname { [string]($_.name).substring(1) } >>%TEMP%\shortenPath.ps1 ECHO } >>%TEMP%\shortenPath.ps1 "%SystemRoot%\system32\WindowsPowerShell\v1.0\powershell.exe" -ExecutionPolicy bypass -file "%TEMP%\shortenPath.ps1" ::Shorten all version paths as well... for /f %%A IN ('dir /b') do ( cd D:\AppVData\PackageInstallationRoot\%%A "%SystemRoot%\system32\WindowsPowerShell\v1.0\powershell.exe" -ExecutionPolicy bypass -file "%TEMP%\shortenPath.ps1" ) cd /d D:\AppVData del /f /q "%TEMP%\shortenPath.ps1" :SKIPPATH cd /d D:\AppVData :: ================================================================================ :: App-V 5 - Remove Directory PackageInstallationRoot :: ================================================================================ IF EXIST %SYSTEMROOT%\SysWOW64\notepad.exe ( rmdir /s /q D:\AppVData\PackageInstallationRoot ) :: ================================================================================ :: App-V 5 - Take Ownership of PackageInstallationRoot :: ================================================================================ IF EXIST %SYSTEMROOT%\SysWOW64\notepad.exe ( takeown /F D:\AppVData\PackageInstallationRoot /R /A >NUL for /f "tokens=*" %%A IN ('dir /b /s D:\AppVData\PackageInstallationRoot') do takeown /F "%%A" for /f "tokens=*" %%A IN ('dir /b /s D:\AppVData\PackageInstallationRoot') do takeown /F "%%A" /A for /f "tokens=*" %%A IN ('dir /b /s D:\AppVData\PackageInstallationRoot') do icacls %%A /T /grant Administrators:F ) EVENTCREATE /ID 2 /L SYSTEM /T INFORMATION /SO "AppV5_Data_PreCache.cmd" /D "App-V 5 - Take Ownership of PackageInstallationRoot, ERRORLEVEL %ERRORLEVEL%" :: ================================================================================ :: App-V 5 - Grant Control Admins PackageInstallationRoot :: ================================================================================ IF EXIST %SYSTEMROOT%\SysWOW64\notepad.exe ( icacls D:\AppVData\PackageInstallationRoot /T /grant Administrators:F >NUL ) EVENTCREATE /ID 2 /L SYSTEM /T INFORMATION /SO "AppV5_Data_PreCache.cmd" /D "App-V 5 - Grant Control Admins PackageInstallationRoot, ERRORLEVEL %ERRORLEVEL%" :: ================================================================================ :: App-V 5 - Remove Directory PackageInstallationRoot :: ================================================================================ IF EXIST %SYSTEMROOT%\SysWOW64\notepad.exe ( rmdir /s /q D:\AppVData\PackageInstallationRoot ) EVENTCREATE /ID 2 /L SYSTEM /T INFORMATION /SO "AppV5_Data_PreCache.cmd" /D "App-V 5 - Remove Directory PackageInstallationRoot, ERRORLEVEL %ERRORLEVEL%" :: ================================================================================ :: App-V 5 - Take Ownership of PackageInstallationRoot :: ================================================================================ IF EXIST %SYSTEMROOT%\SysWOW64\notepad.exe ( takeown /F D:\AppVData\PackageInstallationRoot /R >NUL ) EVENTCREATE /ID 2 /L SYSTEM /T INFORMATION /SO "AppV5_Data_PreCache.cmd" /D "App-V 5 - Take Ownership of PackageInstallationRoot 2, ERRORLEVEL %ERRORLEVEL%" :: ================================================================================ :: App-V 5 - Grant Control Admins PackageInstallationRoot :: ================================================================================ IF EXIST %SYSTEMROOT%\SysWOW64\notepad.exe ( icacls D:\AppVData\PackageInstallationRoot /T /grant Administrators:F >NUL ) EVENTCREATE /ID 2 /L SYSTEM /T INFORMATION /SO "AppV5_Data_PreCache.cmd" /D "App-V 5 - Grant Control Admins PackageInstallationRoot 2, ERRORLEVEL %ERRORLEVEL%" :: ================================================================================ :: App-V 5 - Remove Directory PackageInstallationRoot :: ================================================================================ IF EXIST %SYSTEMROOT%\SysWOW64\notepad.exe ( rmdir /s /q D:\AppVData\PackageInstallationRoot ) EVENTCREATE /ID 2 /L SYSTEM /T INFORMATION /SO "AppV5_Data_PreCache.cmd" /D "App-V 5 - Remove Directory PackageInstallationRoot 2, ERRORLEVEL %ERRORLEVEL%" :: ================================================================================ :: App-V 5 - Start Service :: ================================================================================ IF EXIST %SYSTEMROOT%\SysWOW64\notepad.exe ( net start AppVClient ) EVENTCREATE /ID 2 /L SYSTEM /T INFORMATION /SO "AppV5_Data_PreCache.cmd" /D "App-V 5 - Start Service, ERRORLEVEL %ERRORLEVEL%" :: ================================================================================ :: App-V 5 - MS provided script to try and ensure we have a clean system. :: ================================================================================ "%SystemRoot%\system32\WindowsPowerShell\v1.0\powershell.exe" -ExecutionPolicy bypass -File "C:\Program Files\Microsoft Application Virtualization\Client\Disable-AppVClient.ps1" -ModulePath "C:\Program Files\Microsoft Application Virtualization\Client\AppvClient\AppvClient.psd1" -RemoveAllPackages -PackageInstallationRoot "D:\AppVData\PackageInstallationRoot" :: ================================================================================ :: App-V 5 - Refresh Published applications :: ================================================================================ IF EXIST %SYSTEMROOT%\SysWOW64\notepad.exe ( schtasks /run /TN \Microsoft\AppV\Publishing\1_global_periodic ) EVENTCREATE /ID 2 /L SYSTEM /T INFORMATION /SO "AppV5_Data_PreCache.cmd" /D "App-V 5 - Refresh Published applications, ERRORLEVEL %ERRORLEVEL%" :: ================================================================================ :: App-V 5 - If packages fail to load, try this script again... :: Note: the following ps1 script will fail if run from %temp% as the user profile :: sometimes closes, deleting the path for the script, before the script is run. :: running it from %windir%\Temp works as it will always be there. :: ================================================================================ :RETRYMOUNT ping 127.0.0.1 -n 60 >NUL EVENTCREATE /ID 2 /L SYSTEM /T INFORMATION /SO "AppV5_Data_PreCache.cmd" /D "App-V 5 - Checking packages..." >%WINDIR%\Temp\check-packages.ps1 ECHO. >>%WINDIR%\Temp\check-packages.ps1 ECHO Write-EventLog –LogName SYSTEM –Source "AppV5_Data_PreCache.cmd" –EntryType Information –EventID 4 –Message ("Starting Check Packages Script") >>%WINDIR%\Temp\check-packages.ps1 ECHO Import-Module AppVClient >>%WINDIR%\Temp\check-packages.ps1 ECHO Get-AppvPublishingServer ^| Sync-AppvPublishingServer >>%WINDIR%\Temp\check-packages.ps1 ECHO Get-AppvClientConnectionGroup >>%WINDIR%\Temp\check-packages.ps1 ECHO Get-AppvClientPackage >>%WINDIR%\Temp\check-packages.ps1 ECHO $apps = Get-AppvClientPackage >>%WINDIR%\Temp\check-packages.ps1 ECHO $SCSMode = Get-ItemProperty -Path HKLM:\SOFTWARE\Microsoft\AppV\Client\Streaming -Name "SharedContentStoreMode" >>%WINDIR%\Temp\check-packages.ps1 ECHO if ($SCSMode.SharedContentStoreMode -eq 0) { $apps ^| Mount-AppvClientPackage } >>%WINDIR%\Temp\check-packages.ps1 ECHO sleep 60 >>%WINDIR%\Temp\check-packages.ps1 ECHO Get-AppvPublishingServer ^| Sync-AppvPublishingServer >>%WINDIR%\Temp\check-packages.ps1 ECHO Get-AppvClientConnectionGroup >>%WINDIR%\Temp\check-packages.ps1 ECHO Get-AppvClientPackage >>%WINDIR%\Temp\check-packages.ps1 ECHO $apps ^| Add-AppvClientPackage >>%WINDIR%\Temp\check-packages.ps1 ECHO $apps ^| Publish-AppvClientPackage -Global >>%WINDIR%\Temp\check-packages.ps1 ECHO $apps = Get-AppvClientPackage >>%WINDIR%\Temp\check-packages.ps1 ECHO if ($SCSMode.SharedContentStoreMode -eq 0) { $apps ^| Mount-AppvClientPackage } >>%WINDIR%\Temp\check-packages.ps1 ECHO $string = $apps ^| Select-Object Name,PercentLoaded ^| out-string >>%WINDIR%\Temp\check-packages.ps1 ECHO $string += $SCSMode ^| Select-Object SharedContentStoreMode ^| out-string >>%WINDIR%\Temp\check-packages.ps1 ECHO Write-EventLog –LogName SYSTEM –Source "AppV5_Data_PreCache.cmd" –EntryType Information –EventID 4 –Message ($string) >>%WINDIR%\Temp\check-packages.ps1 ECHO if ($apps.Count -eq 0) { Start-Process -FilePath "C:\swinst\AppV_Data_PreCache\AppV5_Data_PreCache.cmd" %COUNT% } ping 127.0.0.1 -n 5 >NUL IF EXIST "%WINDIR%\Temp\check-packages.ps1" EVENTCREATE /ID 2 /L SYSTEM /T INFORMATION /SO "AppV5_Data_PreCache.cmd" /D "App-V 5 - Checking packages ps1 exists" "%SystemRoot%\system32\WindowsPowerShell\v1.0\powershell.exe" -ExecutionPolicy bypass -file "%WINDIR%\Temp\check-packages.ps1" EVENTCREATE /ID 2 /L SYSTEM /T INFORMATION /SO "AppV5_Data_PreCache.cmd" /D "App-V 5 - Check Packages Script, ERRORLEVEL %ERROR%" >%WINDIR%\Temp\Set-Server-Online.ps1 ECHO. >>%WINDIR%\Temp\Set-Server-Online.ps1 ECHO if ( (Get-PSSnapin -Name Citrix.XenApp.Commands -ErrorAction SilentlyContinue) -eq $null ) >>%WINDIR%\Temp\Set-Server-Online.ps1 ECHO { >>%WINDIR%\Temp\Set-Server-Online.ps1 ECHO Add-PsSnapin Citrix.XenApp.Commands >>%WINDIR%\Temp\Set-Server-Online.ps1 ECHO Remove-XAWorkerGroupServer -WorkerGroupName "Offline" -ServerNames $env:computername -Computername %ZDC% >>%WINDIR%\Temp\Set-Server-Online.ps1 ECHO } "%SystemRoot%\system32\WindowsPowerShell\v1.0\powershell.exe" -ExecutionPolicy bypass -file "%WINDIR%\Temp\Set-Server-Online.ps1" "%SystemRoot%\system32\WindowsPowerShell\v1.0\powershell.exe" Set-ExecutionPolicy Restricted pushd %~dp0 EVENTCREATE /ID 2 /L SYSTEM /T INFORMATION /SO "AppV5_Data_PreCache.cmd" /D "App-V 5 - Start RegistryStaging" "%SystemRoot%\system32\WindowsPowerShell\v1.0\powershell.exe" -ExecutionPolicy bypass -file "C:\swinst\AppV_Data_PreCache\Appv5RegistryStaging.ps1" EVENTCREATE /ID 2 /L SYSTEM /T INFORMATION /SO "AppV5_Data_PreCache.cmd" /D "App-V 5 - Complete RegistryStaging" pop %~dp0 ping 127.0.0.1 -n 60 >NUL gpupdate /target:computer /force :: Disable Logons reg.exe add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon" /v WinStationsDisabled /t REG_SZ /d 1 /f |
Read More
When publishing AppV5 applications on a PVS server we sometimes encounter an issue where packages do not load. There are usually events logged to event viewer with the following:
Package {5075e8a4-4335-4101-991e-be88f5862575} version {940e4d49-af37-428c-a129-3bd37e3e4539} failed configuration in folder ‘D:\AppVData\PackageInstallationRoot\5075E8A4-4335-4101-991E-BE88F5862575\940E4D49-AF37-428C-A129-3BD37E3E4539’ with error 0xA040132A-0x3. with error 0xA040132A-0x3.
With another event that follows:
Part or all packages publish failed.
published: 14
failed: 10
Please check the error events of ‘Configure/Publish Package’ before this message for the details of the failure.
This issue is typically caused by two factors: folders not existing in the “PackageInstallationRoot”, in my example that is D:\AppVData\PackageInstallationRoot. You can find this value in the registry here:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\AppV\Client\Streaming /v PackageInstallationRoot /d D:\AppVData\PackageInstallationRoot
and registry entries existing here:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\AppV\Client\Streaming\Packages
![]() |
There are more values in the registry then the folder above. |
What you will find is a mismatch between the number of keys in Packages and the number of folders in your PackageInstallationRoot path. For us, our error was we had 14 folders existing in that path, but 10 of them were missing. But we had all 24 values existing in the registry.
To fix this error I created a script to create the missing folders that were found in the registry and doing a get-appvpublishingserver | sync-appvpublishingserver
1 2 3 |
D: cd D:\AppVData\PackageInstallationRoot for /f "tokens=1-6" %%a IN ('reg query HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\AppV\Client\Streaming\Packages /s ^| findstr /i /c:"PackageRoot"') DO mkdir %%c |
And then all applications were able to be published without issue.
Read MoreUse if you want, or not. This virtualization template is to be applied against the sequencer. I’ve found it removes a lot of useless captured information that can get caught in a sequence.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 |
<?xml version="1.0" encoding="utf-8"?> <SequencerTemplate xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <AllowMU>false</AllowMU> <AppendPackageVersionToFilename>true</AppendPackageVersionToFilename> <AllowLocalInteractionToCom>false</AllowLocalInteractionToCom> <AllowLocalInteractionToObject>false</AllowLocalInteractionToObject> <FullVFSWriteMode>true</FullVFSWriteMode> <ExcludePreExistingSxSAndVC>false</ExcludePreExistingSxSAndVC> <FileExclusions> <string>[{CryptoKeys}]</string> <string>[{Common AppData}]\Microsoft\Crypto</string> <string>[{Common AppData}]\Microsoft\Search\Data</string> <string>[{Cookies}]</string> <string>[{History}]</string> <string>[{Cache}]</string> <string>[{Local AppData}]</string> <string>[{Personal}]</string> <string>[{Profile}]\Local Settings</string> <string>[{Profile}]\NTUSER.DAT</string> <string>[{Profile}]\NTUSER.DAT.LOG1</string> <string>[{Profile}]\NTUSER.DAT.LOG2</string> <string>[{Recent}]</string> <string>[{Windows}]\Installer</string> <string>[{Windows}]\Debug</string> <string>[{Windows}]\Logs\CBS</string> <string>[{Windows}]\Temp</string> <string>[{Windows}]\WinSxS\ManifestCache</string> <string>[{Windows}]\WindowsUpdate.log</string> <string>[{Windows}]\System32\config</string> <string>[{System}]\config</string> <string>[{Windows}]\ServiceProfiles</string> <string>[{Windows}]\Logs</string> <string>[{AppVPackageDrive}]\$Recycle.Bin</string> <string>[{AppVPackageDrive}]\Boot</string> <string>[{AppVPackageDrive}]\System Volume Information</string> <string>[{AppVSystem32Logfiles}]\Scm</string> <string>[{AppData}]\Microsoft\AppV</string> <string>[{Local AppData}]\Temp</string> <string>[{LocalAppDataLow}]\Microsoft\CryptnetUrlCache</string> <string>[{ProgramFilesX64}]\Microsoft Application Virtualization\Sequencer</string> </FileExclusions> <RegExclusions> <string>REGISTRY\MACHINE\SOFTWARE\Wow6432Node\Microsoft\Cryptography</string> <string>REGISTRY\MACHINE\SOFTWARE\Microsoft\Cryptography</string> <string>REGISTRY\USER\[{AppVCurrentUserSID}]\Software\Microsoft\Windows\CurrentVersion\Explorer\StreamMRU</string> <string>REGISTRY\USER\[{AppVCurrentUserSID}]\Software\Wow6432Node\Microsoft\Windows\CurrentVersion\Explorer\StreamMRU</string> <string>REGISTRY\USER\[{AppVCurrentUserSID}]\Software\Microsoft\Windows\CurrentVersion\Explorer\Streams</string> <string>REGISTRY\USER\[{AppVCurrentUserSID}]\Software\Wow6432Node\Microsoft\Windows\CurrentVersion\Explorer\Streams</string> <string>REGISTRY\USER\[{AppVCurrentUserSID}]\Software\Microsoft\Windows\CurrentVersion\Explorer\UserAssist</string> <string>REGISTRY\MACHINE\SOFTWARE\Microsoft\AppV</string> <string>REGISTRY\MACHINE\SOFTWARE\Wow6432Node\Microsoft\AppV</string> <string>REGISTRY\MACHINE\SYSTEM\CurrentControlSet\Control\MUI</string> <string>REGISTRY\USER\[{AppVCurrentUserSID}]\Software\Microsoft\AppV</string> <string>REGISTRY\USER\[{AppVCurrentUserSID}]\Software\Microsoft\ResKit</string> <string>REGISTRY\USER\[{AppVCurrentUserSID}]\Software\Wow6432Node\Microsoft\AppV</string> <string>REGISTRY\USER\[{AppVCurrentUserSID}]_CLASSES\Local Settings\MuiCache</string> <string>REGISTRY\USER\[{AppVCurrentUserSID}]_CLASSES\Local Settings\Software\Microsoft\Windows\Shell\BagMRU</string> <string>REGISTRY\USER\[{AppVCurrentUserSID}]_CLASSES\Local Settings\Software\Microsoft\Windows\Shell\Bags</string> <string>REGISTRY\USER\[{AppVCurrentUserSID}]\Software\Microsoft\Windows\CurrentVersion\Explorer</string> <string>REGISTRY\USER\[{AppVCurrentUserSID}]\Software\Microsoft\Internet Explorer\Toolbar</string> <string>REGISTRY\USER\[{AppVCurrentUserSID}]\Software\Microsoft\Windows\CurrentVersion\Internet Settings\ZoneMap</string> <string>REGISTRY\USER\[{AppVCurrentUserSID}]\Software\Microsoft\RestartManager</string> <string>REGISTRY\USER\.DEFAULT\SOFTWARE\Classes\Local Settings\MuiCache</string> <string>REGISTRY\USER\.DEFAULT\Software\Microsoft\Windows\CurrentVersion\Internet Settings\ZoneMap</string> </RegExclusions> <TargetOSes /> </SequencerTemplate> |
Read More
For a bit I was of the mindset that sequencing a AppV package should be as clean as humanely possible. This would include finding all configuration tweaks to files/registry keys ahead of time and implementing them so any registry keys generated would be unique to the user. I’ve seen some applications generate a unique GUID that vendor’s would use to lock it so that the application was tied to one machine. Since this key would be generated in HKLM so all users would be able to see the key, it prevented new launches.
But if you didn’t launch the application while sequencing, the key wouldn’t get generated until the user launched it in their bubble. This effectively allowed multiple users to use the same application on one server. With this new information in mind, and a new outlook on keeping the AppV registry hive to a bare minimum; forward I strode. And hard into a wall I ran.
What I eventually ended up finding was applications that error’ed on first launch:
But would launch just fine the second time:
So what would cause it to fail the first time? I imagine for most cases the error message is caused by missing file(s) or registry key(s) or values. So how do you find these newly generated profile? Well, the nice thing about AppV is it stores all these things in two places. Your registry hive or your user profile.
Before launching the application I did a “dir /s /b C:UsersAdtest91 >>Clean.txt” and saved that to a text file. I then launched the program twice and ran this command “dir /s /b C:UsersAdtest91 >> Working.txt” I then compared the files and found the following new paths generated:
C:\Users\adtest91\AppData\Local\Microsoft\AppVClient\VFS\ADB25534-3FE9-44BD-9FC8-D5AAD8C0E728
C:\Users\adtest91\DesktopFax
To see if these two paths caused my issue I deleted them and relaunched the application. The application launched just fine. I then backed up those two folders. To rule out the file system with some more finality, I deleted my user profile then copied my two backup folders to their recorded paths and tried launching the program and got the error message again. With that I felt confident I could rule out files/folders as the cause.
The beautiful thing about AppV registry changes is they are recorded to your user profile. This is stored here:
HKEY_USERS\!GUID!_Classes\AppV\Client\Packages
Export this key prior to launching your application, launch your application, and export the key again and do a difference. Any created or modified registry keys will reside in this location for you to examine.
For this issue, this was the key that was generated:
[HKEY_USERS\S-1-5-21-38857442-2693285798-3636612711-15053136_Classes\AppV\Client\Packages\ADB25534-3FE9-44BD-9FC8-D5AAD8C0E728\REGISTRY\MACHINE\SOFTWARE\Classes\TypeLib\{3B7C8863-D78F-101B-B9B5-04021C009402}\1.2\0\win32]
@=”C:\\Windows\\system32\\Richtx32.ocx”
Deciphering the key results in the following missing value:
[HKLM\SOFTWARE\Classes\TypeLib\{3B7C8863-D78F-101B-B9B5-04021C009402}\1.2\0\win32]
Looking locally on the server, this is what I saw in the registry:
There was nothing in the Data field! AppV5 ‘integrates’ the Classes key in your AppV package when you publish it. I resequenced and launched the application after the install and checked the key again:
Surprise, surprise. And now the application launches without issue. So it appears that some application installers don’t completely register all files (OCX files are two instances of this issue happening that I noticed) until the application is launched. So now, our policy will always to, at a minimum, launch the application while sequencing.
Read MorePer my previous posting, I have an issue where the AppVClient.exe consumes significant CPU resources upon application launch. From a Microsoft forum where another member did some further investigation, he discovered that the slowness and delayed launch times are related to registry staging. To confirm and measure the impact of registry staging I wrote a script that measures the length of time it takes to finish registry staging for all AppV5 applications on your computer/server.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 |
#import AppVClient module ipmo *appv* #get all appv packages $apps = Get-AppvClientPackage $obj = @() #Get connection group applications $connApps = (Get-AppvClientConnectionGroup).GetPackages() #remove connecion-group applications from the list [System.Collections.ArrayList]$appList = $apps foreach ($connApp in $connApps) {$appList = $appList | ? { $_.name -ne $connApp.Name }} #for each (non-connection group) appv package... foreach ($app in $appList) { $prop = New-Object System.Object #get each appv package ID and version ID $package = ($app.packageID).ToString() $version = ($app.versionID).ToString() #start a blank cmd.exe in the environment (this kicks off the AppV5 registry staging) Start-AppvVirtualProcess -AppvClientObject (Get-AppvClientPackage $app.name) cmd.exe #measures the length of time it takes before registry staging is finished (resolution is 1s) $command = measure-command { do { write-host "Testing: " $app.name sleep 1 } until (Test-Path "HKLM:\SOFTWARE\Microsoft\AppV\Client\Packages\$package\Versions\$version\RegistryStagingFinished") write-host $app.name $appvProcess = get-appvVirtualProcess stop-process $appvProcess -force } $prop | Add-Member -type NoteProperty -name Package -value $app.Name $prop | Add-Member -type NoteProperty -name RegistryStagingTime -value $command.TotalSeconds $obj += $prop } $obj | export-csv RegistryStagingTime.csv -NoTypeInformation #for each connection group package... $conGroups = Get-AppvClientConnectionGroup foreach ($group in $conGroups) { $prop = New-Object System.Object #get each connection group package ID and version ID $package = ($group.groupID).ToString() $version = ($group.versionID).ToString() #start a blank cmd.exe in the environment (this kicks off the AppV5 registry staging) Start-AppvVirtualProcess -AppvClientObject ($group) cmd.exe #measures the length of time it takes before registry staging is finished (resolution is 1s) $command = measure-command { do { write-host "Testing: " $group.name sleep 1 } until (Test-Path "HKLM:\SOFTWARE\Microsoft\AppV\Client\PackageGroups\$package\Versions\$version\RegistryStagingFinished") write-host $group.name $appvProcess = get-appvVirtualProcess stop-process $appvProcess -force } $prop | Add-Member -type NoteProperty -name Package -value $group.Name $prop | Add-Member -type NoteProperty -name RegistryStagingTime -value $command.TotalSeconds $obj += $prop } #exports all information to csv file $obj | export-csv RegistryStagingTime.csv -NoTypeInformation |
What this script does is iterate through all your AppV5 applications and then loads a cmd.exe with the AppV environment. It then checks for the RegistryStagingFinished registry key, and once it is found, it moves on to the next program. It records all this information than exports it as a CSV file.
By utilizing this script as a AppV prelaunch/startup script we can optimize our users first application startup times and reduce CPU utilization of first-run applications.
Read MoreOur AppV 5 environment is a full infrastructure implementation. We utilize the management/streaming server to pull the applications down to our Citrix XenApp 6.5 servers. Our XenApp servers are Citrix PVS servers, we enable the Cache on RAM with disk overflow and the write-cache intermediate mode. To maximize CPU performance we have our ESXi hosts set to maximum performance and disable power management in the BIOS of the hosts. We have some applications that are very latency sensitive and the switching of power states on the ESXi hosts have caused performance degradation so we have power management disabled. We have setup our PVS servers with the secondary D: WriteCache disk where we fully mount the AppV 5 packages, removing the streaming latency that going over a network may add.
Because of some performance concerns with the Shared Content Store (SCS) I was tasked with coming up with a way of determining if there is a performance impact of switching from fully mounted applications. In order to determine the impact my plan was to measure a baseline based on disk performance. Our SMB share that we are storing our .appv packages actually has the same performance as the local disk. Since AppV packages are immutable, the only performance consideration we should be concerned is READ performance from the SMB share compared to the local disk. The writes occur in the %userprofile%appdatavfs which is stored on the C:\ drive. The Cache to RAM with disk overflow feature would ensure that write performance into those directories are fast and should be near instant.
With that said, I’ve used the diskspd.exe application (new from Microsoft) to measure performance. AppV 5 utilizes a 64KB allocation size so that’s what we’ll set as our -b value. We’ll measure Latency statistics comparing local disk to the file share as well.
D:\diskspd.exe -c1G -b64K -L -d60 D:test.dat
D:\diskspd.exe -c1G -b64K -L -d60 \citrixnas01ctx_images_testtest.dat
Results:
D:\
SMB share:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
D: Read IO thread | bytes | I/Os | MB/s | I/O per s | AvgLat | LatStdDev | file ----------------------------------------------------------------------------------------------------- 0 | 83828801536 | 1279126 | 1332.13 | 21314.08 | 0.045 | 0.138 | D:\test.dat (1024MB) ----------------------------------------------------------------------------------------------------- total: 83828801536 | 1279126 | 1332.13 | 21314.08 | 0.045 | 0.138 SMB: Read IO thread | bytes | I/Os | MB/s | I/O per s | AvgLat | LatStdDev | file ----------------------------------------------------------------------------------------------------- 0 | 80124379136 | 1222601 | 1273.26 | 20372.15 | 0.096 | 0.105 | \\citrixnas01\citrix_test\test.dat (1024MB) ----------------------------------------------------------------------------------------------------- total: 80124379136 | 1222601 | 1273.26 | 20372.15 | 0.096 | 0.105 |
Performance of the SMB share vs local disk:
MB/s: 96%
IO per s: 96%
AvgLat: 46%
Based on these results, the local disk appears to be nearly identical to the SMB share with the average latency a little more than half on the local disk. Although it’s half on average, we are still in the sub 1ms time range which is significantly faster than you could get with a physical server with a single local disk.
The next test I have is launching an application and getting to the splash screen to see how long it takes to load. For this test I’ve written a AutoIt script that takes two parameters, the name of the program to launch and the window title to monitor for.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 |
#Region ;**** Directives created by AutoIt3Wrapper_GUI **** #AutoIt3Wrapper_Change2CUI=y #EndRegion ;**** Directives created by AutoIt3Wrapper_GUI **** ; ; AutoIt Version: 3.0 ; Language: English ; Platform: Win9x/NT ; Author: Trentent Tye ([email protected]) ; ; Script Function: ; This script takes 2 parameters. The first is the program to launch; second is the window we wait for then output ; standard output with the duration both took. #include $progToLaunch = $CmdLine[1] $windowToWaitFor = $CmdLine[2] Local $hTimer = TimerInit() Run($progToLaunch) WinWaitActive($windowToWaitFor) Local $fDiff = TimerDiff($hTimer) Local $Time = _NowTime() ConsoleWrite($Time & "," & $fDiff & "," & $windowToWaitFor & "," & $progToLaunch & @CRLF) ;finished |
I setup a cmd file with my program (Epic) because it takes some parameters prior to launch. I then pointed my timer application at it.
1 |
C:\timer.exe D:\AppVPerfTest\epic.cmd "Connection Status" |
The results (with SCS):
1 2 3 4 5 |
Net Stop / Net Start AppvClient 10:05:20 AM,196229.360505316,Connection Status,D:\AppVPerfTest\epic.cmd 10:05:51 AM,13964.6012970922,Connection Status,D:\AppVPerfTest\epic.cmd 10:05:59 AM,12841.0388750526,Connection Status,D:\AppVPerfTest\epic.cmd 10:06:03 AM,12334.0792614704,Connection Status,D:\AppVPerfTest\epic.cmd |
The columns are Time Completed, Duration (in ms), Window to check for, Command executed.
After doing a Net Stop AppvClient / Net Start Appclient and then executing our AppV application it takes 196 seconds to start the application. After that initial launch it takes 12-15 seconds to start. Something is really dragging our initial application launch time down. I’ve found if I stop/start the service I need to do a add/publish via Powershell for that application to reduce the 196 seconds. This then takes first launch down to 48 seconds. This is how long is takes to start the same application after a system restart:
1 2 3 4 |
3:25:41 PM,48195.8385074081,Connection Status,D:\AppVPerfTest\epic.cmd 3:27:26 PM,12646.0290344164,Connection Status,D:\AppVPerfTest\epic.cmd 3:27:45 PM,15450.5886222970,Connection Status,D:\AppVPerfTest\epic.cmd 3:28:00 PM,12488.5766906129,Connection Status,D:\AppVPerfTest\epic.cmd |
First launch time after restart is 48 seconds then subsequent launches are essentially identical to just the stop/start appvclient service + add/publish. Which makes sense as our AppV5_Data_Precache script does a add/publish. Evidently, we’re going to have to go further into AppV to understand what’s causing it to take so long. To start, I’m going to detail our package a bit.
The application I’m testing this with is Epic. It’s a huge application. AppXManifest is 72MB, FilesystemMetaData.xml is 1.7MB, Registry.Dat is 62MB.
It contains 22,000 files totalling around 2GB in size.
When AppV is “launching” the application for the first time it starts consuming memory and CPU for the 196 seconds that it’s launching, peaking at nearly 600MB RAM and 50% CPU (though most of the time it’s peaked at 25% CPU).
![]() |
AppV utilization before application launch |
![]() |
Start of application launch |
![]() |
Peak during launch |
![]() |
Application launched |
The AppV Debug logs do not give a whole lot of info as to what AppVClient.exe is doing during this time. Most of the logs show the application “start” as they setup their components, and when the application has launched. Almost all the logs show the first second or two of application launch and the last second or two before the GUI.
![]() |
I launched the application at 12:36:24, it finally displayed the GUI at 12:39:38 |
The only log that shows data during the entire time is the SHARED PERFORMANCE log. Unfortunately, the log is undecipherable to me.
Lots of PreCreate, PreCleanup, PreAcquireForSection with no relevant data.
Perfmon.exe doesn’t do a whole lot better with large gaps between file/process/network accesses:
![]() |
What is it doing between 1:17:41 and 1:18:29? CPU is pegged but no disk activity |
Showing Registry accesses also shows huge gaps between the AppVClient.exe process accessing the system.
![]() |
Registry information still shows huge gaps in time where the AppVClient.exe is processing |
So I’m not sure what the hold up is with regard to the delay for this application. None of the usual tools I use to monitor performance is giving me any hints or indications of why it’s delaying launch.
Read More
It appears you can’t launch an AppV environment around an application with the /appvve switch as Microsoft automatically strips the /appvve switch OR because icast.exe freaks out.
I have found an alternative method though:
1 |
powershell.exe -command "&{$AppVName = Get-AppvClientPackage *APPNAME* ; Start-AppvVirtualProcess -AppvClientObject $AppVName cmd.exe}" |
This will launch a cmd.exe window in the virtual environment in citrix with the passed .exe (cmd.exe in this example).
Dan mentioned another, less character way:
1 |
Start-AppvVirtualProcess -AppvClientObject (Get-AppvClientPackage *APPNAME*) cmd.exe |
Read More
We have AppV 5 SP2 HF4 installed on a Citrix PVS server with our AppV PackageInstallationRoot redirected to a static drive. I recently updated the PVS server than found my account could not launch AppV applications but other accounts could launch them without issue. I deleted my user account from the server, tried launching applications with /appvve (which appeared to work but didn’t actually initialize the AppV environment) and procmon’ed the launch of the application. Procmon showed me the application actually launching, but immediately terminating.
![]() |
Bad Launch |
![]() |
Good Launch |
We can see that the application stops launching at the moment it initializes the virtual environment. Next we’ll dive into the event logs and see if it gives us any more relevant information. I chose to enable a few event logs that deal with the early process of AppV5. I can’t really tell you why I chose those ones, they are just a few that I’ve learned to monitor when I have problems launching apps.
I enabled:
Client-Integration
Client-Orchestration
Client-Vemgr
Client-VirtualizationManager
Subsystem-Venv
Launching the application gave me some error messages. From Client-VirtualizationManager:
1 2 |
64 notification failed with error 5746736078216233004. Package {49bda935-0a17-43e5-aada-44858d95affa}, version {d506ff21-4e9a-40e5-b60f-94481ccbe76a}, pid 5176, ve id 0. VirtualizationManager component failed to handle 46 activity. Error 4746865492684177448. |
If we do the backwards HRESULT dance to try and get a useful error code we get this for the two errors:
1 2 3 4 5 |
PS C:\Users\trententtye> (5746736078216233004).ToString("x") 4fc082040000002c PS C:\Users\trententtye> (4746865492684177448).ToString("x") 41e0410400000028 |
According to the link, the object is 04 (
04
|
Virtualization Manager | Client-VirtualizationManager Log or Client-Vemgr Log |
)
with error code 0x28 and 0x2c. Googling those HRESULT codes reveals nothing. I then looked into Client-Vemgr and found some error messages there:
1 2 |
Request to generate mappings for globally-published package failed. package moniker 49BDA935-0A17-43E5-AADA-44858D95AFFA_D506FF21-4E9A-40E5-B60F-94481CCBE76A. group moniker . user sid S-1-5-21-38857442-2693285798-3636612711-15138285. result {Operation Failed} The requested operation was unsuccessful.. |
Well, this is interesting. So it appears that AppV can’t do mappings; which I assume are the CoW (Copy on Write) for the filesystem…? Procmon does not reveal anything with a access denied or failed to create directories, as a matter of fact it actually creates the %userprofile%\local\Microsoft\AppV\VFS directories. But it is specifically targeting my user account, as referenced by the SID.
At this point I scanned Procmon for my SID and found it existed in the AppV registry path here:
![]() |
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\AppV\Client\Virtualization\LocalVFSSecuredUsers |
Procmon did not notice anything wrong (no access denied or such error messages). I then launched another application with a runas and saw it that a new registry key SID combination was dynamically generated. I then suspected that maybe the existence of this key maybe causing my issue… To verify I rebooted the PVS server and without using my account, checked and saw the registry key was there through reboots. My next test was to delete the key and try launching the application again.
Lo and behold it worked! AppV 5 regenerated the key and launched the application. It appears if the key exists then it will fail to create the CoW mappings in the registry (which you can see in the screenshot when it’s creating the MAV keys) and my issue is resolved.
Read MoreAn issue I’ve been dealing with lately is we have some in-house applications baked into an AppV package. We are encountering some issues with them and they require updating almost on a daily basis. Since you can’t update/copy .exe’s via a preconfig script or by breaking into the environment (CoW restrictions) they need to be baked into the environment.
One of the new features of AppV 5 vs. 4.6 is that it can mount the files as actual files in the filesystem as opposed to a single binary. This exposure of the AppV 5 packages allows for manipulation of the files *after* they are deployed, but you need to make some modifications to the mounted files.
1) Navigate to the folder you want to change, right click on it and take ownership of it. Make sure you replace permissions on all items within the folder.