App-V 5.0 Sequencer and Reboots

App-V 4.X

Previously, in App-V 4.X, while sequencing you would never have to reboot. The idea, which worked in most cases, was the sequencer would simply – while in monitoring mode – execute what ever was in queue for the next startup before proceeding to the next part of the sequencing process.

This list of things to execute would be gathered and executed once you hit Stop Monitoring. Stop Monitoring was a button available in the sequencer up until App-V 4.6 and this could also be pressed multiple times. In App-V 4.6 SP1, and forward, changed the workflow of the sequencer and suddenly the button Stop Monitoring was not available. You could suddenly not hit this button multiple times, but simply check “I am finished” and click Next. Unfortunately – you could not go back. Multiple reboots were suddenly a hassle – as you would have to save the package and return to the start of the workflow to initiate a second reboot.

There had been a few known cases (never personally hit them) were reboots were simply not handled as nicely as one would like in this workflow. As always – things can get better.

App-V 5.0

In App-V 5.0 this changed drastically and now you were commanded to perform the reboot. The experience would be that at any time after the actual monitoring process started  a reboot could be executed, and once the computer starts up again the sequencer will resume operations.

Reboot.exe is the process that scans your computer and apparently it saves the state into a sub-key of the App-V sequencer.

image

HKLM\SOFTWARE\Microsoft\AppV\Sequencer\Resume is the place to watch out for!

Under Resume there is a Serialized State that seems to explain where the current state of the package is;

image

I haven’t personally experienced any issues with this, however quite a few people have. As far as I know they have always a few things in common;

  • The sequencer workstation is domain-joined
  • Its running as a virtual machine

Problems

What happens if you perform a reboot and you do have an issue?

Firstly – the sequencer can catch that it hasn’t been allowed to prepare enough for a shutdown;

the sequencer was unable to prepare for a system restart.

If no error message is presented this means that the sequencer was given enough time to prepare the sequence so that it should be successfully resumed once the computer is rebooted. However, something else can interfere during startup and then this happens;

image
An error encountered while trying to start the monitoring session.

Event Viewer

A good idea is to check Event Viewer under Application and Services –> Microsoft –> AppV –> Sequencer and the Admin-log.  By manually crashing the sequencer and just attempting to restart it this was generated;

An attempt to start the monitoring session failed (The process cannot access the file because it is being used by another process)

Run / RunOnce

You could avoid the reboot and manually locate what needs to happen for the application installation process. A tool to use in this process is Autoruns (from Sysinternals) or poke around the registry for potential clues in the Run registry key. Once you identify what is set there to run at the next reboot – simply run it to get it into the monitoring process. Hopefully this will allow you to proceed without having to deal with the reboot in itself.

Or you could to try to resume the sequencer again. I can’t say that I have been able to test this in anyway, but once a reboot is initiated the sequencer will write to RunOnce so that once you login again the process will resume;

HKCU\Software\Microsoft\Windows\CurrentVersion\RunOnce

Manual resume

Try this;

C:\Program Files\Microsoft Application Virtualization\Sequencer\Sequencer.exe /resume

However, it did fail the first time … Why would it work the second time?

What could cause this?

My assumption would be that any type of process that would interrupt the sequencer to properly shutdown its business in Scratch or properly open it would of course interfere the process.

If there is a GPO that would clear out the temp-folder, very common within RDS environments, that could potentially cause issues (as the serialized state will be lost).
I have heard a rumour that redirect folders (such as My Documents, or AppData) might interfere.

App-V 5.0 SP2 (beta)–Client UI

If you have installed the App-V 5.0 SP2 beta Client which is available on Connect, the first you notice that there isn’t anything on the start-menu. In the initial release of App-V 5.0 there was both a tray icon and a shortcut directly on the users start-menu (well, if using Windows 7) to view the state of the client, however (unlike the previous 4.X version) there was also no way of getting rid of the system tray icon (and /or official way of not getting the start-menu shortcut, but you can just delete it without any harm).

In a technical community though, the workaround is not far away and after a while someone figured out that by renaming one of the executable files you would simply fail the systam tray icon to start.

Not a pretty way togo?

Well, in App-V 5.0 SP2 (beta) the UI seems to be completely gone. Actually – there isn’t any system tray icon and no start-menu shortcut. Obviously we have been hearing the PowerShell drum for a while – so did they go for the bold move and completely wiped the icon?

I can’t say that the system tray icon is around anymore, however the interface for users can still be found – as a virtual app!

Lets hope this is the start of an awesome trend, but yeah – why not provide the App-V Client user interface as a virtual application?

image

Add-AppvClientPackage -Path .\AppVClientUI.appv | Publish-AppvClientPackage
PackageId            : 237cb45b-20c7-4c91-985c-39a94507975a
VersionId            : f53d7a26-7fe3-40ab-990e-f244dc59ff43
Name                 : Microsoft App-V 5.0 Client UI
Version              : 0.0.0.1
Path                 : C:\Users\\Desktop\AppVClientUI\AppVClientUI.appv
IsPublishedToUser    : True
UserPending          : False
IsPublishedGlobally  : False
GlobalPending        : False
InUse                : False
InUseByCurrentUser   : False
PackageSize          : 1241895
PercentLoaded        : 21
IsLoading            : False
HasAssetIntelligence : False

You can publish it globally or to a specific set of users. Anyway you like it!

Download the RTM-bits from Microsoft.

App-V 5 installation fails

When deploying the App-V Client at a customer site the installation failed (or halted was more like it). It seems that a few parameters caused issues and once reviewing the log-file it became apparent which. Last part of the log-file looked like this;

MSI (s) (68:78)  Executing op: CustomActionSchedule(Action=OptIntoMu,ActionType=3073,Source=BinaryData,Target=AppvPerformMUOptInInstall,)
MSI (s) (68:B4)  Invoking remote custom action. DLL: C:\Windows\Installer\MSI37CC.tmp, Entrypoint: AppvPerformMUOptInInstall
Fault injection has been disabled by policy.

The parameters set during the install (for App-V 5.0 SP1) was set like this;

/ACCEPTEULA=1 /ENABLEPACKAGESCRIPTS=1 /MUOPTIN=1 /CEIPOPTIN=1 /NORESTART /q

Toggling MUOPTIN to 0 resolved the issue – which is great. I am guessing that if updates are provided through Microsoft Update they will simply have to be deployed through normal software distribution.

App-V 5.0 SP2–AppvClientConfig

imageThere are a few new configuration settings that can be exposed via Get-AppVClientConfiguration. Looking at the output of the PowerShell cmdlet on the side we can spot four new in total;

PackageStoreAccessControl
EnablePublishingRefreshUX
ProcessesUsingVirtualComponents
EnableDynamicVirtualization

PackageStoreAccessControl can restrict users from browsing, and starting applications from, the PackageInstallationRoot to locate any published applications and gain access to something that was not intended for them.

EnablePublishingRefreshUX aims at providing a user interface, a progress bar, for the publishing refresh operation. Since the new architecture for App-V 5 has been put into production this is a topic that has surfaced that the publishing refresh is slower compared to App-V 4.X and interrupts the user. As part of improving that experience there are two changes – one is to provide the user with a visual indicator on how far along the progress is. The second part is that the start menu is only refreshed for every 5 applications that are published – to avoid it refreshing to often.

The Sync-AppVPublishingServer also has a –HideUI to give the option to not present the progress bar when performing a sync.

ProcessesUsingVirtualComponents is a new setting that seems to relate to the ability to provide the new shell extensions and the browser helper objects. Its not documented, but it seems to provide a list of processes that can access the virtual environment to utilize resources part of the package.

Sample value; ProcessesUsingVirtualComponents         {%SystemRoot%\explorer.exe, %Program…                                  

EnableDynamicVirtualization simple toggles the ability to use the virtual extensions on or off.

App-V 5.0 SP2–Shell Extensions

Since I first started looking at App-V (4.1) back in 2006 – there was one feature that has always been wished upon.

Right-click menus – aka shell extensions.

Aaron Parker has previously written a hack which could resolve this, but its not been widely used and requires a lot of work but does not provide all functionality. The initial idea came from VMware and howto leverage the MSI-file to “workaround” the issue

image

Why? Since day 1 – part of the App-V training has been to sequence a “simple” application. Such as WinZip, WinRar or any other common compression utility part of any standard desktop deployment. However, when deploying this in production a single topic always surfaced and gave App-V a bad reputation within all companies. Shell extensions were not supported as an extension. In essence – the knowledge the operating system had about any existence of a virtual application was shortcuts and file type associations. It has taken from 2006 and up until App-V 5.0 RTM in 2012 until this changed in anyway. App-V 5.0 introduced major feature changes in this area and this of course brought a lot of hope up.

This hope has now turned into reality.

I can not praise Microsoft enough to finally provide us with this feature request.

As you can see – both WinRar and Beyond Compare have been deployed to a client, and as soon as a right-click menu is presented with the options – the package is in use.

What do you need todo during sequencing to make this work? Nothing – it just works!

Finally – we can truly aim for that 100% virtualized applications scenario being in reach for any environment. Its not quite there, but it is not far away.

New extensions are;

ActiveX controls
Browser Helper Object
Context Menu Handler
Drag-and-drop Handler
Drop target handler
Data object Handler
Property sheet handler
Infotip handler
Column

App-V 5.0 SP2 – Visual C++

Since App-V 4.5 has been released into the wild there has been a couple of things I personally have been preaching to the community to get a high level of successful virtualized applications. One of these things is the deployment, and active updating of, Visual C++ Redistributable. All in all there is about 22 different versions to be deployed both onto any sequencing machine and any potential client. See the previous article Setup a VM for Packaging for a complete list that contains download links and in which order I install. them. Tim Mangan has gathered a more complete list that contains a lot more information about each and every version of the Visual C++ Redistributable. Now, this is all talk and no evidence that the native installation of all these different prerequisites will actually make life easier for anyone and perhaps just introduce a risk for us when deploying additional components natively.

I wrote a FAQ response on Aaron Parkers App-V 4.X FAQ regarding if you can virtualize VC Redist or .NET Framework – which conclusive says NO. In addition to the above generic response, I have personally dealt with SAP GUI (7.1 / 7.2), Adobe Photoshop CS6 (most likely applicable to all CS 6 software), Paint.NET, the error message 000036B1 and Autodesk Navisworks Freedom when it comes to recipes and specific error messages that all go back to missing Visual C++ Redistributable components as a root cause.

This is now a thing of the past.

App-V 5.0 SP2 changes this drastically as it will detect and virtualize all versions of Visual C++. In addition to this – the App-V 5.0 SP2 client will now detect VC++ Redist components part of packages produced in earlier versions of the App-V 5.0 sequencer and also allow those to be part of the virtual environment.

How does this work? It just works!

When you sequence a software, no “special” actions are necessary, no additional steps are required. Once you have completed the installation a report will inform you that the components are detected;

image

The details of the report looks like this. It tells us which components have been detected.

image

What does this mean for the previous written best practices?

It’s all in the trash

We can move back to a “lowest common denominator” for the Visual C++ Redistributable components and make sure that as much as possible are part of our packages. Stay tuned for an updated article on that!

One setting located under Options on the sequencer;

image

App-V 4.6 Manual uninstall

Did you ever get the dreaded error Error 25028.The Application Virtualization Client service could not be configured from the App-V installer? It should be effective enough to perform a manual cleanup according to the previously blog-post article by Microsoft, however there are some minor steps that eases the process in addition to what has been communicated.

A summary of steps according below;

Execute the following commands to remove the services;

sc delete sftvsa 
sc delete sftlist 
sc delete sftplay 
sc delete sftfs 
sc delete sftvol

Delete the following folders;
C:\ProgramData\Microsoft\Application Virtualization Client
c:\program files (x86)\microsoft application virtualization
%public%\documents\softgrid client
%appdata%\softgrid client
%localappdata%\softgrid client

For an App-V 4.6 SP2 client, you need to remove this registry entry;

HKEY_CLASSES_ROOT\Installer\Products\C38408D5792D40E4E9FDDD8525E15956

It may be different for an App-V 4.6 SP1 client, but you can easily find it by searching for “Virtualization”.

Reboot the client and the installation should run cleanly afterwards.

Office 2010 and App-V 5

Sequencing Office 2010 with App-V 5 is quite simple and actually less of a hassle compared to the instructions for the previous version of App-V (4.6). The instruction still requires full attention of the person executing them, but there are less steps to mix-up things with. Most likely – this is due to the new Virtual Extensions in App-V 5 that can more easily integrate any product into the operating system.

There is a known issue list posted by Microsoft that details some topics that are quite interesting and will present a few gotchas to any one deploying this.

And, as always; Read Aaron Parkers whitepaper regarding the virtualization of Office 2010 with App-V. It is a long document, but then again – if you fail to deliver office properly the negative spiral from end-users will drown you in work.

However, its quite a big task to virtualize Office and even with the simplified and more enabled virtual extensions – there are a few gotchas. Like this;

image

There are two Mail Control Panel applets published with the App-V 5.0 integration kit. The 64-bit version doesn’t work out of the box, most likely because its not supposed to be used at all if you are deploying a 32-bit version of Outlook. I can’t say that the same is true for the 32-bit applet if deploying 64-bit version of Outlook – that you may test on your own.

You can manually correct this by locating the following registry key;

HKEY_CLASSES_ROOT\CLSID\{005CB1F2-224F-4738-B051-91A96758F50C}\shell\open\command

Set the default value to REG_EXPAND_SZ to;

C:\ProgramData\App-V\CAA7FF95-824E-461C-8DBB-0FCB2431415D\F7ABB870-0634-445A-867A-5AB1D09C7BE5\Root\Client\AppVLP.exe" rundll32.exe shell32.dll,Control_RunDLL "C:\ProgramData\App-V\CAA7FF95-824E-461C-8DBB-0FCB2431415D\F7ABB870-0634-445A-867A-5AB1D09C7BE5\Root\Office14\MLCFG32.CPL

Well – actually don’t. The above reference is the specific path to the unique guid of my personal package.  Pick up _your_ specific path from the 32-bit key;

HKEY_CLASSES_ROOT\Wow6432Node\CLSID\{72F3C31D-95DE-4d79-9979-FB899BB89427}\shell\open\command