An app layer is a software image or virtual disk. The app layer includes one or more applications that you can deploy in any number of layered images. When publishing a layered image, you can combine an App layer with:
To create an App layer, you start the Create Layer wizard, deploy a packaging machine in your environment, install one or more applications, and finalize the layer.
A packaging machine is a virtual machine on which you install the application(s) to include in the layer. The App Layering software creates the packaging machine in the location and with the credentials you supply when selecting the Hyper-V connector configuration.
In the process of creating an App layer, if you don't have the connector configuration you need, you can add a new Hyper-V connector configuration and then select it.
Create your OS layer. You need an OS layer for your app layers. The application(s) you install must be compatible with your OS layer.
Before you create an app layer, you can also create resources that assist with installing the application. These resources are for temporary use during installation only and are not used to deliver the application.
If the application you install affects boot-level components, restart the packaging machine as part of finalizing the layer or version.
Prerequisite layers provide a process to include existing application layers on the packaging disk when creating or adding a version to an application layer. Use prerequisite layers only if they are required. The prerequisite applications can possibly add something into the layer that is not required for deploying the current application. This behavior can cause conflict in the future. Prerequisite layers can be required for several reasons:
Some of these issues can also be handled by putting the two applications in the same layer rather than using prerequisite layers.
You can include a Run Once script in an app layer. The script runs the first time any layered image that includes the app layer starts. If the app layer is elastically layered, the Run Once script runs when mounting the app layer disk. Run Once scripts are typically used for apps, such as MS Office, that requires activating the license when Office starts for the first time.
Select Layers > App Layers and then click Create Layer in the Action bar. The Create Layer wizard opens.
On the OS Layer tab, select the OS Layer you want to associate with this app layer.
On the Prerequisite Layers tab, click the Include Prerequisite Layers check box, and then choose the necessary app layers. Use this option if the application you are layering requires other App Layers to be present during installation.
On the Connector tab, choose a Hyper-V Connector Configuration that specifies where in your Hyper-V environment to package the layer. If the configuration you need isn't in the list, click New, select Hyper-V, and click Add a Configuration.
On the Packaging Disk tab, type a file name for the Packaging Disk, and choose the disk format. This disk is used for the packaging machine, the virtual machine where you install the application.
On the Icon Assignment tab, choose an icon to assign to the layer. This icon represents the layer in the Layers Module.
On the Confirm and Complete tab, review the details of the app layer and then click Create Layer. You can type an optional comment before creating the layer. Your comments appear in the Information view Audit History. After creating the packaging disk, the Task bar displays a link to the packaging disk in Hyper-V. You use this link to deploy the packaging machine.
Expand the Tasks bar at the bottom of the UI, and double-click the Packaging Disk task. The task expands to show the full task description,. This includes a link to the location in Hyper-V where the packaging machine for this layer is published.
Next, you can deploy the packaging machine for your layer.
A link to the packaging machine is included In the Create Layer task description.
This section explains how to install your applications on the packaging machine you created in Hyper-V. The state of the app before you finalize the layer is what users experience when they access the app.
Remote log into the packaging machine you created in Hyper-V. Be sure to log in by using the User account you used to create the OS in Hyper-V.
Install the applications, along with any drivers, boot-level applications, or files that users need.
If an application installation requires a system restart, restart the app manually. The packaging machine does not restart apps automatically.
Make sure the packaging machine is in the state you want it to be for the user:
Next, shut down the packaging machine and verify that the layer is ready to finalize.
After installing the application on the packaging machine, verify that the layer is ready to be finalized. To be ready for finalization, complete any required post-installation processing. For example, a restart might be required, or a Microsoft NGen process may need to complete.
To verify that all processes are complete, you can run the Shutdown For Finalize tool. The icon appears on the desktop of the packaging machine.
To use the Shutdown For Finalize tool
The layer is now ready to finalize.
Layer integrity messages show the queued tasks that must finish before finalizing a layer.
Address the following conditions before finalizing a new layer or version:
If a Microsoft NGen operation is in progress, you can expedite it, as described in the next section.
NGen is the Microsoft Native Image Generator and is part of the .NET system. NGen recompiles the .NET byte code into native images and constructs the registry entries to manage them. Windows decides when to run NGen. It runs based on what the installation is and what Windows detects in the configuration. When NGen is running, you must let it complete. An interrupted NGen operation can leave you with a non-functioning .NET assembly
or other problems in the .NET system.
You have the choice of waiting for the NGen to complete in the background, or you can force the NGen to the foreground. You can also check the status of the NGen operation. However, every time you check the queue status, you are creating foreground activity, which can cause the background processing to pause temporarily.
Forcing the NGen to the foreground allows you to view the progress and when the output is complete, you can finalize the layer.
To force an NGen operation to the foreground
Open a command prompt as an administrator.
Go to the Microsoft .NET Framework directory for the version currently in use. At the command prompt, type:
Enter the NGen command to run the queued items:
ngen update /force
The NGen task comes to the foreground in the command-line window and lists the assemblies being compiled.
You might see several messages that the compilation failed. You can ignore the messages.
Look in the Task Manager to see if an instance of MSCORSVW.EXE is running. If it is, you must allow it to complete. If it doesn't complete, run the force command again. Do not restart to stop the task.
To check the status of an NGen operation
Now that the Layer has been verified and shut down, it is ready to finalize.
Return to the management console.
Select Layers > App Layers and then the layer you just prepared.
Click Finalize on the Action bar.
The Finalize wizard appears.
(Optional) On the Script Path wizard tab, enter the path to the Run Once Script on a server in your network.
Click Finalize to finish creating the layer.
Monitor the task bar to verify that the action completes successfully and that the layer is ready to deploy.