Archive

Posts Tagged ‘Office’

App-V: On Current Recommended Practices and how they Evolve . . . (a.k.a. – about that PVAD)

February 16, 2016 2 comments

This morning, I was on a joint webinar with Flexera (http://learn.flexerasoftware.com/AR-WBNR-Microsoft-AppV-Best-Practices) on App-V best practices and I reminded many on the call why I always prefer to use the term "current recommended practices" as opposed to "best practices." Today I explained that I know longer insist on avoiding the use of the PVAD (Primary Virtual Application Directory) and sticking to strictly VFS sequences. True, I did make this recommendation nearly a year and a half ago (http://blogs.technet.com/b/gladiatormsft/archive/2014/08/25/app-v-5-installing-to-the-pvad-don-t-do-it-yes-i-said-it.aspx ) however, at the time, App-V 5.0 Service Pack 2 required VFS sequencing to ensure connection group convergence as well as a few others mentioned in the blog post. With the addition of the merged roots feature as well as the correction of issues with the convergence of environment variables, there is no longer any major reason to force packages to VFS sequences for the purposes of making connection groups work.

Some Applications Need the PVAD for Proper Functionality

As App-V 5.0 SP3 was released over a year ago and App-V 5.1 was released a few months back, it has become known that due to issues with pathing limits and other issues related to the App-V VFS subsystem and its native NTFS integration, there are some applications which still require the use of the PVAD. By this, I mean to actually expose the Primary Virtual Application Directory (PVAD) within the App-V sequencer and selecting that same directory during the installation of the application during the monitoring phase of the sequencer. You will find many examples of applications within the App-V community. While the number of applications requiring the use of the PVAD is a relatively small percentage, the applications that are affected represent a significant footprint that involve nearly every major enterprise organization's application library. For example, Office 2010 is one of those applications. In fact, if you were to look at the virtual file system structure of the App-V package generated by the ODT (Office Deployment Tool) you would also find that the flattened Office 2013 and Office 2016 packages are actually PVAD sequences.

Categories: Uncategorized Tags: , , , , ,

Recommendations for Ignite 2015


Better Dynamic Application Delivery through UE-V & App-V:

Aaron Ruckman and myself will be discussing recent and forthcoming innovations with App-V and UE-V as well as some general recommendations including some you may have never heard of before.

http://meme.ms/d5cdr3p

App-V 5.0 SP3: Advanced Connection Groups:

Briton Zircher and the Virtual Vibe Guy Thamim Karim will be discussing how to implement advanced Connection Groups and the recent development involving creating complex virtual environments.

http://meme.ms/d5ki5is

Fundamentals of Microsoft Azure RemoteApp Management and Administration:

You should turn out for this one as it is jammed pack full of information relating to Azure RemoteApp including some information on App-V possibilities.

http://meme.ms/d5jqcah

Microsoft Office 365 ProPlus: Have It Your Way!

Office365 offers many flexible options for deployment of the Office Client. This presentation will cover these options.

http://meme.ms/d5e74fu

Deploying Office 365 ProPlus Using System Center Configuration Manager:

This presentation outlines the pros/cons of the new Application-model versus Package-model deployment types and introduce a hybrid Application-model deployment using a Cloud DP.

http://ignite.microsoft.com/session/sessionmoreinfo/?topicid=1dd80124-2795-e411-b87f-00155d5066d7

On Office with App-V: Planning for a Virtual Office Deployment

April 16, 2015 1 comment

Microsoft Office: A flagship product suite ubiquitous within the enterprise. The average enterprise IT environment runs multiple versions of Office not only as a suite of applications for the average information worker, but also as a platform for custom and mission critical LOB applications and workflows. As Office continues to grow or evolve, the question of whether or not to virtualize all or parts of one or more versions of Office are revisited on a regular basis.

Reasons to Use App-V with Office

There are many significant reasons why you would want to deploy office through App-V. Some of the more common are:

  1. Legacy Add-in Version Isolation through Virtualization: Office is also constantly evolving. As a new version is released, applications that work with or interact with an Office application may not work on a new version of an Office application. For example, you may have a legacy Add-in that works on Excel 2007, but does not work on Excel 2013. For that reason you create an App-V package that contains Excel 2007 along with that legacy add-in (or linked through connection groups.) This allows the application add-in/plug-in to continue to be used alongside of the newer deployment.

  2. Temporary Coexistence: Multiple versions of most Office applications can run side-by-side with a few caveats smoother with App-V than with native deployments. While App-V can be used with many applications to run multiple versions of the same applications, Office has some additional guidance [which will be discussed in a later blog in much greater depth.]

  3. Package Modernization Strategy Alignment: App-V allows for Office to be delivered via streaming in a flexible, portable format and take advantage of features of App-V such as the Shared Content Store.

In many cases, the version of Office you choose to virtualize will align with the reasoning. For example, you may be involved with a deployment of Windows 8.1 with Office 2013, and to ease transition, deliver an App-V package of Office 2010 applications for temporary use. You could also deploy Office 2013 via App-V to an existing Windows 7 base running Office 2010 due to a change in packaging strategy.

A Little History

A common question asked revolves around which versions of Office can be virtualized and what specific limitations will be encountered. To answer this – even at a 50,000 foot level – involves a historical discussion to better understand how the process and guidelines evolved with customer desires. As a result, the history affects version capabilities when running under App-V.

Office 2003/2007

Back in the day, when App-V was called Softgrid, prescriptive guidance documents were published on how to sequence Office 2003 and Office 2007 with Softgrid. It was a complicated process, but the isolation allowed for the resolution of some compatibility issues. There were a few caveats:

  • Applications could not self-heal.

  • Integration was limited without disabling some virtual subsystems.

  • Volume-licensed installation media was required.

There were other limitations involving client-server capabilities as well. When App-V 4.x and 5.x were released, no additional integration was developed due to the age of these products. Still generally, in most cases, these versions of Office are virtualized primarily for legacy add-in scenarios where only specific Office applications are packaged with App-V (Excel, Access, etc.) and they can still be done with success.

Office 2010

With Office 2010 came a few changes that would affect how Office would be deployed with App-V. First, Office moved over to the software protection platform that previously only used for operating system product activation. As with previous versions of Office, only volume-licensed media was supported for sequencing. In addition, a special component needed to be laid down natively in order to allow the activation of Office through either MAK (Multiple Activation Keys) keys or through a KMS (Key Management Server) Server. Hosts activated via a KMS have to report back to that key server once every 180 days. Like with the native Office format, you could also verify activation status with the OSPP.VBS script.

In addition to the software protection platform, the native component (which would become known as the ODK – Office Deployment Kit) included special virtualization handlers (or proxies) that would allow for better Office integration than we had before (MAPI, Search, SharePoint, OneNote) with previous versions of Office with App-V. This special integration allowed for the base applications to remain isolated but have better native integration with enterprise components. This would become a fine line to walk. Isolation is the opposite of integration. It is impossible to fully have both. The ODK would become the best solution.

2010 – App-V was not Click-2-Run

Beginning with Office 2010, a new format that was based on App-V technology was introduced for only Microsoft Office Home and Student 2010, Microsoft Office Home and Business 2010, and Microsoft Office Starter 2010. This was a portable streaming solution called Click-2-Run or Click-to-Run. Click-to-Run was not available in the Enterprise initially and was not to be confused with the enterprise deployment of Office using App-V. Click-to-Run behaved like a native Office installation to the introduction of dynamic virtualization technologies thus, in essence, it was simply an alternative installation format that allowed for speedy quick deployment and/or upgrades to Office 2010 for consumer users.

2013 – App-V IS Click-2-Run

Well, kind of. It comes from Click-2-Run. With the success of Office 2010 Click-to-Run, the birth of Office 365 and subscription-based deployments, and the desire for better virtual integration within the Windows shell on top of the existing integration components brought forth the solution for Office 2013 – flattened Click-to-Run.

The ODT

Instead of having to manually sequence the Office package, you will use the ODT (Office Deployment Toolkit) to download and create (flatten) the APPV package. The Click-to-Run download from Microsoft will serve as the APPV package once it has been flattened. The packaging process with flattening involves converted the STREAM.DAT file into the AppV package format alongside of generating the registries and manifests. Finally an INTEGRATOR.EXE component is embedded into the package and configure to deploy automatically via a package script when the APPV package is deployed. This integrator is the next generation of the virtualization handlers that were introduced with App-V 4 and Office 2010 integration.

The Office Deployment Toolkit is periodically updated and is also the primary tool for updating the App-V package. The flattener component puts in a permanent package GUID that simplifies updating and allows for updating with the Office 365 update cycle which is in line with patch Tuesday. The Office Deployment Toolkit is also the mechanism for determining which Office applications are part of your overall Office package.

While the Office 2013 AppV package originates with Click-to-Run from the Office365 CDN, starting with Service Pack 2 of App-V 5, the App-V package can also be activated via Volume Licensing as well as Office 365 subscription licensing. This means that the Office AppV package is now the most flexible option for licensing as it is the only package format that can be activated through either subscription or volume licensing. Bear in mind the activation method will be embedded into the package upon flattening.

Dynamic Virtualization

The Office 2013 APPV package was also the first introduction to JITV (Just-in-Time Virtualization) or what is known as “dynamic virtualization.” This allowed for better shell integration and enhanced the behavior of the virtualization handler components through tighter integrated extension points. This would be available for other AppV applications beginning with App-V 5 Service Pack 2.

In Essence, the newer the version of Office is, the tighter the integration options are. This allows for Office to be incorporated into your overall App-V application factory where the new Office can be leveraged for primary use under App-V while legacy versions can be leveraged (and) isolated for special circumstances.

Free Office 2013 App-V Deployment Training now Available on Microsoft Virtual Academy

December 11, 2014 Leave a comment

This week, we have released more guidance on deploying Office 2013 with App-V 5.0 through MVA. In this 4 module course, I discuss licensing, planning, package Creation, deployment, and caveats when delivering Office 2013 through App-V 5.

The full course content can be found here:

http://www.microsoftvirtualacademy.com/training-courses/deploying-office-2013-with-app-v

If you want to bypass the course and just view the videos, you can do that on Channel 9 directly using the links below:

App-V 5: Creating and Testing Office 2013 Connection Groups in Stand-Alone Mode

June 4, 2014 4 comments

App-V 5 has evolved significantly since its initial release in the fall of 2012. Many of these changes have had an effect on how the Office 2013 AppV Package interacts with the Explorer shell and, as a result, have created a challenge for those of us (like me) who like to first test Connection Groups which contain the Office 2013 AppV package.

I find testing Connection Groups first in standalone mode very valuable because I can confirm that the connection group works and get fine tune the application package order as needed when I am testing and debugging Connection Groups. I can then test the deployment though the App-V Publishing Server or through Configuration Manager once I have validated that the Connection Group works.

TO quickly review how to create a connection group in stand-alone mode, you must first publish the packages. In the case of Office, I will publish the Office package globally as well as the add-ins I am testing. After the packages have been published, I can then proceed to create the connection group.

You create the Connection Group using the Add-AppVClientConnectionGroup cmdlet and you enable it (matching target) using the Enable-AppVClientConnectionGroup cmdlet. The Add-AppVClientConnectionGroup requires the creation of an XML descriptor document which is documented here: http://technet.microsoft.com/en-us/library/jj713474.aspx

Since the user state and launch management will be changing, the packages must not be in use. The thing is, you will find in App-V 5.0 SP2 and later, that once you try to enable the Connection Group, it fails with the following error – even though you have not launched any Office application:

The operation was successful but at least one of the Virtual Processes in this Connection Group is currently in use. Please shutdown all Virtual Processes in the Connection Group in order to complete this operation.

Operation attempted: Enable Connection Group.

AppV Warning Code: 0200000510

Sure enough, when you run the Get-AppVClientPackage command, you will see that the Office 2013 Package is indeed already in use. How is that possible you ask? Because of Dynamic Virtualization and the fact that Explorer is processed using virtual components by default. This is to enable support for enhanced shell extensions as well as applications that hook into Explorer directly such as OneDrivePro.

If you try to run the Stop-AppvClientPackage command against the Office 2013 package, you will find that it kills Explorer, which in turn automatically restarts, thus re-triggering the package back in use. You will also notice that the Connection Group enablement task does not show up under pending tasks in the HKLMSoftwareMicrosoftAppVClientPendingTasks.

What you have to do is turn off Dynamic Virtualization and remove Explorer.exe temporarily from the ProcessesUsingVirtualComponents value in the registry: (HKEY_LOCAL_MACHINESOFTWAREMicrosoftAppVClientVirtualization)

I use these series of PowerShell commands:

First, I turn things off:

PS C:WINDOWSsystem32> Set-AppvClientConfiguration -ProcessesUsingVirtualComponents 0 -EnableDynamicVirtualization 0

I then reboot or restart the AppV Client service.

I then create and enable the Connection Group using the Add-AppVClientConnectionGroup and Enable-AppVClientConnectionGroup cmdlets:

Finally, I reset things back the way they were using the following PowerShell command:

PS C:WINDOWSsystem32> Set-AppvClientConfiguration -EnableDynamicVirtualization 1 -ProcessesUsingVirtualComponents %SystemRoot%Explorer.exe,"%ProgramFiles%Internet Exploreriexplore.exe","%ProgramFiles(x86)%Internet Exploreriexplore.exe"

I then reboot or restart the AppV Client service and test the Connection Group functionality.

App-V @ #msTechEd 2014 – View the recordings in case you missed it!

May 17, 2014 3 comments

We had quite a few breakout sessions on App-V at TechEd North America this year! If you were there and were not able to attend all of them or missed TechEd altogether, you can view the recorded sessions here on Channel 9:

My Presentation 🙂

Sizing App-V 5.0: Planning and Designing a Highly Available, Scalable, and Resilient Management and Delivery System

https://channel9.msdn.com/Events/TechEd/NorthAmerica/2014/WIN-B360#fbid=

Then we have an excellent presentation by Briton Zircher on deploying Office 2013 with App-V 5:

Everything You Need to Know for a Successful Microsoft Office 2013 App-V Deployment

https://channel9.msdn.com/Events/TechEd/NorthAmerica/2014/WIN-B330#fbid=

You also will want to see Project VRC's presentation on their independent performance analysis of App-V 5.

Project Virtual Reality Check: Microsoft App-V 5.0 Performance, Tuning, and Optimization (App-V PTO)

https://channel9.msdn.com/Events/TechEd/NorthAmerica/2014/WIN-B362#fbid=

Are you thinking about or planning to deploy App-V 5 with Citrix XenDesktop and studio integration? You will want to see this:

Deploying Microsoft App-V 5.0 and Citrix XenDesktop 7

https://channel9.msdn.com/Events/TechEd/NorthAmerica/2014/WIN-B215#fbid=

New to Intune? Want to understand how applications are managed with Intune? Want to know your App-V options with Intune, check out this presentation:

Application Management with Microsoft System Center Configuration Manager and Windows Intune

https://channel9.msdn.com/Events/TechEd/NorthAmerica/2014/PCIT-B323#fbid=

Finally, my favorite of the event – done by the Virtual Vibe guy himself -Thamim Karim:

The Circle of Life for an App-V 5.0 Package: From Sequence to Termination

https://channel9.msdn.com/events/TechEd/NorthAmerica/2014/WIN-B355#fbid=

App-V: On Virtualizing Multiple Excel Add-ins

September 4, 2013 11 comments

Yes, I’m still obsessed with the subject of add-in virtualization. I felt it also necessary to ensure that there was a discussion of add-in types and multiple Office add-ins (particularly Excel) before I finally leave this topic of discussion. Have you ever noticed that when you are managingloading add-ins in Excel that you have multiple distinct types of add-ins. The two most common types are COM add-ins (common format for 3rd-party applications) and Excel Add-ins or what we refer to technically as Automation Add-ins (VSTO, XLAM add-ins.)

 

COM Add-Ins

COM add-ins act as in-process COM servers (like an ActiveX DLL) that is built off the IDTExtensibility interface. These are pretty much event-driven and present themselves to the user in the form of custom menus, commands, etc. When a COM Add-in is installed on a user’s system, registry entries are created for the Add-in. In addition to normal COM registration, a COM Add-in is registered for each Office application in which it runs. COM Add-ins used by Excel are registered in the following registry key:

HKEY_CURRENT_USERSoftwareMicrosoftOfficeExcelAddins

For example, if I have an Add-in called “Data Transfer Excel Add-in.” it would register in a key similar to the image below:

 

NOTE: Do not get confused. This registration may be used with the other add-in registrations that Office applications may use (in the HKLM or the HKCUSoftwareMicrosoftOffice<VERSION><App>Addins key.) That can also be a source of troubleshooting sometimes.

Dynamic Configuration is important when leveraging an add-in when it comes to COM settings. If the Add-in will be packaged with the application, it should remain isolated – which is the default. If the add-in is virtualized but Office is locally installed, then the COM add-in must have its COM mode configured as “Integrated” with in-process registration. If you are linking the add-ins with a virtual instance of Office via a connection group, this is also recommended (using the element “<COM Mode=”Integrated”>”)

NOTE: LOCAL_INTERACTION_ENABLED set to TRUE in the 4.6 OSD file achieves this same result.

Automation Add-Ins

Automation Add-ins build on COM Add-ins in that functions in Automation Add-ins can be called from formulas in Excel worksheets. While COM Add-ins must be in-process COM servers that support the IDTExtensibility2 interface; however, Automation Add-ins can be in-process or out-of-process COM servers and implementation of IDTExtensibility2 is optional. Understanding what type of COM server will determine how the add-ins COM configuration may need to be configured in the applications dynamic configuration file.

Order of Add-Ins

When you make additions to the list in the Add-Ins dialog box or when you select and clear Add-ins in the list, Excel stores your changes in the registry. First, Excel uses the following registry setting to determine whether or not an Automation Add-in in the Add-in list is loaded:

Key: HKEY_CURRENT_USERSoftwareMicrosoftOffice<VERSION>ExcelOptions

String OPENx (where x is the numerical order.)

Sample Value: /A “ServerName.Classname”

 

Note: The /A switch denotes it is loading an automation add-in *AND* unlike COM Add-ins, automation add-ins are loaded on demand so the LoadBehavior registry key is not necessary for these types of add-ins.

 

 

When an Automation Add-in that is listed in the Add-Ins dialog box is cleared, a subkey with a name equal to the Add-in’s Program ID is created in the following registry key:

HKEY_CURRENT_USERSoftwareMicrosoft<VERSION>ExcelAdd-in Manager

This registry setting ensures that Automation Add-ins that you have added to the Add-ins list are retained in the list even when you have chosen not to load them. Both the Add-in Manager and OPENx registry settings need to be managed properly when virtualizing add-ins.

Caveats when Virtualizing Multiple Add-ins with App-V

When Excel loads these automation add-ins it will expect to see a ordinal series of OPEN entries in the registry (OPEN, OPEN1, OPEN2, OPEN3, etc.) If it is the first add-in to be installed, the registry value created will be “OPEN.” When the second add-in is installed, it will register “OPEN1.” The third add-in installed will then register “OPEN2” and . . . well, you get the idea.

So here is the problem that often arises: Let’s say you are virtualizing three Excel Add-ins separately and you want to link them with a virtualized Office package (or even linking local Office by pulling into an empty package and linking that with these three add-ins.) Chances are the first time you do this, you will fail – as the case with many of us.

 

 

 

If I sequence all of these add-ins separately and link them all with Office through a connection group, I have the following factors to consider with regards to these overlapping OPEN values:

  • Registry opacity within the add-in package
  • Resultant registry opacity upon Connection Group deployment

During sequencing, the normal behavior to determine default registry opacity goes as follows:

 

 

This of course, can be adjusted using the virtual registry tab within the sequencer. If you virtualize each add-in separately (which is normal) and add the add-ins into Excel with each sequence, you will find that each one appears as an OPEN registration. When you combine the add-ins together, you will likely find only one of the add-ins working upon first launch.

 

 

 

Another problem to avoid but one that is less likely to occur is to ensure that your OPEN registrations are in a direct sequence (OPEN, OPEN1, OPEN2, etc.) They have to be consecutive. If you have OPEN, OPEN3, OPEN5, etc. configured then you find Excel stops loading after the first one because OPEN2 is missing.

What I am Currently Doing

I take advantage of the knowledge of knowing that when you use Connection Groups, the number one entry in <appv:packages> section of the Connection Group XML descriptor document takes precedence. So if I were to employ a connection group that contained a local instance of Office, I would simply import a custom REG file containing the OPEN registrations in the correct order into an empty package (during sequencing) that also contains the shortcut extension points to the local Office applications. I then ensure that the empty package is at the top of the order within the Connection Group.

<appv:Packages>

  <appv:Package DisplayName=”Local Office” PackageId=”<GUID>” VersionID=”<GUID>”/>

  <appv:Package DisplayName=”Add-in #1” PackageId=”<GUID>” VersionID=”<GUID>”/>

  <appv:Package DisplayName=”Add-in #2” PackageId=”<GUID>” VersionID=”<GUID>”/>

  <appv:Package DisplayName=”Add-in #3” PackageId=”<GUID>” VersionID=”<GUID>”/>

</appv:Packages>

 

 

You have to ensure that the resultant virtual registry used by the parent Excel application has a correct OPEN sequence of registrations. You also have to ensure that the opacity will not conflict with any local registrations. Keeping these things in mind, I have the following recommendations when I am devising a add-in strategy for my customers.

Virtualize NO Excel automation add-ins.

-or-

Virtualize ALL Excel automation add-ins. Use Connection Groups to bridge a local or virtual Excel instance or package everything together if necessary,

 

 

App-V: Still More on Those Office Add-ins

August 7, 2013 4 comments

As you can tell, I have been obsessed with Office Add-ins lately. Shifting gears from troubleshooting, I would like to address the different approaches to virtualizing add-ins with App-V. While the last two articles on the subject could easily be applied to both App-V 4.x and 5.x, my focus today will be specifically on App-V 5 because it offers more options and flexibility in the virtualization of add-ins. As I discuss each method, I will give my thoughts on the advantages and disadvantages of each method.

The Most Obvious: Sequence the Application and Add-in Together

While this method may seem to be the easiest, this method is only viable from a servicing standpoint if you:

  • Have only one deployment of the application.
  • In the case of Office, everybody will use the same group of Office applications.
  • Everybody needs and/or is allowed access to the included add-in(s).
  • For App-V 5, all add-ins will use the same COM settings inside the dynamic configuration files.

With this method, we do not likely run into issues with user state data and we do not have to involve any complicated sequencing recipes (other than the ones you would be using anyway – as the case with Office.)

Local Office Brought into Virtual Add-in Package during Sequencing

In this scenario, the add-in is totally virtualized but the parent application (Office App) is native. During sequencing, shortcut extension points were added to the package (dynamic configuration and FB0) so these shortcuts will launch inside the same virtual environment as the add-in. This scenario works best when there is a desire to keep the parent application native to the operating system.

 

The extension point format in the Deployment_Config.XML points to the local instance using a tokenized path. In the example below, here is a local shortcut extension point for Excel 2010 that is labeled as “Contoso Processing” because it will launch inside the virtual environment of the virtualized Contoso Processing add-in.

        <Extension Category=”AppV.Shortcut”>

          <Shortcut>

            <File>[{Start Menu}]Microsoft OfficeExcel (ContosoProcessing).lnk</File>

            <Target>[{ProgramFilesx86}]Microsoft OfficeOffice14excel.exe</Target>

            <Icon>[{ProgramFilesx86}]Microsoft OfficeOffice14excel.exe.0.ico</Icon>

            <Arguments />

            <WorkingDirectory>[{ProgramFilesx86}]Microsoft OfficeOffice14</WorkingDirectory>

            <ApplicationId>[{ProgramFilesx86}]Microsoft OfficeOffice14excel.exe</ApplicationId>

          </Shortcut>

        </Extension>

 

The problem you may run into when using this deals with user workflow. This particular shortcut will launch this specific instance of Excel, but a regular shortcut to the local Excel will only launch the native Excel (with whatever native Excel customizations are in place.) You will not be able to share user state across the two instances of Excel unless you leverage UE-V or another user state solution.

 

Local Office Brought into Virtual Environment using “On-the-Fly” Shortcut

Yes, it’s a long name, but it was the best I could come up with! What happens here is very similar to the previous method where the local/native installation of Office is brought into the virtual environment but not using an embedded shortcut. Instead, we are using an “on-the-fly” shortcut solution where the shortcut leverages the following syntax:

 

<AppName.EXE /appve:<GUID>_<GUID>

This is convenient and quick way to link a local application with a virtual plug-in or add-in. Before you jump to this option, understand there are a few potential issues that could arise. The first will be the provisioning and management of these “out-of-band” shortcuts. Delivery of these shortcuts would have to come outside of the normal publishing block. You also will have to modify these shortcuts whenever a package version has changed. Also user state, registry opacity, and other configuration-relation issues could arise as you have similar issues with this method as you did with the previous one if you are moving back and forth between a local instance and one that has been brought into the virtual environment of the add-in.

Virtual Office Linked with Virtual Package using a Connection Group.

With the introduction of Connection Groups in App-V 5, we now have more flexibility in linking different packages together into a single virtual environment. The most common way of using connection groups to link Office applications with Add-ins is to create one that links Office as a virtual application with the virtual add-in applications.

Once you introduce connection groups into the mix, the order of packages in the connection group is important. This is regardless of how you are deploying these groups (publishing server, configuration manager, or stand-alone.) The connection group order specifies the order in which registry and file system data of individual packages are merged. What this means if Office is first in the connection group and the Add-in package is second, the Office application will take precedence in terms of registry opacity.

Local Office Application Brought into Virtual Package Using Empty package/Connection Group Solution

This is very similar to the above scenario except the assets for the local Office applications are local.

 

In this scenario, Office is installed locally/natively but there is an empty virtual package that contains local shortcuts to the Office applications. This virtual package is linked with the virtual add-in package through a connection group. The ramifications are combined in that you may encounter workflow issues for users. Connection group order will also be important in terms of user state and registry opacity.

Local Office application brought into the Virtual Add-in Package using “Run Virtual”

If you are working within RDS environments, and have a package that is published globally, you can also take advantage of the “Run Virtual” feature. You basically add process executable names as subkeys of the following key:

HKEY_LOCAL_MACHINESOFTWAREMicrosoftAppVClientRunVirtual

For example, if I have a locally installed application called MyApp.exe and I would like this application to run within the virtual environment, I would create a subkey called MyApp.exe (perhaps a helper application like Adobe Acrobat that may need to be called from a virtualized web application.) I would then put in as the default entry a REG_SZ value that contains the package GUID and the version GUID separated by an underscore (i.e. <GUID>_<GUID>.

If the package is a standalone package, the process will be launched in that package’s virtual environment. If the package is in a connection group, the process will be launched in the virtual environment of the connection group for which the package belongs.

 

 

 

 

App-V: More on that Failed Office Add-in

August 1, 2013 3 comments

Continuing from my previous post a few days ago, let’s talk more about application errors when Office add-ins are virtualized. It is pretty easy to resolve most add-in issues with the right methodology. One of the first steps in my methodology is to first determine if the issue is related to the add-in loading or a general application error occurring after the add-in has loaded.

“First Launch Only” Issue or “Every Launch” Issue?

If you have isolated the problem to a load issue, now determine if the problem occurs on first application launch only or on every launch. If it is a first launch issue, the issue resides most likely with the package. If it is on every launch, the issue could be easily in the package or within the configuration and/or user state of the client machine. As mentioned in my previous blog post on the subject, the first place you want to check is the LoadBehavior key in the registry. After that I follow a basic process where on first launch issues, I eliminate LoadBehavior as an issue first, then I determine if registry opacity might be a factor. Registry opacity is where the virtual registry key is configured to either “merge” with the local key or “override” the local key.

If it is an issue that is occurring on all launches, I first eliminate user state as a potential culprit whether it is an incorrect configuration or corrupted configuration. I’ll repair the package first as well as eliminate any other elements related to user state management before I start actually digging into the package configuration.

If the add-in is still failing to load or function properly after loading then you may have to look to ensuring that you have done the basics of planning prior to virtualization. Time to back track a little:

Have We Verified Bitness?

Do we have matching bitness – (i.e. a 64-bit Office application requires a 64-bit COM add-in.) App-V does not change the fact that Office requires the add-ins to match the bitness of the office application. In other words, if you are using a 64-bit version of Office, you do not want to be loading 32-bit add-ins

Are you sure we aren’t missing requirements somewhere?

Have you confirmed that any pre-requisites or middleware required for the add-in have been either included in the add-in package or are installed locally on the client machine? I have been burned by this before. This is the most common reason why an add-in may actually “load” according to Office, but may actually still fail (by either crashing or giving a strange error.) Sometimes the application dependency may appear to be installed but may actually be partially installed. Let’s look at an example:

The Case of the Crashing Add-in

Now here is an interesting case: Let’s say the Office Add-in loads according to the Event Viewer, yet the Add-in still errors out. What is the best way to go about troubleshooting it? In the example below, a component called Cisco ViewMail for Outlook has failed to load in Outlook 2010. We initially get the following error:

‘VMOAddIn’ has fired an exception. Click the ‘Details’ button to see the detailed information about the error.


This error will contain details including a stack trace. This information may prove to be valuable later. This error is exactly what it says. It is not a load error – it is a handled exception or a crash. In this example, it is then followed by a more user-friendly message:

Cisco ViewMail encountered an error while starting and was not able to recover. ViewMail functionality is not available.


So when you get this error, the first thing you will want to do is take a look at the details of the crash. Based upon the error screen – this appears to be a managed code exception (.NET.) When you get these errors – look at these key elements:

Assembly Codebase: file:///Q:/Microsoft_Outlook_2010_V1/VFS/CSIDL_PROGRAM_FILES/Cisco Systems/ViewMail for Outlook/VMOLibrary.DLL

Assembly Full Name:    VMOLibrary, Version=9.0.2.1, Culture=neutral, PublicKeyToken=null

Assembly Version:      9.0.2.1

Exception Source:      VMOLibrary

Exception Type:  System.IO.FileNotFoundException

Exception Message:     Could not load file or assembly ‘Microsoft.DirectX.DirectSound, Version=1.0.2902.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35’ or one of its dependencies. The system cannot find the file specified.

So in the case of the above error, we see something very straight forward: A missing file – Microsoft.DirectX.DirectSound. Looking at the list of installed programs and updates, I see that the DirectX components are indeed installed.

Know the Add-in

Before you troubleshoot further – it would probably be a good idea to have a known good installation (where the add-in is installed and working normally on a native installation.) I usually compare Process Monitor captures of the known good with a trace of the reproduced error. Before I even do this, though, I need to know what I will be looking for. In most cases with add-ins, there will be a loading of the add-in (usually a DLL) by a base executable (in this case, the Office application is Outlook so the EXE will be OUTLOOK.EXE.)

What are the EXE’s and DLL’s for ViewMail?

To get this information, I can either look at a local installation or I can open a command prompt in the bubble and browse the VFS. Once I know what these DLL’s are and where they are located, I can then proceed to weed through a Process Monitor capture of the failure. I first add a PATH filter in ProcMon using the CONTAINS operand and the use the keyword “ViewMail.” This takes my filter down from nearly 30,000 events down to 1,217 items. Next I look to add another filter. Since the error “Could not load file or assembly ‘Microsoft.DirectX.DirectSound” was in regards to a file or assembly, I now add an additional filter for the
operation “LoadImage.” This knocked the entries down to 29 events but EVERYONE OF THEM SHOWED SUCCESS!

Does this mean we are taking crazy pills? No, this just means you have eliminated the simple issue of a failure to load a DLL. The “file” aspect of that error has been eliminated. We are now simply chasing down a .NET assembly. So now we need to hone in on the codebase of the error – narrowing the context:

Assembly Codebase:    file:///Q:/Microsoft_Outlook_2010_V1/VFS/CSIDL_PROGRAM_FILES/Cisco Systems/ViewMail for Outlook/VMOLibrary.DLL

I’m going to go back to the Process Monitor capture and return to the point where the successful LoadImage operation of VMOLibrary.DLL occurred. I reset the filter from this point (making sure this selection remains highlighted.) Anything before this point is irrelevant. I begin to start walking down the trace, systematically eliminating irrelevant processes (right-clicking them and selecting “exclude” – BUT –  BE SURE YOU KNOW WHAT YOU ARE EXCLUDING IS IRRELEVANT.)

I walk through the loading of the file VMOLibrary.DLL until the result is END_OF_FILE which means the file has been completely loaded.  Continuing on in the trace, I notice it is now walking the .NET assembly registrations and finding begins to hit PATH_NOT_FOUND error and events start to occur where it begins to write to an error log. I take note of the assembly name in the error: ‘Microsoft.DirectX.DirectSound.’ It is as if it thinks that the DirectSound component of DirectX is not installed – but I verified it was installed prior to troubleshooting. However, I go to the C:WindowsAssemblies folder and sure enough, it is not there.

How did I know to look there?

Activity to this special folder (C:Windows Assemblies) involves looking for actual activity going to the .NET Global Assembly Cache (GAC.) When looking at Process Monitor traces, all activity  in the Global Assembly Cache is logged by direct path in ProcMon as

  • C:WINNTassemblyGAC_MSIL
  • C:WINNTassemblyGAC
  • C:WINNTassemblyGAC_32

So the problem we had was that while DirectX was installed, the proper .NET DirectX assemblies were not registered in the GAC. Now if this ever happens you want to make sure the binaries for the DirectX managed Code components are there. In this case – the files were actually in C:WINNTMicrosoft.NETDirectX
for Managed Code1.0.2902.0 BUT they were not actually registered to the GAC. If the files were not even on the machine – a reinstallation of DirectX is in order (plus updates.) If the files are there but not registered in the global assembly cache then you could leverage REGASM:

REGASM.exe – http://msdn.microsoft.com/en-us/library/tzat5yw6.aspx

And register those assemblies manually – my recommendation would be to simplify things and just reinstall DirectX. Then you will see the assemblies properly registered.

 

 

NOTE: Unregistered assemblies may not show up in a DXDiag report but the .NET assemblies inventory for DirectX is part of the output as demonstrated with a before and after comparison using BeyondCompare.

App-V: On that Failed Office Add-in

July 25, 2013 5 comments

Troubleshooting virtualized Office add-ins are always fun. Correction: troubleshooting Office add-ins are always fun for people like me – not necessarily normal human beings. Whether you are using add-ins with a local instance of Office or are packaging add-ins with virtualized Office, you need to be to understand how Office knows which add-ins to load and how these will be loaded.

There are generally three ways to virtualize add-ins for Office:

1.)    Where Office is installed locally and the Add-in is virtualized – The Office application must have a shortcut/OSD file provisioned in order to be brought into the virtual environment. Starting with App-V 4.6 SP2, the App-V Sequencer has a specific workflow that allows for this.

Be advised that when you do this, you will be bringing in the local instance of Office into the virtual environment in order to load the add-in. What this can lead to is other add-ins which may not be virtualized not loading if the configuration is not set properly for this. Having a clear understanding of your Office add-in ecosystem will help in developing a strategy in advance to avoid this.

2.)    Through Connection Groups or Dynamic Suite Composition (Depending on the Version) –  You can also take advantage of both the Add-in/Plug-in workflow and the “Expand Package to Local Disk” feature of the sequencer in order to package Office and Add-in applications separately but still connect them into a common virtual environment.

This method works best (in my opinion) when your strategy is to virtualize both Office and the add-ins. This is also the only way I use Add-ins with Office 2013.

3.)    Office and add-ins packaged together into one package (often sequenced using a single pass.) This way is the least common and not always recommended as it may require you to deploy multiple Office packages.

Verify the Add-in Registry Keys

When an add-in is installed, it can be registered to either the user or to the whole machine. When an add-in is sequenced, it will also be virtualized and depending on the registry opacity configuration, will override whatever is locally present. User-registered add-ins go to HKEY_CURRENT_USER while add-ins registered to the entire machine go to HKEY_LOCAL_MACHINE. Whether Office is local and being brought into the virtual environment or Office is virtualized with the Add-in, Office needs to be able to understand the “Load Behavior” of the add-in. This will be found under

HKEY_LOCAL_MACHINESoftwareMicrosoftOffice<APPLICATION>Addins

Each Add-in appears as a subkey beneath this key. The LoadBehavior DWORD value determines how it will load. This key is the #1 culprit when it comes to Add-ins not working right whether it is a “1st launch-only” issue or an “always-launch” issue. It is a DWORD value. By default, this entry is set to 3, which specifies that the add-in is loaded at startup but an many cases, especially if the add-in was launched during sequencing, you may run into a situation where the value may be set to something else depending on what was done during sequencing. If the value is 0, then the add-in will have to be enabled once the user launches the application. If the package is repaired it will have to be enabled again. The value 1 can be misleading and I encounter this a lot in virtual add-in troubleshooting. Add-ins dialog box indicates that the add-in is loaded after the application starts, the add-in isn’t actually loaded. If the application successfully loads the add-in, the LoadBehavior value changes to 0, and remains at 0 after the application closes. The value 2 means If the application successfully loads the add-in, the LoadBehavior value changes to 3, and remains at 3 after the application closes. With App-V this means potential issues in prompts including annoying “success messages.”

LoadBehavior at 3 is good for App-V

Hey, I made a rhyme!  If the LoadBehavior value is set to 3, it will always try to load the add-in and if the add-in fails, will set it back to 2. This is what we want in the virtual registry of our App-V package most of the time. You can usually verify/set this in the Virtual Registry tab after sequencing prior to saving the package.

Should I Verify Registry Opacity?

Yes. While you are there you may want to verify your registry opacity settings. Are those Add-in keys set to “override” or “merge” with the local key. If you have local add-ins that you will use alongside of these virtual add-ins, you will want to ensure that the Addin key is set to merge.

What about Outlook Add-Ins?

For Outlook, you will most assuredly need to manually import/add these virtual registry entries during sequencing (or package upgrade) since you do not want to be launching Outlook during sequencing.

Check the Event Logs when Troubleshooting

While the event logs may not have the event handlers registered for office (since it is virtual, you will still see unregistered event ID’s of Outlook (Event ID 45) which will list all of the add-ins loaded and their subsequent load times.

Event ID: 45

Outlook loaded the following add-in(s)

Office 2013 and Mismatched Virtual Subsystem Settings

If you are using Virtual Office 2013 with App-V 5, this is the #1 issue. Given all of the changes with Office 2013 virtualization, one would think the Add-in story would become complicated. It is not. The recommended practices are pretty straight-forward:

On the Sequencing Machine:

1.)    Install the App-V 5 Sequencer.

2.)    Install Office 2013.

3.)    Start a new package.

4.)    On the “Type of Application” page, select “Add-on or Plug-in.”

5.)    Select the installer for the plugin.

6.)    In the “Install Primary” page, select “I have installed the primary parent program” and continue.

7.)    Install the plugin and save the package.

8.)    Depending on the add-in, you may need to run it during sequencing.

 

Client Configuration

1.)    Copy your Office 2013 to the client machine

2.)    Copy the sequenced add-in to the client machine

3.)    Modify the add-in’s DeploymentConfig.xml file and modify the following:

4.)    Search for:

“<COM Mode=”Isolated”>”

modify to

“<COM Mode=”Integrated”>”

5.)    Search for:

“<Objects Enabled=”true” />”

modify to

“<Objects Enabled=”false” />”

The Connection Group will fail if the above changes are not made.

6.)    Build a Connection Group document for both Office 2013 and the Add-In. You can do this with stand-alone testing by using the following resource on creating a Connection Group XML document: http://technet.microsoft.com/en-us/library/jj713474.aspx

7.)    Enable Package Scripts

Set-AppvClientConfiguration -EnablePackageScripts 1

8.)    Add the Office 2013 package; publish it Globally

Add-AppvClientPackage –path <path_to_office_package_>.APPV | Publish-AppvClientPackage –Global

9.)    Add the Add-In package; publish it Global

Add-AppvClientPackage –path <path_to_office_addin>.APPV | Publish-AppvClientPackage –Global

10.) Add the Connection Group pointing to the Connection Group document you created earlier. Enable it Globally

Add-AppvClientConnectionGroup –path <PATH_TO_CG_DOC>.xml |Enable-AppvClientConnectionGroup –Global

 11.) Launch the Office application the add-in uses.