In the first part of this article I discussed setting up the environment requirements for creating layers, and talked about our new package creation tool Wise Virtual Composer. In this part of the article we are going to dig into the actual tips and tricks of creating packages.
- Use CMD.EXE as the Primary Application to Capture
- Packaging Applications that have Dependencies
- Packaging Applications that Require a Reboot
- Disabling Advertised Shortcuts for Windows Installer Packages
- Applications That Install Drivers
Special Packaging Considerations
Use CMD.EXE as the Primary Application to Capture Applications
One of the best tips I can give is to use %SystemRoot%\System32\Cmd.exe as your primary capture application. This will open command prompt. You can the navigate to your installer, or run MSIEXEC.EXE from the command prompt with the appropriate command line options to install your application.
The real benefit of using CMD.EXE as the primary capture is that you then have the ability to customize the application before terminating the capture process. The example that I give customers is the capture of Java. I run the installer then navigate to %SystemRoot%\System32 and run the Java control panel applet (jpicpl32.cpl for some of the later versions) to turn off updates. Once you have made all of the changes you require to the application, you just type exit at the command prompt and the capture will be complete.
Using CMD.EXE also allows you to chain applications if that is required. You would just run each application in sequence from the command prompt and exit the command prompt when you have completed the final installation.
Packaging Applications that Require a Reboot
The addition of Wise Virtual Composer has not changed the fact that Workspace Virtualization still does not use snapshot technology for application capture, which means that the capture will end as soon as the machine starts the reboot process.
It is important to note the reasons that application installations require reboots. There are three primary reasons that applications require reboots.
- The installation is attempting to overwrite an in use file.
- The installation has installed a service or driver that will be started when the machine is rebooted.
- The application has added information to the registry that will fire off a post installation configuration process.
Due to the redirection of the files by the Workspace Virtualization filter driver, there is no chance that an installation would ever attempt to overwrite an in-use file, so that installation would never require a reboot.
Installation will often require a reboot to insure that any new drivers or services that it added are recognized by the system. During the layer creation process drivers and services will be captured into the Workspace Virtualization layer. Workspace Virtualization attempts to start all services and drivers upon machine startup if the layer has been set to Start Layer Automatically (which if you have used the Wise Virtual Composer will be set by the default template). These applications will have their drivers and services started correctly and will not need any special consideration during the layer creation and packaging process. (Workspace Virtualization spins up services, etc. during activation even if the layer is not set to start automatically.)
The one area where special consideration need to be taken into account when creating Workspace Virtualization packages are application that create registry entries or Startup Menu options that perform post installation configuration steps. Search the following areas of the layer for any information that was added by the installation:
- %SystemDrive%\Documents and Settings\USERPROFILE\Start Menu\Programs\Startup - XP
- %SystemDrive%\Documents and Settings\ALL USERS\Start Menu\Programs\Startup - XP
- %APPDATA%\Microsoft\Windows\Start Menu\Programs\StartUp - Windows 7
- %ALLUSERSPROFILE%\Microsoft\Windows\Start Menu\Programs\StartUp - Windows 7
If there are entries in these locations make note of what they command are. This is another reason to use CMD.EXE as the primary capture application. If you find an entry in any of the above values, you can copy the command and run it from the command prompt, prior to exiting the capture.
Packaging Applications that have Dependencies
A good follow-up topic to using CMD.EXE is applications that have dependencies. One way you could capture the dependency and the application in the same layer. An example being the .NET Framework and an application that requires the .NET Framework.
There may be times where you want to separate the application from the dependency. In this case the packaging process will take a couple of extra steps. The first step will be to capture the dependency into a layer. Because you don't want the dependency to be part of the layer you will then revert the machine to your clean snapshot.
You will then need to physically install the dependency on the machine prior to running the capture process for the application. Workspace Virtualization does not allow for the capture of an application while another virtual layer is active.
Once you have capture the application, you should import the dependent layer created in first step and set the dependency using the SWV Admin tool prior to compiling the package.
Disabling Advertised Shortcuts for Windows Installer Packages
Advertised shortcuts are the shortcuts that cause the Windows Installer service to confirm that all of the key path components are correctly installed and if they are not, it will attempt to reinstall the components from the source installation. It is a best practice to install all of the features and components that the Workspace Virtualization layer may need during execution. While the Windows Installer repair functionality works with Workspace Virtualization it is written to the writeable sublayer and will be removed if the layer is ever reset.
To disable advertised shortcuts use the DISABLEADVTSHORTCUTS=1 command as a parameter in the MSIEXEC command line.
Applications That Install Drivers
This section highlights one of the great new feature that was released as part of Workspace Virtualization 6.1, the ability to capture drivers without using Global Capture. Jordan Sanderson has written a great article about the concept of virtualizing a printer driver, and Mike Hurst has written a great article about the actual implementation of capturing a printer driver. Once you understand the concept handling process that are running when the capture starts, you will be able to capture a number of drivers.
We are constantly striving to make the packaging process. This document covers some of the new features that have been added to the Workspace Virtualization product.