Thursday, May 2, 2013

Problem with App-V 4.6 applications using local install Adobe Reader X 10.1.4


Recently problems with App-V applications launching .pdf files began to reveal that there was, in fact, several problems in existence. Between version 9 and version 10 of Adobe Acrobat Reader (AAR) Adobe introduced a protected mode design which seems to have been the cause of problem 2 below. Below are the problems and their solutions that have been identified. Note that these are specific to providing compatibility with AAR version 10. If version 11 is deployed these settings could become ineffective within the packages that they are used.

Problem1

If a physical version of AAR v10 was running, launching .pdf links either directly from App-V shortcuts or from within the application, an error message would appear:

“There was an error opening this document. This file cannot be found.”

This occurs because the .pdf file is attempting to load inside the existing AAR session. Because the AAR session is outside the bubble it is unable to load the pdf file from the Q:

Solution:

Insert these settings to the launch OSDs below the VIRTUALENV section in a section with <REGISTRY> tags


<REGKEY HIVE="HKLM" KEY="SOFTWARE\Classes\AcroExch.Document.7\shell\Read\command" NOREDIR="FALSE">

<REGVALUE REGTYPE="REG_SZ">"C:\Program Files (x86)\Adobe\Reader 10.0\Reader\AcroRd32.exe" /N "%1"</REGVALUE>
</REGKEY>

This causes .pdf to launch in a new AAR session which is inside the bubble and can therefore see the Q:


Problem 2

If AAR was was launched inside the bubble it would be unable to see registry settings outside the bubble. Normal application behaviour is for applications to “see out” of the bubble and take setting from the “real” registry on the machine. However, AAR was not doing this. This meant that AAR sessions in the bubble would behave differently from those outside. E.g. AAR sessions outside would have updating disabled. AAR sessions inside App-V bubbles would not. This is thought to be due to a problem with AAR protected mode not working as expected inside a bubble.  Another symptom of protected mode is pdf launch failure on the second launch of the application (AcroRd32.exe launches then shuts down and there is a brief flash on the screen).  To reproduce this, launch a App-V pdf and then close the AAR session and close the application.  The user .pkg takes on settings which prevent the next pdf launch after the second App-V application launch.

Solution:

Insert these settings to the launch OSDs below the VIRTUALENV section in a section with <REGISTRY> tags

<REGKEY HIVE="HKCU" KEY="SOFTWARE\Adobe\Acrobat Reader\10.0\Privileged" NOREDIR="FALSE">

<REGVALUE REGTYPE="REG_DWORD" NAME="bProtectedMode">00000000</REGVALUE>
</REGKEY>
This causes AAR sessions inside the bubble to NOT run in protected mode and therefore have the correct settings applied in the same way a normal AAR session does.


Problem 3

AAR would appear to launch ok in the bubble on the first launch be then exhibit unexpected behaviour on second launches e.g. the EULA would pop up.

This was found to be caused by the App-V environment creating override keys HKLM\Software\Adobe\Distiller\6.0 in the App-V package settings (.pkg files). Once these were created they overrode the required settings in the HKLM\Software\Adobe\Acrobat Reader

You will have noticed that during sequencing, HKLM\Software\Adobe\Distiller\6.0 is always created in the virtual registry. Notice that these items are set to override. If deleted they are recreated in override mode in the App-V package settings as described above.

Solution:

Specifically include HKLM\Software\Adobe\Distiller\6.0 in the virtual registry and ensure that every level is set to merge.

Conclusion

Going forward applications which are to be virtualised should have the Q: searched for the presence of any .pdf files. If they are found to be present then actions to solve the problems above need to be applied. The solutions above involve applied fixed or “hardcoded” settings within OSDs and this should be noted in associated documentation. Other possible approaches to solution could be

  • · A separate DSC App-V package which carries the Problem 1 and 2 settings. This is then suited with the primary App-V application to provide the settings.

    Advantages – only one package to change if AAR is upgraded to version 11
    Disadvantage – managing a version 11 DSC fix package to deploy at the same time as AAR version 11 could be difficult to implement. 
  • · A pre run script could be designed to detect the installed AAR version and correctly set appropriate settings.
    Advantage – can be tested with version 11 which is already released but not yet deployed in the target environment.
    Disadvantages – cannot be guaranteed to work with versions above 11 and requires development and testing time to be set aside. 

Quick code cut and paste:
<REGISTRY>

<REGKEY HIVE="HKLM" KEY="SOFTWARE\Classes\AcroExch.Document.7\shell\Read\command" NOREDIR="FALSE">
<REGVALUE REGTYPE="REG_SZ">"C:\Program Files (x86)\Adobe\Reader 10.0\Reader\AcroRd32.exe" /N "%1"</REGVALUE>
</REGKEY>

<REGKEY HIVE="HKCU" KEY="SOFTWARE\Adobe\Acrobat Reader\10.0\Privileged" NOREDIR="FALSE">
<REGVALUE REGTYPE="REG_DWORD" NAME="bProtectedMode">00000000</REGVALUE>
</REGKEY>
</REGISTRY>