AppV5 – Sequencing Oracle 11g R2

/ / /

Apparently this is a fun topic.  How do you sequence Oracle 11G R2 on AppV5?

I believe I have an answer.  In my attempts to sequence Oracle 11G on AppV5 I came across a few issues and have come up with solutions that work for various applications that rely on this tool.

The first issue:
Oracle 11G only allows paths without spaces and special characters.

On Windows systems, if the path to your Java installation includes a space character, you must provide the path in DOS 8.3 format, as shown in the previous example.

This *maybe* fixed now, but I experienced issues with trying to install Oracle 11g to the 8.3 folder structure to place it under “Program Files” or “Program Files (x86)”.  The sequenced application would be broken.  This was a known/reported issue with AppV 5SP2 HF4 that was marked as ‘fixed’ by Microsoft for SP3+.  I have not had the ability to confirm that and will continue this post with what I know works…  I also believe that when expanded out it uses the full path with spaces as opposed to the 8.3 path.

Second Issue:
Installing Oracle 11G to the default ‘recommended’ directory will fail if you move your PackageInstallationRoot to a different drive.

This is because the second folder (apps – in this example) is not tokenized.  Forcing AppV5 to utilize the token “appvPackgeDrive” which can expand out differently then you expect, breaking the application.

Third Issue:
Cannot install to PVAD.

The reason I chose to NOT utilize PVAD is if you do then Oracle cannot be used in connection groups.

So how do you resolve all these issues and sequence Oracle 11G R2?

The direction I went was to ensure the directory I sequenced the installer to was a tokenized directory.  It also needed to a directory that, when expanded in the virtualized environment, does not contain any spaces or special characters.

The list of directories AppV5 tokenize’s can be found in the AppV 5.0 Sequencing Guide.

I’ll list them here:

Known Folder Token
Known Folder Path
Administrative Tools
C:UsersAppDataRoamingMicrosoftWindowsStart MenuProgramsAdministrative Tools
Application Shortcuts
C:UsersAppDataLocalMicrosoftWindowsApplication Shortcuts
C:UsersAppDataLocalMicrosoftWindowsTemporary Internet Files
CD Burning
Common Administrative Tools
C:ProgramDataMicrosoftWindowsStart MenuProgramsAdministrative Tools
Common AppData
Common Desktop
Common Documents
Common Programs
C:ProgramDataMicrosoftWindowsStart MenuPrograms
Common Start Menu
C:ProgramDataMicrosoftWindowsStart Menu
Common Startup
C:ProgramDataMicrosoftWindowsStart MenuProgramsStartup
Common Templates
Device Metadata Store
C:UsersAppDataRoamingMicrosoftInternet ExplorerQuick LaunchUser PinnedImplicitAppShortcuts
Local AppData
My Music
My Pictures
My Video
C:UsersAppDataRoamingMicrosoftWindowsNetwork Shortcuts
Podcast Library
C:UsersAppDataRoamingMicrosoftWindowsPrinter Shortcuts
C:Program Files
C:Program FilesCommon Files
C:Program FilesCommon Files
C:Program Files (x86)Common Files
C:Program Files
C:Program Files (x86)
C:UsersAppDataRoamingMicrosoftWindowsStart MenuPrograms
Quick Launch
C:UsersAppDataRoamingMicrosoftInternet ExplorerQuick Launch
Roamed Tile Images
Roaming Tiles
C:UsersSaved Games
Start Menu
C:UsersAppDataRoamingMicrosoftWindowsStart Menu
C:UsersAppDataRoamingMicrosoftWindowsStart MenuProgramsStartup
User Pinned
C:UsersAppDataRoamingMicrosoftInternet ExplorerQuick LaunchUser Pinned
Custom Token
Custom Token Expansion
C:UsersAll Users


There are multiple directories we can choose.  I opted to use “Common AppData”.  That means I will install the Oracle client here: “C:ProgramData”.  It does not contain a space, is tokenized, and when expanded will remain on the C: drive.  I created a ‘response’ file for the Oracle install.
I called the script through this command:
And that’s it!
Read More

AppV5 – Virtualizing and running Local Services stand-alone

/ / /

AppV5 allows you to virtualize Services that run under the LocalService account.  The issue I’ve seen with this approach is AppV5 will load the service for a user upon environment launch (which is good for VDI / desktop deployments) and the service will terminate upon that AppV environment exiting.  For remote desktop / Citrix XenApp deployments, this can be a big bother.  If the service is required for running the application the standard answer is to extract it and install it using DeploymentConfig.xml or some other on application publish.

But what if you have a service that is NOT required to run an application, just needs to run in the background, AND can run as the LocalService?  This service would be prime for being virtualized!

Do I have an example of such an application?  Why yes I do.

Epic SystemPulse is an application that captures performance information and uploads it to a DB.  It only runs under a LocalService account.

Using my Citrix PVS Sequencer, here is how I sequenced it:

These next screenshots illustrate the simplicity of this application:

Virtual Registry Hive For Epic SystemPulse


All files required for Epic SystemPulse


Lastly, the single service we need running

Now, the problem.

I am running this service on a RDS/XenApp server.  This service needs to run while an application, Epic Hyperspace, is running.  My first thought was the use a connection group so that whenever Hyperspace is launched, SystemPulse will launch with it.

This, initially, worked.  The first user who launched HyperSpace also had SystemPulse running at the same time.  Subsequent user whom launched HyperSpace, had their SystemPulse service start and terminate, with the first service continuing to run.  It looked like a success!

Second user launches app, SystemPulse (EpicSvcMaster.exe & EpicSvcHost.exe) starts and terminates, the original processes still running.

Eventually, that first user logged off.  And the SystemPulse processes exited with it.

I thought being SYSTEM processes they were started in some way that a ‘SYSTEM’ process wouldn’t terminate willy-nilly.  This is not the case.  A quick test of ‘get-appvclientpackage’ shows the package as ‘In Use’, signifying that AppV5 is tracking the processes.  The users logging off will turn that ‘True’ into a ‘False’.

Now, we had to wait until the next user started the application to have the service start back up.  This was an unacceptable solution.

But we know that this AppV5 package will work as a service.  We can reap all the benefits of AppV; we can deploy this package on a whim, it’s not a local/permanent install, it works!  So now the question becomes how can we keep these advantages and what are the drawbacks?

The first drawback I encountered was ‘how do I open a AppV Virtual Environment (appvve) so this service will start?’

I tried several things.

I created a script/scheduled task that would check to see if the process was running and if not, open a appvve.  This failed.  I tried this using the LOCAL SERVICE to start my script to open my environment and it would not.  I tried using the SYSTEM account and it failed.  It turns out you can’t use either of these accounts to open a appvve.

With this failing, I moved to another method.  AppV has the ability to start a script upon application publishing, could I use this to start my service when the application is published?  It turns out that the account that runs when this context is started is the SYSTEM account, and it failed same as the scheduled task.

At this point I figured my problem is the account I’m trying to open the appvve with.  I need to launch it with a service account.  My first attempt I made a script with a hard-coded username/password string with PSEXEC.exe to open my appvve.  I put this script in deploymentconfig.xml.

And it worked!  It opened my appvve environment, the services started, and everything looked great! The only issue I had now is the hard-coded username/password combo.  There is no way having that would be acceptable in a plain text file.

So I created a exe with AutoIt, ‘RunAsWait.exe’.

It may not be the most secure thing when compiled, but internally it’s good enough…
With this I set my deploymentconfig.xml with the program and arguments I was looking for:

The CMD file looked like so:

With this, my service will start upon application publish.

I set it to launch a exe that gets installed with the package (SystemPulseConfigEditor.exe) as I needed a unique name I could key in on to determine if the package started successfully.  This has a drawback though, the exe I chose has a GUI and I launch the process with -WindowStyle Hidden; if the service crashes, this EXE prompts for attention.  When RDP’ed into a server this notice comes up as “Interactive Service” something-or-other and clicking on it brings this exe visible.  I have considered making a AutoIT app that has no GUI and just sits in the background doing nothing, but time has not permitted me this yet.  Sometimes the SystemPulse service will crash so I added the /RESTART to this batch file to get it to kick off.  By removing the package then ‘rsync’ing with the publishing server we trigger PublishPackage script which launches the service.

Read More

AppV5 – Prelaunch Script for Citrix XenApp 6.5 applications with varying environments

/ / /

We utilize a lot of pre-launch scripts for our AppV5 applications that we use in our Citrix XenApp 6.5 environment.  They become a necessity very quickly as AppV5 stores the executable down a very long path.  Citrix XenApp 6.5 has a maximum launch string of 160 characters and this maximum prevents a lot of applications from working if they require parameters to be passed to them.  An example looks like this:

This launch path is too long for XenApp 6.5.  The string will be truncated and the program will fail to launch properly.   We have several environments that work with the same package files so we set them as variables.  To get this package to launch properly we create a prelaunch script that looks like so:
At this point we set our application to point to this CMD file.
And the application will launch with the shorter string with the ability for us to change the environment and location quickly and easily.
Read More

AppV5 – Recipe for Epic 2012

/ / /

AppV5 – Sequencing first steps


I create install.cmd files for all of my applications so that, if required in the future, I can re-sequence an application quickly completely through script or via one of those ‘PowerShell AppV5 automated GUI’s’.


Supplemental files:
1) Select ‘install.cmd’ and click ‘Next’
2) Name the package and click ‘Next’
3) Let the install script do its thing (note the clock)…

4) AppV5 – Post install sequencing steps

5) Review for any extra registry keys/files (generally there are none or very few) and remove and save the package.

6) In order for Epic to launch in a reasonable amount of time, registry staging must be done.  Without a pre-executed registry staging, first launch performance of Epic can take hundreds of seconds.

Read More

AppV5 – Recipe for ScreenTest III

/ / /

This is the most recent app I sequenced and a good template for how I am going to do my recipes.

AppV5 – Sequencing first steps


I create install.cmd files for all of my applications so that, if required in the future, I can re-sequence an application quickly completely through script or via one of those ‘PowerShell AppV5 automated GUI’s’.


Supplemental files:
1) Select ‘install.cmd’ and click ‘Next’
2) Name the package and click ‘Next’
3) Let the install script do its thing…

4) AppV5 – Post install sequencing steps

5) Review for any extra registry keys/files (generally there are none or very few) and remove and save the package.

Read More

AppV5 – Post install sequencing steps

/ / /

1) Check ‘I am finished installing’ and click ‘Next’

2) Wait out the ‘Collecting system changes’…

3) You may choose to ‘select’ your application and click ‘Run Selected‘ then click ‘Next’

4) Click ‘Next’

5) Select ‘Customize’ and click ‘Next’

6) Select ‘Force applications to be fully downloaded’ and click ‘Next’

7) Select ‘Allow this package to run on any operating system’ and click ‘Next’

8) Select ‘Continue to modify this package without saving using the package editor’ and click ‘Next’

9) Click ‘Close’

Read More

AppV5 – Sequencing first steps

/ / /

I follow a specific pattern when sequencing my applications.  I’m going to put the same first steps for every application I sequence here.

1) Open the ‘Microsoft Application Virtualization Sequencer’ and select the menu ‘File’ then ‘Load Template…’

2) Browse to and select your template.

3) Click OK

4) Click ‘Create a New Virtual Application Package’

5) Click ‘Next’

6) Click ‘Next’

7) Choose ‘Standard Application’ and click ‘Next’

Read More

Setting up a PVS AppV5 sequencer

/ / /

A typical workflow for sequencing an application is something like this:
1) Take a snapshot of your sequencer (odds are it’s a virtual machine [VM])
2) Power up your sequencer and sequence your application
3) Move your application to your system, test it, try and catalog all problems.  Revert your VM snapshot and go to step 1.

In several environments that I have worked in, this is a bit of a hassle as most environments implement the ‘Machine Account Password Expires after X days’.  So after that time you either need to delete your snapshot, power on your VM and rejoin domain then start over.  This gets really cumbersome with multiple sequencers to take care of.  In addition, at my current environment, we require Windows Update be up-to-date and applied to all machines, including sequencers.  Reverting a snapshot to before Windows Update will, sometimes, cause Windows Update to start upon the desktop when you login.  There is a lot of overhead and hassle to maintaining snapshots, though it is better than the alternative of reinstalling the operating system each time you want a clean sequencer.

There is a very elegant solution to all of this I have found that also allows me to sequence super fast.

Citrix Provisioning Service (PVS).

Citrix PVS works by managing the Active Directory machine account password for me, so I never have to reset it again.

With Citrix PVS you can create several sequencers from one vDisk.  This ensures consistency and avoids tech’s having their own VM with their own nuances.

Citrix PVS allows you to create a version of the vDisk and apply Windows Update’s.  Automatically, all of your sequencers get the updates applied.

With ‘Standard Image’ mode, the VM now becomes ‘non-persistent’.  This means if you reboot your VM it will go back to the state it was when it was last powered on.  PVS requires a ‘persistent’ supplemental disk attached to the VM for things like the event log, page file and the write cache files.  We ensure the supplemental disk is large enough so we can locally store application installer files there (temporarily!) then the installer files go onto a fileshare that has regular backups, etc.

Starting with Citrix PVS 7.1 there is a new feature called ‘Cache to device RAM with overflow on hard disk’.  By utilizing a memory sizing for your sequencer VM that can run the operating system *and* contain the largest application in total megabyte size, your sequencing can go super duper fast!  Sequencing to the operating system drive with this PVS feature will actually write to RAM, which is significantly faster than disk.  This shortens sequencing times significantly.  You will need to ensure your cache size is large enough for your largest application or else the overflow to disk will slow you down.

But won’t this setup fail to work with AppV5’s ‘reboot’ feature?

Starting with AppV5 you can now *reboot* an application in the middle of sequencing and the sequencer is supposed to be pickup after the reboot and continue to capture.  So far, I have not had good luck continuing sequencing after rebooting with the AppV5 sequencer.  I’ve found, with a 100% success rate *so far* that a reboot is not necessary.  I’m aware that applications like Chrome show that a reboot can make a package work successfully, but I prefer to figure out what it does post-reboot and just implement that in the sequence instead.

By avoiding doing reboots we are not missing that feature at all.  In cases where it is absolutely required
I have a workaround.  I create another vDisk version in Maintenance mode

And set my Sequencer VM to Maintenance mode.

This turns the VM to a ‘persistent’ state for this duration.  Once the sequence is completed I delete the version and set my VM back to production.  The caveat here is only one VM may use the maintenance version at a time.

What should I put on my PVS Sequencer?

As per my previous topic, I believe you should try and minimize the visual C++ runtimes that are different from your sequencer to your VDI/XenApp server boxes.  If possible, make them identical.  This prevents AppV5 from usurping installed versions of this runtimes when pushed to your VDI/XenApp servers.  They may still get usurped if an application has a different version installed then what you have on your box, but I strongly believe in minimizing it if possible.  There may also be a (small) benefit by speeding up your application first launch experience by removing some minor registry staging.

Here is what I have on my sequencer and a clipping of some of the software we run on our XenApp servers:

All of the software on the Sequencer

A small clipping of software on the XenApp servers

With the PVS sequencer you have a static, persistent disk that you can use to locally store installer files, notes, AppV template file, whatever you need to help you get sequencing.

A little snapshot of my persistent disk

How do I sequence with this thing?

For my sequences, I usually create a batch file that lets me do a silent install of the application and any shortcut configuration.  I can then use this batch file to do a completely scripted sequence if required in the future.  Otherwise, sequencing is identical to how you would do it previously, but you cannot restart the system!  Restarting will result in a clean sequencer coming back up (after all, that’s the point!)
Read More

AppV5 – Be mindful of application integrations

/ / /

When you sequence an application in AppV5 there are special keys that will be ‘integrated natively’ into your system.  These keys are HKLMSoftwareClasses.  There are numerous things that can be integrated and these include things like File Associations or, even worse, libraries.  I believe a ‘best practice’ should be to make your sequencer and target platform as close as possible by installing the same software on both if you can.  For example, for all the Visual C++ native runtime libraries on your target device have that same software on your sequencer too.  If they differ than the natively installed package will be usurped by a AppV5 package’s deployment.

AppV5 Package has usurped a natively installed control

The differences in the two files
This can cause issues if you are not careful about the deployments of your AppV packages as well as Windows will now natively use some libraries that may have security concerns.  This can also cause some issues if poorly written applications have specific version requirements and if multiple packages are installed with overlapping files/keys, it appears the last loaded package wins.
In one particular example I made an ‘Internet Explorer’ package that changed the registry keys within IE so it would identify itself as IE 6.  Doing this resulted in the http key being changed as well:
This resulted in every programatic launch of a URL to launch iexplore.exe within a different AppV bubble.  This was unexpected as I do Internet Explorer customizations within my packages so that when you launch IE you have the IE customizations for that app all with you.  This one package caused issues as http launches to went into this package as opposed to the package you were in when you launched it.
So, if you have a machine that loads multiple packages, be aware of these potential issues.
Read More

Crystal Reports 13 and AppV 5 have issues

/ / /
Crystal Reports 13 and AppV 5 have issues.  Crystal Reports 13 (CR) installs to some long paths which fail when loaded AppV5 tries to ‘integrate’ them.  A blog detailed shortening the installdir path to something much shorter but CR still failed for me.  My path without modifying the INSTALLDIR property was:
C:\ProgramData\Microsoft\AppV\Client\Integration\14FA6B99-E7E2-4F5A-B7FC-4B024DE1705A\Root\VFS\ProgramFilesX86\SAP BusinessObects\Crystal Reports for .NET Framework 4.0\Common\SAP BusinessObjects Enterprise XI 4.0\win64_x64
224 Characters.
With the modified INSTALLDIR it was:
C:\ProgramData\Microsoft\AppV\Client\Integration\14FA6B99-E7E2-4F5A-B7FC-4B024DE1705A\Root\VFS\ProgramFilesX86\1\Crystal Reports for .NET Framework 4.0\Common\SAP BusinessObjects Enterprise XI 4.0\win64_x64
206 Characters.
This still failed.
The symptoms were errors in the application:


‘The type initializer for ‘CrystalDecisions.CrystalReports.Engine.CRPE’ threw an exception.
Attempting to register the DLL’s related to these resulted in these errors:


[Window Title]
The module “clientdoc.dll” may not compatible with the version of Windows that you’re running. Check if the module is compatible with an x86 (32-bit) or x64 (64-bit) version of regsvr32.exe.
Since AppV5 integrates HKCR keys natively into the system, if you can’t register a DLL via a long path, then you will error with CR.


You can actually replicate a similar error by trying to ‘install’ CR with a long path, so it’s not AppV5 that’s at fault, but apparently something within the CR DLL’s.  Trying to install to a path similar in length to the AppV5 path will fail:


So what is the maximum length CR can be installed to?


259 total characters.  At 260 characters or greater the installer fails with an error similar to the above. I’m not sure why the AppV5 path is significantly less, but it is for some reason.
In the end my path was:
158 Characters.
To do this I needed to modify the SAP Crystal Reports 13 file with a MST transform file.  I did it by doing this:
1   1.
Copy the ScreenTest III installation source files to a temporary folder C:swinst on the sequencing machine (WSAPVSEQ07 – Windows 2008 R2 SP1 in this case).
1   2.
Install Orca.msi
1   3.
Launch Orca and ‘Open’  the Crystal Reports version
1   4.
Choose Transform from the menu > ‘New Transform’
1   5.
Select ‘Directory’ and find the first instance of ‘CrystalR|Crystal Reports for .NET Framework 4.0’
1   6.
Double-click ‘CrystalR|Crystal Reports for .NET Framework 4.0’ and copy the field.  Select the menu ‘Edit’ > ‘Replace’ and set ‘Find what’ as ‘CrystalR|Crystal Reports for .NET Framework 4.0’ and ‘Replace with:’ as ‘CrystalR|C’
And click on ‘Replace All’.  If you get prompted:
Select ‘Yes’.
1   7.
Repeat the process for ‘SAPBusin|SAP BusinessObjects Enterprise XI 4.0’  to ‘SAPBusin|X’
1   8.
Select ‘Registry’ and sort by ‘Value’.  Find the first instance of [INSTALLDIR]
1   9.
Do a ‘Replace’ and enter ‘[INSTALLDIR]Crystal Reports for .NET Framework 4.0CommonSAP BusinessObjects Enterprise XI 4.0’ for ‘Find what’ and ‘Replace with’ as ‘[INSTALLDIR]CCommonX’

And click on ‘Replace All’

1   10.
1   11.
Select the menu ‘Transform’ > ‘Generate Transform’ and save the file as something like:
1   12.
Select the menu ‘Transform’ > ‘Close Transform’ and exit out of Orca.
You can now install SAP CR with a command line similar to this:

Read More