Unattended Sequencing using Templates in App-V 5

In App-V 5 it is possible to sequence applications unattended. Using this feature it is very easy and fast to create a virtual application.
I would not recommend using the unattended sequence feature when sequencing an application for the first time, but it is useful for example when there is already a repackaged MSI available.

In this post I am going to explain how to create an App-V 5 package unattended and how Templates can help to exclude files from your package.

Templates

A new feature of App-V 5 is the use of Templates. This feature is designed to replace the default.sprj file from App-V 4.X. With this file you could save changes to the Options. For example a modification to the exclusions list or an enabled or disabled option.
If you want more information about Templates, I recommend you read this blog post by Rory Monaghan.

I am going to use a Template file to modify the exclusion list so the folder C:\Windows\Installer will not be a part of my unattended created package. This will reduce the size of my package because the MSI file is not cached.

 

Create a Template in App-V 5

 

The first thing I am going to create is a modified template.

 

Start the App-V 5 sequencer  
Click on Tools, Options image
Click on Excluded Items
Click on New
image
Add the path

[{Windows}]\Installer
image
Click on Ok image
Click on File, Save As Template image
Click on Ok image
Enter a filename and  click on Save image
Close the sequencer  

 

 

Test the Template

 

Before I want to use the Template I first want to test it by loading it into the sequencer and verifying the Exclusion list contains the folder [{Windows}]\Installer.

 

Start the App-V 5 sequencer  
Click on File, Load Template image
Select the App-V Template File image
Click Ok image
Click on Tools, Options image
Click on Exclusions Items

Check if the [{Windows}]\Installer folder is in the list

Click on Ok

image
Close the sequencer  

 

Creating a virtual application unattended using the Template

 

Now that the Template is created and verified I can start creating the virtual application unattended.

 

Start PowerShell  
Enable the execution of script by running the command:
Set-ExecutionPolicy Bypass
image
Import the App-V 5 sequencer module by running the command:
Import-Module AppVSequencer
image
See this screenshot for the commands in this module: image
Create a folder C:\MSI and copy the MSI installer into this folder  
Create a .CMD file and edit this file.
Add the unattended command line

For example:

@echo off
ECHO Installation…
msiexec /i C:\MSI\XMLSpyProf2009Sp1.msi /qb
CLS
ECHO Configure the application…
PAUSE

 

The PAUSE at the end, this will give us the option to start and configure the application when it’s installed because the sequencer will not start creating the package before the CMD screen is closed.

Save the file as C:\MSI\Install.cmd

image

In PowerShell execute the following command:

 

New-AppvSequencerPackage -Name XMLSpy_Professional_2009_SP1_EN_V1 -Installer C:\MSI\Install.cmd -PrimaryVirtualApplicationDirectory C:\Apps\XMLSpy_Professional_2009_SP1_EN_V1 -Path C:\vApps -FullLoad -TemplateFilePath C:\Windows_Installer_Excluded.appvt

 

The CMD window will start the MSI installation and the progress is visible.

After the application is installed, the CMD window will wait for the manual configuration to finish. Press a key to close the CMD window.

The sequencer will detect that the CMD window is closed and, after some time (+/- 40 sec), start building the App-V 5 package.

The package is saved in C:\Apps\ XMLSpy_Professional_2009_SP1_EN_V1

image
Open the folder C:\Apps\

XMLSpy_Professional_2009_SP1_EN_V1

The size of the package is 48 MB.

image

 

Comparing a package with and without the Template

 

Now that the Virtual Application is build using the Template, I’m going to create a second application without the template to see how much data I saved by excluding the [{Windows}]\Installer folder.

 

Remove XML Spy from the system  

In PowerShell execute the following command:

 

New-AppvSequencerPackage -Name XMLSpy_Professional_2009_SP1_EN_V2 -Installer C:\MSI\Install.cmd -PrimaryVirtualApplicationDirectory C:\Apps\XMLSpy_Professional_2009_SP1_EN_V2 -Path C:\vApps –FullLoad

note: without the template file and with V2 (version 2)

The CMD window will start the MSI installation and the progress is visible.

After the application is installed, the CMD window will wait for the manual configuration to finish. Press a key to close the CMD window.

The sequencer will detect that the CMD window is closed and, after some time (+/- 40 sec), start building the App-V 5 package.

The package is saved in C:\Apps\ XMLSpy_Professional_2009_SP1_EN_V2

image
Open the folder C:\Apps\

XMLSpy_Professional_2009_SP1_EN_V2

The size of the package is 82 MB.

So by excluding the folder [{Windows}]\Installer it is possible to save a lot of (expense datacenter) disk space.

image
Advertisements
This entry was posted in App-V. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s