References
Background
This XML snippet was spurred from a requirement to enable the use of ActiveX components for an App-V packaged application. ActiveX is a component of Internet Explorer, and is known as a legacy method to publish various forms of multimedia content onto web pages. This particular piece of software has been around for a number of years, and uses HTML to deliver some aspects of the UI within a Win32 application. However, when running as part of an app-v package, the ActiveX components would not work.
Solution
Configure iexplore.exe to run inside the virtual environment when it’s called.
- Open the App-V package User Deployment Config file.
- Under the “User Scripts” block configure parameters to run the following PowerShell command (See full example under the XML heading of this page):
-ExecutionPolicy ByPass -WindowStyle Hidden -Command New-Item -Path “HKCU:\SOFTWARE\Microsoft\AppV\Client” -Name RunVirtual -force | New-Item -Path “HKCU:\SOFTWARE\Microsoft\AppV\Client\RunVirtual” -Name “iexplore.exe” -force; Set-Item -Path “HKCU:\SOFTWARE\Microsoft\AppV\Client\RunVirtual\iexplore.exe” -Value “ChangeWithAppVPackageID” -force
- Import the modified User Deployment Config into your App-V package deployment model.
XML
| <UserScripts> | |
| <PublishPackage> | |
| <Path>powershell.exe</Path> | |
| <Arguments>-ExecutionPolicy ByPass -WindowStyle Hidden -Command New-Item -Path "HKCU:\SOFTWARE\Microsoft\AppV\Client" -Name RunVirtual -force | New-Item -Path "HKCU:\SOFTWARE\Microsoft\AppV\Client\RunVirtual" -Name "iexplore.exe" -force; Set-Item -Path "HKCU:\SOFTWARE\Microsoft\AppV\Client\RunVirtual\iexplore.exe" -Value "PackageID_PackageVersion" -force</Arguments> | |
| <Wait RollbackOnError="true" Timeout="30"/> | |
| </PublishPackage> | |
| <UnpublishPackage> | |
| <Path>powershell.exe</Path> | |
| <Arguments>-ExecutionPolicy ByPass -WindowStyle Hidden -Command Remove-Item -Path "HKCU:\SOFTWARE\Microsoft\AppV\Client\RunVirtual\iexplore.exe" -force</Arguments> | |
| <Wait RollbackOnError="false" Timeout="30"/> | |
| </UnpublishPackage> | |
| </UserScripts> |
