SE Articles From the Field
General Setup - FlexApp Packaging Automation and Chocolatey:
- Flexapp Package Automation Primary server installation
- Install Chocolatey
- Create DefaultsJSON file with passwords and default settings.
https://docs.liquidware.com/ProfileUnity/en-us/common/flexapp-packaging-automation/available-packaging-job-parameters.htm- Edit the following lines in the DefaultsJSON file (note slashes are doubled in JSON files)
- "Path": \\\\server\\FlexApps
- Defines path to where the FlexApp .vhdx will be stored
- "DontCreateFlexAppOne": "True",
- Optional** Setting to True will not create FlexApp One executable
- "DontCaptureUserProfileData": "True",
- Optional** Setting to True will not capture the user profile information (not needed for most apps)
- Flexapp Package Automation Agent Nodes installed, optimized and frameworks installed.
- Install Chocolatey
- Set on all systems
- choco feature enable -n allowGlobalConfirmation
- choco feature enable -n usePackageExitCodes
- Download the latest scripts and templates from site.
- UpdateBatchWchocolatey.X.X.psm1
- UpdateConfigFlexapps.X.X.psm1
- MakeSecurePasswordfile-AES.ps1
- catalogTemplate.csv
Setting Up Scripts:
- Creating secure password (password is used to login to the ProfileUnity server)
- Run MakeSecurePasswordfile-AES.ps1 and follow prompts
- May need to set the execution policy to bypass (Set-Execution bypass)
- Script will create the password.txt and ASEKey.txt files
- Both files can be stored in the same or different locations
- Run MakeSecurePasswordfile-AES.ps1 and follow prompts
- Open UpdateBatchWchocolatey.X.X.X.psm1
- Edit the following lines.
- [string]$global:servername= "ProfileUnityServer"
- $user = "ProfileUnity Admin account"
- $passwordFileLocation = "C:\FPA \Automation\password.txt"
- $AESKeyFilePath = "C:\FPA\aeskey.txt"
- Edit to point to ProfileUnity server, set account used for ProfileUnity and the path(s) to the password and ASE files
- Edit the following lines.
- Open UpdateConfigFlexapps.X.X.X.psm1
- Edit the following lines.
- [string]$global:servername= "ProfileUnityServer"
- $user = "ProfileUnity Admin account"
- $passwordFileLocation = "C:\FPA \Automation\password.txt"
- $AESKeyFilePath = "C:\FPA\aeskey.txt"
- Edit to point to ProfileUnity server, set account used for ProfileUnity and the path(s) to the password and ASE files
- Edit the following lines.
Setting Up Templates:
- Edit catalogTemplate.csv (done easiest in Xxcel)
- There are five items to edit
- Name
- Name of the Chocolaty package Ex (NotePadPlusPlus.install)
- Can find the proper names on the Chocolaty site (https://community.Chocolatey.org/packages)
- FilterName
- Optional** will match with the ProfileUnity filter assigned to the app (if one is assigned). Leave blank for all users
- Size
- FlexApp format size for the .vhdx, (note this is a dynamic disk)
- Common default setting. (20480 aka 20GB)
- Installer
- Installer exe or command to be used to install software package. For Chocolatey the default is (C:\windows\system32\cmd.exe)
- InstallerArgs
- Arguments to be used with the launching exe to install software. Chocolatey default (/c choco install APPNAME --silent –force)
- Some application might require the addition of
- --ignore-checksums --ignore-package-exit-codes
Example:
- --ignore-checksums --ignore-package-exit-codes
- Name
Using PSM1 Script and Template In Tandem:
- Import PSM1 template with the command: Import-Module "C:\AutoChoco\ UpdateBatchWchocolatey.X.X.X.psm1"
- May need to set the execution policy to unrestircted (Set-Execution unrestricted)
- Run command to initiate the application update process: update-FPABatchJob -jobfile "C:\FPA\catalog.csv" -Defaultfile "C:\FPA\Defauls.json" -server https://FPAPrimaryServer:9075
- Command combines catalog.cvs, Defaults.json, and the connection to the FlexApp Packaging Automation Primary server
- Command will look at the inventory on the ProfileUnity server, and compare the name and version tag in the inventory against the Chocolaty repository version for the corresponding application name
- If application name/version is the same for both it will skip the application
- If the application name/version is newer in Chocolatey it will add that application into the batch for processing.
Using UpdateDIAScript to Update Applications Within Configurations
- Import the PSM1 template with the following command: Import-Module "C:\AutoChoco\ UpdateConfigFlexapps.X.X.X.psm1"
- May need to set the execution policy to unrestircted (Set-Execution unrestricted)
- Run command to initiate the configuration update process: update-ConfigFlexapps -jobfile "C:\FPA\catalog.csv" -configname "CONFIGNAME" -servername "PROuSERVER"
- Command combines catalog.cvs, the ProfileUnity config, and the connection to the ProfileUnity server.
- Command will look at the ProfileUnity inventory on the ProfileUnity server, and compare the name and version tag in the “configuration” (FlexApp module) for the corresponding application name
- If the application name/version is the same in both it will skip the application
- If the application name/version is newer in ProfileUnity inventory it will swap that FlexApp out for the latest version
- Note this is only supported where there is one FlexApp packaged assigned per FlexApp rule (possible future enhancement will allow for multiple applications in one rule)
- Once the applications are swapped out the configuration with save with no prompt (will then have to manually deploy the configuration out from the ProfileUnity console)
Additional Notes
- Default naming and version tagging comes from the Chocolatey repository
- The scripts currently only support 6.8.5+ (if running an older version of ProfileUnity you will need to upgrade.
- Names of applications can be found on the Chocolatey site
- Versions of applications will be in a X.X.X.X format and automatically created from the Chocolatey repository version tag
- If currently using previously created Flexapp with no version tag, it will be assumed that the application is older and will automatically create a new application with the proper version tagging (also applicable in the configuration swap process in the FlexApp module
Remove .txt from .ps1 and .psm1 files for use.