Login AM Tutorials Create And Deploy Package
This tutorial will show you how to create a package for PowerGUI and how to deploy this package on a computer.
Create the PowerGUI package
Assuming that you already created the environment, we can start creating the PowerGUI package.
- Select Packages from the navigation panel (left)
- Click New Category in the actions panel (right)
- Enter a name for the package category. E.g. Admin apps and press the Add button
- Select the category we just created from the navigation panel (left)
- Click New Package in the actions panel (right)
- Provide a name for the package. e.g. PowerGUI and click the Add button.
- Select the package we just created from the navigation panel (left)
Download the PowerGUI MSI
Download the PowerGUI MSI to the media path (Installdir\Media\PowerGUI)
Set the software media path and install location properties
Now that we have created a package, we should tell Login AM where to find the source files and what the target folder for the installation is.
- Make sure you have selected the PowerGUI package.
- Select the General Settings tab from the tab bar
- Check the override checkbox next to software media path and set the location to %AM_Files%\media\PowerGUI
- Check the override checkbox next to software install location and set the location to %programfiles%\%am_pkg_name%
Note: We will use these properties (%am_pkg_installdir% and %am_pkg_media%) to make our MSI Install action item more variable, thus making it easier to re-use this package in a different environment.
Important: Using %% makes Login AM expand the contents as an environment variable. If you use <> instead of %%, AM will only translate <> to %% and won’t expand the variable as required.
Enable Deployment plugin
By default, all plugins are disabled for new packages. If we want to enable a specific plugin, we do the following:
- Click the View/Hide plugins button in the tab control
- Select the Deployment tab
- Check the override box for execute deployment actions and set the value to True
- Click the Save button to save the setting
- Click the View/Hide plugin button again to hide disabled plugins from the tab control
Create the MSI Install action item
Now that we have set the software media path and software install location we can use these properties in the Install MSI action item.
- Select Deployment > Actions from the tab controls
- Click the Add button to Add a new Action Set
- Give the action set the name Install PowerGUI and press the save button
- Click Add>MSI Install
- Specify the path to the MSI file (%am_pkg_media%\Powergui.msi)
- Specify the MSI properties (PF_POWERGUI=”%AM_PKG_INSTALLDIR%”)
Note: You are not required to use the AM_PKG_INSTALLDIR and AM_PKG_MEDIA environment variables in the action items, but we highly recommend it, so that packages are easily exportable/re-usable in a different environment.
Now that the package is done, we need to add the package to a layer and add the layer to a collection.
Deploying the package on a computer
To deploy the package on a computer, make sure the package is added to a layer, and that layer is added to a collection where the computer is a member of. Make sure that the computer was initialized.
Note: Make sure the deployment plugin is enabled for the collection where the computer belongs to.
To deploy the package on the computer, we first need to update the cache on this computer, so the run time knows it needs to process this package on this computer. We do this by starting PowerShell on the computer and typing:
Import-Module AMClient Update-AMCache
Now that the cache is updated, we can start the startup event, which will process the deployment.
Invoke-AMEvent -Name Startup
The runtime should start installing powerGUI and will initiate a reboot after it's done (depending on if you have enabled the reboot after deployment setting for the collection)