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 |
 |
Click on Excluded Items Click on New |
 |
Add the path [{Windows}]\Installer |
 |
Click on Ok |
 |
Click on File, Save As Template |
 |
Click on Ok |
 |
Enter a filename and click on Save |
 |
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.
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
|
 |
Import the App-V 5 sequencer module by running the command: Import-Module AppVSequencer
|
 |
See this screenshot for the commands in this module: |
 |
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
|
 |
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
|
 |
Open the folder C:\Apps\
XMLSpy_Professional_2009_SP1_EN_V1
The size of the package is 48 MB. |
 |
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
|
 |
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.
|
 |
Comments are closed