App-V 5 Client Reporting–Client Setup

App-V 5 provided the option to separate the reporting that the App-V Client enables from both SCCM and App-V Management server, and it even makes it possible to use with a standalone deployment using Powershell and MSI.

I will not provide a guide on howto setup the server components, it’s a separate topic and shouldn’t be to complex. However, configuring the client can be a bit tricky, at the same time it is very easy to verify that it is setup properly.

Configure it through Powershell;

After you have imported the App-V Client Powershell module;

Set-ExecutionPolicy RemoteSigned
Import-Module AppVClient

You can access the current configuration of the App-V Client;

Get-AppVClientConfiguration

You can see that per default – all configuration relating to reporting is blank. Use the below command-line to setup the functionality;

Set-AppvClientConfiguration -ReportingEnabled 1 -ReportingServerURL urlforyourserver -ReportingStartTime 0 -ReportingRandomDelay 10 -ReportingInterval 1

The above will enable reporting at 00:00 with a 10 minute randomized interval to not overload the server and update the server every 1 day. The server-url is as provided for –ReportingServerUrl (urlforyourserver).

This will actually setup a Scheduled task – which you can easily verify (apart from getting the set configuration using the Powershell example above);
image

I assume that you can tweak the time-intervals on your own.

This is quite easy and is very well documented at Technet.

You can also use Group Policy to provide the above configuration; ADMX-template

App-V 5 Powershell Sequencing

Yeah – its pretty cool. Create a folder with the installation file named c:\source. As sample media VLC will be used. The installation-file is called; vlc-2.0.2-win32.exe

Run the following from Powershell to setup the sequencer cmdlets.

Set-Executionpolicy RemoteSigned
Import-module appvsequencer

Run the below to create two directories and then run through the installer.

$package = 'VLC'
new-item c:\source\$package -type directory
new-item c:\$package -type directory
New-AppvSequencerPackage -Name $package -Path c:\source\$package -Installer C:\source\vlc-2.0.2-win32.exe -PrimaryVirtualApplicationDirectory C:\$package –FullLoad

The final package gets created within c:\source\VLC

App-V 5 and Drivers

Virtualizing applications using App-V 4.X and even App-V 5 does not allow to virtualize drivers, as they are injected directly into the Windows kernel (simplified, of course). Using App-V 5 there has been new progress in easing the delivery of both driver and the application. With a few exceptions, drivers can often be easily extracted from the source-files or the installed application itself. Looking at Dymo Label Writer – you can see that there is a sub-folder within the installation directory called drivers.

image

Reviewing the contents you can see that there is an executable file named dpinst.exe and if you run dpinst.exe /?, the following help is shown.

dpinst.exe: installs and uninst alls driver packages. By default, the tool searches the current directory and tries to install all dri ver packages found.&lt;/pre&gt;<br />Usage: dpinst.exe [/U INF-file] [/S | /Q][/LM][/P][/F][/SH][/SA][/A][/PATH Path][/EL][/L LanguageID][/C][/D][/Lo gTitle Title][/SW][/? | /h | /help]<br /><br />/U INF-file    Uninstall a driver package (INF-file).<br /><br />/S | /Q        Silent (Quiet) mode. Suppresses the Device Installation Wizard and any dialogs popped-up by the operating system.<br /><br />/LM    Legacy mode. Accepts unsigned driver packages and packages with missing  files. These packages won't install on the latest version of Windows.<br /><br />/P     Prompt if the driver package to be installed is not better than the cur rent one.<br /><br />/F     Force install if the driver package is not better than the current one.<br /><br />/SH    Scans hardware for matching devices and only copies and installs those drivers for which a device is present. Only valid for Plug and Play drivers.<br /><br />/SA    Suppress the Add/Remove Programs entry normally created for each driver  package.<br /><br />/A     Install all or none.<br /><br />/PATH Path     Search for driver packages under the given path.<br /><br />/EL    Enables all languages not explicitly listed in the XML file.<br /><br />/L LanguageID          Tries to use the given language in all UI. Useful for l ocalization tests.<br /><br />/SE    Suppress the EULA.<br /><br />/C     Dump logging output to attached Console (Windows XP and above).<br /><br />/D     Delete driver binaries on uninstall.<br /><br />/SW    Suppresses the Device Installation Wizard, the operating system might s till pop-up user dialogs.<br /><br />/? | /h | /help        Shows this help.

Once you wrap up your App-V 5 package you can see that there is a file called DymoLabel Writer 8.4_DeploymentConfig.xml. This contains the setup for a package once its added to a computer and can be used to provide an elevated way of performing actions when deploying a package. Using Powershell or SCCM 2012 this deployment file can be used to provide additional configuration when deployed.

Lets leave the file intact for the most part – it contains any options that were set during sequencing as a standard sample file. Find the section;
<!– Machine Scripts Example – customize and uncomment to use machine scripts –>

Adding this;

&lt;!-- Machine Scripts Example - customize and uncomment to use machine scripts --&gt;&lt;/pre&gt;<br />&lt;MachineScripts&gt;<br /><br />&lt;AddPackage&gt;<br /><br />&lt;Path&gt;C:\media\Drivers\dpinst.exe&lt;/Path&gt;<br /><br />&lt;Arguments&gt;/s&lt;/Arguments&gt;<br /><br />&lt;Wait RollbackOnError="false" Timeout="30"/&gt;<br /><br />&lt;/AddPackage&gt;<br /><br />&lt;/MachineScripts&gt;

The script explains itself. When the package is added – it will be executed. The timeout is 30 seconds and it will not rollback the package deployment if it fails.

To add it using Powershell (SCCM does this automatically for you), fire up a Powershell console and start coding. First, allowed remotely signed scripts to run

Set-ExecutionPolicy RemoteSigned

Import the App-V Client module

Import-Module AppVClient

Add the package with the configuration file and then publish it in a globla-context

Add-AppvClientPackage '.\DymoLabel Writer 8.4.appv' -DynamicDeploymentConfiguration '.\DymoLabel Writer 8.4_DeploymentConfig.xml' | Publish-AppvClientPackage –Global

If you haven’t enabled package scripts to run, you will get this error in the App-V Operational Log;

Log Name:      Microsoft-AppV-Client/Operational<br />Source:        Microsoft-AppV-Client<br />Date:          10/15/2012 11:05:18 PM<br />Event ID:      4004<br />Task Category: Execute Embedded Scripts<br />Level:         Information<br />Keywords:      Embedded Scripting<br />User:          APPVCLIENT\AppV Win7 x86 Client<br />Computer:      appvclient<br />Description: Running machine script defined in package {2b838582-4925-4a53-99a2-0aaf216df77d} for event AddPackage. Script execution was initiated by User Account: 'S-1-5-21-1739582198-759874057-429165515-1000'; command line: 'C:\media\Drivers\dpinst.exe /s'.

You can enable scripts to run for the App-V Client via Powershell;

Set-AppVClientConfiguration –EnablePackageScripts 1

This shows up under Programs and Features once we are done;

image

App-V 5 Beta 2 Deployment

Well.. SCCM 2012 makes a lot of things easier… For example – getting all the Visual C++ Redistributables in place.

image

The above is a picture of all the things that are layed down when deploying the App-V 5 Beta 2 client. Most of the list can be found in the older article on howto setup a packaging machine, some are new (such as the Windows Management Framework 3.0 or http://support.microsoft.com/kb/2533623) and others are skipped (J# 1.1..).

App-V 5, SCCM 2012 SP1 and the wheels behind it all

App-V 5 has introduced some new ways to configure an application – apart from whats available in the GUI. You can see two .xml-files (apart from the report.xml) generated along with the rest of the package – in three other blog articles these were posted and given some thought. Lets ponder though – how do you deploy these using Configuration Manager 2012 SP1 CTP2 ?

Well – its easier than you imagine. Lets begin with our package!

image

As you can see – this is the new standard-output of an App-V 5 sequence. Lets keep the names – that is very important. Don’t rename any files and keep the files intact within the folder. Especially the _deploymentconfig and _userconfig. You get to select the .appv file, but the others are needed aswell. Otherwise you might get this;

image
Unable to find the specified file.

or this;

image
Imported filed, fix errors and try again.

Those are some awesome error messages, right? Try to avoid renaming files (sometimes it works anyways) or removing them from the App-V folder – its for your own good.

So we have established that the _deploymentconfig.xml and _userconfig.xml are necessary files that are actually used. We can now move forward in the wizard.

Next up is to verify our Deployment Type and in particular the Publishing-tab within our Deployment Type configuration.

image

Under Publishing we can select what applications should be available . Its not quite clear when this goes into effect. Since we have imported the _deploymentconfig.xml already – that file isn’t modified when we toggle the publishing of an application. Verifying the contents within the distribution point shows an unaltered file, whereas the file has been modified once it reaches the client.

File on the distribution point;image

File on the client;image

We can review the appenforce.log to see what takes place once a client receives the deployment.

This is the command line for adding the package;

powershell.exe -ExecutionPolicy Bypass import-module 'C:\Program Files\Microsoft Application Virtualization\Client\AppvClient\AppvClient.psd1';&nbsp; Add-AppvClientPackage -Path 'C:\Windows\ccmcache\d\Mozilla Thunderbird 9.0.appv'

Applying the deployment-configuration (because this was deployed to a machine)

powershell.exe -ExecutionPolicy Bypass import-module 'C:\Program Files\Microsoft Application Virtualization\Client\AppvClient\AppvClient.psd1';&nbsp; Set-AppvClientPackage -PackageID 2d9b4db6-3386-4823-8d33-07c0caa4aaf4 -VersionID 7749fb34-1764-4f61-9161-3d0061bd8268&nbsp; -DynamicDeploymentConfiguration 'C:\Windows\CCM\SystemTemp\AppVTempData\2d9b4db6-3386-4823-8d33-07c0caa4aaf4_DeployConfig.xml'

Publishing it for the users – since its deployed to a machine the –Global is used.

powershell.exe -ExecutionPolicy Bypass import-module 'C:\Program Files\Microsoft Application Virtualization\Client\AppvClient\AppvClient.psd1';&nbsp; Publish-AppvClientPackage -PackageID 2d9b4db6-3386-4823-8d33-07c0caa4aaf4 -VersionID 7749fb34-1764-4f61-9161-3d0061bd8268 –Global

As you can see – C:\Windows\CCM\SystemTemp\AppVTempData is a temporary working folder for the SCCM-client to store these configuration files for when they are needed. The files can be reviewed in clear text and gives a chance to see what is actually deployed. Mozilla Thunderbird was deployed successfully (according to SCCM), but no application is visible. Since we can verify the configuration file used – we can see that the application was disabled entirely. This could either be done by the configuration-file we imported or through the GUI within SCCM.

What happens if we alter a configuration file after we have imported it? We can easily choose to create a new Deployment Type and reimport the package;

image

Since we reimport the package – the configuration files will be re-read and available for deployment. Since the distribution point now only stores a file once – we don’t need to worry about how many times we import a specific package (as long as the files are the same). We could have 5, 20 maybe even 100’s of Mozilla Thunderbird – all tailored for different needs within our configuration files!

App-V 5 standalone and Connection Groups

App-V 5 standalone has become a lot easier to deploy as of the new release – we don’t need to configure the client in any particular way and any package can be deployed using an MSI generated automatically by the sequencer. There are certain topics that still need some configuration – Connection Groups is one of them. Lets get started!

Connection Groups allow for virtual applications to interact with each other – it’s the version 2.0 of the Dynamic Suite Composition (DSC). DSC had some major flaws that made its practical use limited and often caused complex scenarios that required extensive troubleshooting. Connection Groups so far looks a lot more improved and hopefully it can be more easy to manage. Within the App-V Server or the SCCM 2012 SP1 there are easy to use ways to administrate these connection groups and deploy – SCCM was previously discussed here.

Since App-V 5 is administrated via powershell and therefore we need to look into the requirements for setting up a Connection Group. I’ll assume that you have installed the App-V client and imported its powershell module. First – we need to define an XML-file that sets the order of the application packages.

<?xml version="1.0" encoding="UTF-8"?>
<AppConnectionGroup AppConnectionGroupId="8601afe3-b565-3143-8ae1-e4f5bba61dcc" VersionId="0ff7a09e-8ed2-654d-80b5-f252ca9037d3" Priority="0" DisplayName="Freemind" xmlns="http://schemas.microsoft.com/appv/2010/virtualapplicationconnectiongroup">
<Packages>
<Package PackageId="5955a77b-b40f-4c1a-a9a4-b798591e8524" VersionId="8946295f-751e-4b4d-a887-eda103bb88f2">
</Package>
<Package PackageId="ea883402-3266-43ff-b4bc-a3bf0ad1905b" VersionId="3abd54ec-6055-43c1-95c5-11a827c6c992">
</Package>
</Packages>
</AppConnectionGroup>

Lets go through the XML-file

AppConnectionGrouId needs to be a unique identifier for Connection Group. In case you are out of imagination in creating one – you can run the following powershlle-command to get one;

 [guid]::NewGuid() 

This is the output;

image

You can repeat the same for VersionID – which needs to be updated for each version of the Connection Group.

DisplayName can be anything – SCCM sets a unique ID that it keeps track of. Since we are doing this manually – an easy to understand name might be good.

The next section is AppV Packages. You will need to know the PackageID and the VersionID from the packages you are connecting. This information can be retrieved by running the powershell command Get-AppVClientPackages

image

Once we have created the file – named freemind.xml in this case, we can actually go by setting up the connection group. The below one-liner will add the Connection Group and publish the Connection Group globally (for all users that is).

Add-AppvClientConnectionGroup -Path 'c:\media\freemind.xml' | Enable-AppvClientConnectionGroup –Global

If you want to disable a Connection Group –  you can use the name you set to easily locate it and disable the Connection Group.

 Get-AppvClientConnectionGroup -name freemind | Disable-AppvClientConnectionGroup

App-V 5, SCCM 2012 SP1 and Connection Groups

Since we have so many new releases coming up – it was time to set how well they co-exist. App-V 5 Beta 2 is out and inorder to support that in a SCCM 2012 environment – we need SCCM 2012 SP1 deployed into the environment. Once that happens – some new options are available that we will browse through.

When creating a new application  – we have the option of two different Application Virtualization applications. One is the legacy-format of App-V 4.6, and now App-V 5 is also available as a choice.

image

The wizard is pretty easy – you select the .appv-file created during your packaging efforts and the application will be imported into the environment. If you verify the properties of the deployment type – you can see a new tab;

image

Virtual Environments can be setup within the newly available node App-V Virtual Environments just below the rest of the nodes in Application Management.

image

Creating a new Virtual Environment might seem scary, however it simply is the new version of what was previously called Dynamic Suite Composition. From an App-V perspective – its called Connection Groups. Where the name Virtual Environment comes from seems odd – but we are just creating Connection Groups in the end.

image

Each connection-group needs a name, a name that only seems to be visible through SCCM-console. Reviewing later on whats deployed on the client – the name does not appear anywhere. Next step is to start adding applications to the Connection Group.

image

You can only see App-V 5 applications listed, keeping adding them one at a time…

image

It does matter in which order you add them – however only from the usage of the application. SCCM will not deploy any applications automatically part of a Connection Group, you need to make any virtual applications deployed on their own or as part of a dependency. Once a Virtual Environment (aka Connection Group) is created – if all the applications are available on a client – the Connection Group will be created through a series of Powershell commands.

image

image

The client actually executes the following commands to ensure that the Connection Group is created;

powershell.exe -ExecutionPolicy Bypass import-module 'C:\Program Files\Microsoft Application Virtualization\Client\AppvClient\AppvClient.psd1'; Add-AppvClientConnectionGroup -Path 'C:\Windows\CCM\SystemTemp\AppVTempData\ConnectionGroup_609C8E91-7A45-49D8-85EF-6F97393F6AD7.xml'
powershell.exe -ExecutionPolicy Bypass import-module 'C:\Program Files\Microsoft Application Virtualization\Client\AppvClient\AppvClient.psd1'; Enable-AppvClientConnectionGroup -GroupId 609C8E91-7A45-49D8-85EF-6F97393F6AD7 -VersionId 11998038-9881-4E71-AE3F-05B8CC736CF8  -Global

As you can see – there is a XML-file referenced. This file contains the configuration of the group;

<appv:AppConnectionGroup xmlns:appv="http://schemas.microsoft.com/appv/2010/virtualapplicationconnectiongroup" AppConnectionGroupId="609C8E91-7A45-49D8-85EF-6F97393F6AD7"
VersionId="11998038-9881-4E71-AE3F-05B8CC736CF8" IgnorableNamespaces="" DisplayName="ScopeId_2C452F22-4D7F-4190-B8A7-296878D46822/VirtualEnvironment_377202b9-16f7-465a-831d-60e20961c0a1">
<appv:Packages>
<appv:Package PackageId="52493623-312b-4187-9d0f-505d4b8cb791" VersionId="d23059ee-91ec-466b-a115-9157b4be0604"/>
<appv:Package PackageId="6d099036-5110-49bc-a2b9-c6d954bad70e" VersionId="af0d1d10-e5cc-47b4-8659-920a70acefab"/>
</appv:Packages>
</appv:AppConnectionGroup>

App-V 5 and Office 2013 Preview packages

To be able to import the Office 2013 Preview Packages that can be downloaded – you need the following;

1. App-V 5 beta 2 client

2. Scripts needs to be enabled for the import to occur. To enable this and then import – run the following Powershell commands;

Set-ExecutionPolicy RemoteSigned
Import-Module AppvClient
Set-AppVClientConfiguration -EnablePackageScripts 1
Add-AppvClientPackage 'C:\media\ProPlusVolume_VisioProVolume_ProjectProVolume_en-us_x86.appv' | Publish-AppvClientPackage -Global

Obviously – you need to alter the path to where the package is located.

Virtual Application Extensions and the future

App-V 5 is in the loop and this time around Microsoft has greatly revamped the architecture on how the virtualization part of App-V will be implemented. However, inorder to understand the tremendous advantage we will have with the new architecture – lets look at previous problems of Application Virtualization.

Softgrid and what became Microsoft Application VIrtualization was a great product that made deploying applications very simple and removed a large portion of why application deployments were scary. As opposed to deploying an application in its traditional sense – melting it together with the operating system and all its other application – we gained the possibility of providing a virtualized layer on top of the operating system. This layer provided two main components which removed the threat of breaking other applications or the operating system – virtualization and isolation. By allowing only a specific agent (aka sfttray) to spin up the virtual environment we created a nice line of defense that would ensure our computers integrity and allow the application to utilize local system resources.

The downside of the coin was that if only a single agent could access our virtual environment – we have also isolated the resources within that virtual environment and any type of call into that environment need to pass through our single guardian. The main problem with this was that sfttray (our guard) only allowed certain things to pass through by default, and as Windows and applications came up with new ways of integrating with applications – those “defaults” soon became to few and eventually altered the user experience of an application. For quite some time there haven’t been any technical limitation to virtualize just about any application, but the client that was delivering those applications proved to be very limited in allowing users to interact with the applications seamlessly. Sfttray supported file type associations and shortcuts. Simply not good enough if you are supporting todays demanding end-users.

App-V 5 will change this paradigm and provide an architecture that can ensure future abilities will be extended with much less effort – if any effort is necessary. As opposed to passing through a guard – we will not be limited to accessing it via an agent instead we can now gain access directly and only virtualizing it. Sfttray is history – and so is the Q: – drive. Lets poke around at a virtual application to understand why this architecture makes such a difference.

Meet the shortcut. A shortcut was supported in App-V 4, however the command-line in the shortcut always referenced sfttray.exe and then invoking your virtual application. Say hello to App-V 5 type of shortcut;

image

As you can see – we are now directly calling vlc.exe. It seems to be placed directly onto our filesystem – infact it is!

image

Directly under C:\Programdata – our packages are now placed in the native filesystem. As you can see we also have another improvement which is not even mentioned – the previous requirement of a unique 8.3-compliant name is gone. Instead all packages are executed under their unique (very long) GUID – to allow us to focus more on application packaging and less on naming conventions.

App-V 4 also supported file type associations – which are still there. With an improved experience!

image

This is a wmv-file – associated to our virtualized instance of App-V. Lets say we want to set another file type to be associated with our virtualized VLC. Previously we had to go through sfttray – but that’s gone…

image

VLC is now presented as any other program. Previously we had to retrain our users to select sfttray (here also presented as we allow the App-V 4.6 SP2 and App-V 5 to co-exist on the same system) and then select their program. Now – a native experience is given to the end-user and they can select the application that they want start a file type association with.

This all seems great that the experience with existing extensions (anyone who has been forced to listen to me knows that I call these entry points – but from now on I will favor extensions) – lets see what new stuff is out there. Right-clicking a file type will bring context-menus;

image

If the user is more familiar with altering a file type association through the Default Programs from within the Control Panel – VLC will also be presented here as a regular application;

image

We can see all the file type associations that our virtualized VLC currently is set to be the default application to handle;

image

However, if we insert a DVD – that’s not a file-type association is it? Well – how external media (DVDs for example) are started or at least what options are presented to the end-user is defined from Autoplay in the Control Panel. Yet again – we can see the virtualized VLC showing up as the end-user would expect it to;

image

All of these interactions were previously not available (still possible through manual labor and tweaking in the registry) – now we get them out of the box from a virtualized application! To move further – Spotify will be used to demonstrate even more interaction! When creating a package – a couple of files are created. The content is .appv, the installer in a standalone mode is the .msi – but we also have two configuration files – named Deployment and User config. If reviewing Deployment-config for our Spotify package – we can see the following;

image

This looks awesome – as Spotify has its own protocol handler which allows users to click a link and directly open a playlist within Spotify.

image

This are all visible extensions for the end-user and will make the gap of the experience between a virtual application and a natively installed application even smaller. However, the App-V team didn’t stop here and made even more possible extensions beyond of what we were expecting.

There are two methods that are used under the hood of everything – that provides a greater interaction between applications and allows for seamless exchange of data between applications. Quite often – we admins had to find out the hard way that this “report” for application X actually depend on beeing able to locate Excel, Adobe Acrobat or some other program. Many ways are used to send to the proper data to this “other” program – quite a few articles to resolve problems regarding this inter-application communication problems are written by me personally and even more questions are asked in the forums. We know about them – but what are they really?

AppPaths are one way – its an easy way to locate a needed .EXE if the application has registered itself.  If reading the article – it allows for quite a few different ways to use this feature, however – we most commonly deal with it because a program calls an application (say excel.exe) by simply asking for excel.exe – and not a full path. When registered properly – apppaths will allow us to start our specific version that we currently have installed. Filling in the full-path to the executable in question.

If our application is virtualized (excel.exe for example) – it will not be registered at all and the main application will simply state that you need this application installed. Fortunately – App-V 5 will now allow applications to register themselves properly and there be found by any application (virtualized or not) requesting them!

image

The other alternative are is COM. COM has been around since 1993. COM is something that has been and still is beyond me. Usually – when you realize that an obscure error message is given when the program attempts to send data to an external program COM is related. Wikipedia has a great article which clarifies it to some extent in what ways we are dealing with COM. OLE, OLE Automation, ActiveX, COM+ and DCOM are the more commonly used words.

Here is an example of a COM that was detected by the sequencer;

image

Wow – so we have just learned that App-V 5 will bring in many new ways that will improve the application experience and make previous scenarios that seemed impossible suddenly appear simple and work right out of the box.