What are the Package Accelerators?
Since the beginning of App-V times (or SoftGrid times, to be more precise), we all have had only one method of communicating to others how a specific application is to be virtualized and package is to be built: recipes.
These recipes or “prescriptive guidance” are simply a free-form documentation of how one is to sequence an App-V package using certain steps in various phases of Sequencer’s packaging wizard and post-wizard UI –based customizations. The main problem with recipes comes from their free-form nature and the fact that the person creating a recipe is responsible for remembering all the exact steps and recording them meticulously. Sometimes we forget things we had to do with more complex packages and even if we, the creators of recipes, remember to record everything of note, there’s still a possibility for consumers of our recipes to interpret things differently. Or maybe they have a slightly different version of the original application installer in hand, ending their sequencing effort in failure. And let’s face it, none of us really like to spend lot of time writing down things manually (well, not me anyways)!
To overcome the issue of interpretation-dependent recipes and to ensure App-V packages are consistently built, Microsoft has introduced a nifty new feature in App-V 4.6 SP1 called Package Accelerators. The idea in general is not novel as some of the other app virtualization technologies have similar features, but now with App-V we are also able to record the “essence” of a virtual application and extract out the files – which usually are problematic from an intellectual property and licensing perspective. We can then “transform” a physical application into a virtual version without the normal Sequencer monitoring process. So Package Accelerators are all about automating the sequencing process instead of cranking out each package manually, using some pre-recorded information to accomplish this. Please note that this method of creating virtual applications is not suitable for all situations and all possible applications, but for applications not needing a lot of per-organisation/customer customization it is indeed a fast way to build a package.
In this post, I’ll give an overview of how you too can make Package Accelerators with the App-V 4.6 SP1 Sequencer; be it for storing that for internal organization’s use or, what’s more beneficial for the whole App-V community, for sharing your package with the whole world Be aware that due to nature of Package Accelerators you have to make sure that they do not inadvertently contain any proprietary information you do not wish to disseminate (like internal machine names, user accounts, serial numbers, passwords and so forth) or include any physical assets that you are not allowed to redistribute, such as software components for licensed software.
Preparing for the Package Accelerator creation
Before we create an actual Package Accelerator, we follow normal preparation steps or best practices for App-V sequencing. So make sure your sequencing machine is reverted to a clean state, all the installation media needed is copied locally to the sequencing machine, and there’s no extra processes running in the system. In 4.6 SP1, some of the enhancements Microsoft made to the sequencing process is to check certain technical issues for you, but nevertheless you know the best if there’s some 3rd party software installed that should not be there (like anti-virus or such).
There is one change from the previous guidelines though; as you may have noticed while installing 4.6 SP1 Sequencer, it asked for drive letter for the package drive. What that meant was you no longer need to have that second partition (“Q” drive) physically on the sequencing machine. The Sequencer will take care of creating a “virtual” Q –drive for you by using (very old) technology in Windows which mounts one folder in the [system] drive as separate drive letter. That’s subst usage for 21st century!
In the example, I’m going to create Package Accelerator out of freely available 7-Zip file compressor (http://www.7-zip.org/) so you can follow along in your own machine.
Depending on the intended target machine architecture, download either the 32-bit install package or 64-bit install package from 7-Zip’s website. The version I’m going to use, and which is contained in the completed Package Accelerator linked to this article, is the 32-bit version of 7-Zip 9.20.
Creating a sequence
Since the Package Accelerator is based on an existing sequence, the first order of business is, of course, creating the sequence for the application we intend to base the Accelerator on. Since 4.6 SP1 has introduced significant UI changes to the actual sequencing (although the underlying process is pretty much the same), we are going to walk through the main points in this article as well:
The option to create a new package is now in the main interface, like with the 4.6 RTM version, but the interface has been streamlined still a bit from 4.6. Choose to create a new virtual application package to start the wizard.
In the new sequencing wizard, you now have an option to select between creating a package normally or from the existing Package Accelerator. Since we are going to create an Accelerator, we proceed with the normal route.
Like briefly noted above, the 4.6 SP1 Sequencer will check for some known “problematic” technical aspects of the sequencing machine, one of which are the various default Windows services running on the machine. You can of course proceed without taking any actions on these issues, but doing so may cause unwanted data in the package or some of the services may interfere otherwise with the packaging process. It’s recommended to do as told in the Resolution column (in this case, stopping said services).
After stopping the services, you can press the Refresh button on the screen to allow the Sequencer to notice that you “fixed” the issues:
Yet another new feature in the 4.6 SP1 Sequencer comes in the next screen, where you have to decide what kind of application you are currently sequencing. The selection here will somewhat affect the upcoming steps in the wizard, but it is good to remember that the actual process (monitoring changes in the system etc.) has not been changed. It is just that Sequencer will guide you more than before and tries to help more in some of the steps required to sequence certain type of applications.
In creating the current package in the example, we are going to proceed with the default selection of Standard Application, which is the type for majority of applications you are going to sequence overall.
In the next phase, you have an option to select the path to the installer for your application. This is for scenarios where you have only one installer that does all entire job of getting an application installed and no further steps are needed. With 7-Zip, this is something we can use as running the installer is the only action required.
Now you have to set the name for the new package, something you did as first thing in previous versions of the Sequencer. Unlike the previous App-V versions, the chosen package name will also automatically be suggested as a root directory name for the package … I’m sure at that this point you will say “hold on, what about that 8+3 naming?!”
Well, that is now done for you automatically by the Sequencer through setting that 8+3 name to random name which is not reflective of what the long name (i.e. the package name) happens to be. If you truly want to, you can still override the default with the root name of your own choosing so that option is available too even though it is highly unlikely that random names would ever clash on the client.
If you chose the installer in the previous step instead of opting to go with custom installation, the Sequencer will start your installer in a short while after bringing up the virtual environment for monitoring. Note that there aren’t “Begin Monitoring” / “End monitoring” buttons anymore but monitoring is entered immediately from pressing the Next -button on the package naming screen.
After entering into monitoring mode, what’s very nice to see is that we once again have the possibility of minimizing the Sequencer out of way. This was probably the most annoying design choice when 4.6 originally came out (note that I’m settling for very little :-)) and I’m glad that Microsoft finally agreed on fixing it.
For the purpose of this example packaging – so that we may finally get to the interesting Package Accelerator bits – let’s perform a standard installation of 7-Zip as a VFS sequence.
When the installer has finished, let’s get back to the Sequencer again.
You’ll notice that there is actually a possibility to run other application(s) still but for our purposes let’s finish the installations with “I am finished installing” button which effectively means “I’m going to stop monitoring”. I cannot say I like misusing the checkbox usage model (somebody needs to read Windows User Experience Interaction Guidelines -document) wherein a button would have been more appropriate like in the previous versions, but I guess it’s somewhat more clear for newcomers.. Pressing the Next button after checking the checkbox actually ends the monitoring.
In a deviation from the process of sequencing in previous versions of App-V, the new Sequencer presents the run programs, or launch applications, screen before you actually have chance to customize what applications you intend to publish from the package and the intended behavior is now to make those first-time tasks (or 10 most common actions as we were taught in the past) during this phase rather than during installation monitoring. So start up the main 7-Zip application (no need to start help file) to set some options we want to enable.
From the Tools -> Options menu, make file-type association for all associations known to 7-Zip. In a real situation, you probably would not want to associate all possible extensions as some of them are already handled by Windows Explorer (like for .ZIP) or some other more specialized programs (like for .ISO).
After accepting the changes and closing the 7-Zip program, you can go forward in the Sequencer with Next –button and see a summary report of the installation. Note that in 7-Zip, the Sequencer has correctly identified Explorer shell extensions (not supported by App-V technically) that were installed but could not be included as virtualized. This new summary screen will be of good help in packaging applications that we may not know that much about in advance as it gives overview of things that might not work with virtualized version just like in traditionally installed one.
If you want to customize the package further, you could do so – and I would recommend doing so in the “real world” – but we will take what we have now and save the package in order to start creating a Package Accelerator from it.
Even if you do not select customization, you can enter package comments and select whether or not to compress your package. Note that although it states that compressing is required for packages over 4GB, the resulting compressed package still cannot exceed 4GB size limit.
Creating the Package Accelerator out of sequence
Now that we have our sequencing for 7-Zip done, we can create the Package Accelerator from it. Functionality for doing so is started from the Sequencer’s Tools menu, which has gained few new options.
Selecting the “Create Package Accelerator” option starts a brand new wizard designed to guide you in making Package Accelerators. Very first thing in the wizard is to browse for our App-V package against which the Package Accelerator is created. In my example sequencing, I’ll select the SPRJ file from the location I used for saving the 7-Zip package.
In the next screen you have two choices for specifying the source files required for the package. These source files are basically a location from which the Package Accelerator’s users will get the files from on their sequencing machine, since Package Accelerator does not store (most) of the application files. Otherwise you would not have any difference between the package itself and the Accelerator!
The way a Package Accelerator technically works is that it copies the files from their original location back into generated SFT file according the mapping information in the Accelerator when it is executed under the Sequencer and all the other metadata information like virtual registry etc. are imported from the PA’s CAB file directly.
First option for finding the installation files is to point to the folder containing installer source files for application. This option requires that the source folder contains application files “in plain” in the directory structure. If application files are coming directly from inside a pre-existing installer (typically EXE having files embedded within), that cannot be used as-is since there is not a 1-1 mapping of files available for Sequencer to copy files from. And in our 7-Zip example, that is exactly the case since installer is just one EXE file which self-extracts files as part of an installation process.
A counter-example of installation sources that can be used is if the original setup program has all the files in the directory structure and the installation program merely copies them to correct locations, like with some CD/DVD based installation media. Or alternatively, if you know that the installer can first be extracted to the disk to reveal actual files then that would be suitable source for installation files after manual extraction process (see guidance file –phase later on).
If the installation sources are not available in suitable form, a second option is to point to the default installation directory of an already installed application. This means that you have a pre-existing installation of the application you have in the package in the sequencer machine. Since that is what we have in this 7-Zip example, having installed the package to the sequencer machine during monitoring, we are going to point the wizard to our installation directory. Please note that choosing this option requires that the installation of the application on the local machine needs to be in default location (and in real life you probably want to re-set the Sequencer back to clean state and perform physical installation of application before starting Package Acceleration creation process, just to be sure).
Special note about the situation wherein an App-V package is not a VFS sequence and it’s installed during monitoring to subdirectory under package’s root directory; in this case you have some rather complicated requirements how to specify the path for the Package Acceleration wizard in order for mappings be done correctly, making a VFS sequence to default installation directory is a much easier case for Package Accelerator creation.
After pressing the Next –button, the Sequencer will now figure out all the files in the App-V package and tries to find corresponding ones in the location you specified. If the installation files source for some reason does not contain all the required files, the Sequencer will give a list of missing files and you have the option of going back to re-specify the source. If all goes well, like in our case, the Package Accelerator is created and is ready to be customized.
Next you will be able to customize the contents of the Package Accelerator – file-wise. The Package Accelerator will copy the main files from the installation file sources when the Accelerator is run, but some of the files will be stored inside Package Accelerator – so if you need to remove some of those files that would otherwise go along, you can uncheck the item and the file will not be included in the Package Accelerator. In this example, we will take everything in that is detected by default and besides, one of my rules for cleaning up the sequences has always been, “do not remove anything you are unsure of”.
Going into next screen, you can customize the application information that Sequencer will present to person executing your Package Accelerator. This list is simply metadata information about applications that the packager should first install to the machine before proceeding, so that Package Accelerator is able to find all the correct source files to be included in the SFT file.
The Sequencer will not check for existence of these applications, since Package Accelerator does not store any file paths or anything like that mapping to listed applications. The packager simply needs to acknowledge “I have installed these” to proceed. If you know that application needs some pre-requisite components and such, you should list them here so that the environment matches one you are basing this Accelerator on.
For now, accept the default application that the wizard detected.
The Wizard will now ask for location of a guidance file that gets included in the Accelerator and will be shown to packager executing it. If you need to include any manual instructions related to the application being packaged, or some other information to the users of your Package Accelerator, you can do it via contents put into this guidance file.
The guidance file is simply a text file in Rich Text Format (RTF) or plain text format, and things it could (as an example) include are instructions for preparation steps in sequencer machine (extracting source packages, installing some pre-requisites components like VC++ runtimes etc.), things to customize in the resulting package or basically any contextual information for what needs to or should be delivered to whomever is running the Package Accelerator.
In this example case, we can just create and browse for empty TXT file as the wizard won’t let us proceed without specifying some guidance file. In creating a more “serious” Package Accelerator, I would recommend that you put in at least some basic information about the exact package version installer or maybe an actual URL to it if it’s freely downloadable.
When all of the other steps have been completed, all that is left to do is to save our Package Accelerator to disk. App-V Package Accelerators are stored in the form of a CAB file and in this case we save the resulting CAB to our package’s directory in want of a better place.
As you can see the creation of App-V Package Accelerators – a new feature of the Sequencer 4.6 SP1 – is pretty straightforward at least with the smaller applications. In more complex and bigger applications it could take considerable more time given that you need to virtualize the application first and then make sure that your installed application or source location matches files very accurately. But, in bigger applications the outcome is also much more useful if you need to reproduce the package again from scratch since executing the Package Accelerator is a very foolproof way to produce package “to the spec”.
—
27.04.2011
App-V