Deploy Java Runtime Environment as SCCM application using PSADT

This guide will show you how to deploy Java Runtime Environment (both 32- and 64-bit) via SCCM with user interaction using PSADT. The app will do the following:

  • Prompt user to close Java apps
  • Uninstall previous JRE(s)
  • Install both 32- and 64-bit JRE
  • Disable update notifications

Get the files

Get latest offline executable JRE installers, as well as latest PSADT (3.70 as of writing). Also, get ServiceUI.exe (32-bit) from MDT if your SCCM version is less than 1802.
Copy both installers to the PSADT Files directory. Next, let’s modify Deploy-Application.ps1.

Install Script

Variable declaration
Let’s start by declaring some global variables. Specifically check that $appVersion is current. In general take model of following:

Pre-installation

Pretty straightforward. If user is running java app, allow closing of app, or deferral. Also show installation progress.
As part of the installation, we remove previous versions of Java.

Install

In the install phase, let’s set install parameters to e.g. disable Java auto-updates.
Lastly, for all .exe installers in the Files directory, execute them. This shall install both 32-bit and 64-bit Java.

Post-install

Not much here. If Java was running in the beginning, show a prompt to user to inform of successful update.

Uninstall

Basically copy the pre-install commands, i.e. Show-InstallationWelcome,Show-InstallationProgress and Remove-MSIApplications.

Application in SCCM

For SCCM => 1802:
Create application as you normally do. For deployment type, select Script Installer.
For installation program command, use Deploy-Application.exe.
For uninstallation program command, use Deploy-Application.exe Uninstall.
For User Experience, choose “Whether user logged on or not” and check “Allow users to view and interact”.

For SCCM < 1802:

Create application as you normally do. For deployment type, select Script Installer.
For installation program command, use ServiceUI.exe Deploy-Application.exe.
For uninstallation program command, use ServiceUI.exe Deploy-Application.exe Uninstall.
Lastly, check to run in 32-bit. For User Experience, choose “Whether user logged on or not”.

Detection method

Use the following for detection method, please check that you have correct version declared.

That’s it.

Deploy FileMaker Pro 16 as SCCM application using PSADT

This guide will show you how to create a FileMaker Pro 16 SCCM application with user interaction using PSADT. The app will do the following:

  • Install FM Pro 16 with latest patch.
  • Apply licensing information.
  • Set default remote server.
  • Optionally remove previous FM Pro versions.

Get the files

Get latest FM Pro installer and patch, as well as latest PSADT (3.70 as of writing). Also, get ServiceUI.exe (32-bit) from MDT if your SCCM version is less than 1802.

Run the Installer, but cancel it. The installer will have created a subfolder called “FileMaker Pro 16”. Inside, copy contents of the Files folder into PSADT Files folder.

Next, do the same thing with the latest updater. Copy the .msp file into PSADT Files folder.

Installation script

Fill out the default application variables in the beginning of Deploy-Application.ps1.

Here’s the pre-install step. Mostly self-explanatory but I explain some things.
First, we declare variables. Shared variables (both install and uninstall) are the application name and process name.
For installation, we get currently installed application information. Later on, if previous installation exist, we only need to patch.
Most important is the $addParams variable. Include here your FileMaker license information.
For $FMserver variable, insert address of your FileMaker server. This will later be set as the default server when user opens the app.
Under pre-installation tasks, in this case we remove previous FileMaker Pro 14 installation. Modify as needed.

Next up, install step.

Basically two-liner. If there is no previous installation, perform full install. If there exists previous version, then the patch is all we need.

Post-installation step. Here we declare registry entries, which includes default remote server and skips “getting started”. Then we apply these registry entries to all users. Lastly, display popup for successful installation.

Uninstall step is a one-liner.

Create application in SCCM

Create application as you normally do. For deployment type, select Script Installer.
For installation program command, use ServiceUI.exe Deploy-Application.exe.
For uninstallation program command, use ServiceUI.exe Deploy-Application.exe Uninstall.
Lastly, check to run in 32-bit.

UPDATE: As of SCCM 1802, you no longer need ServiceUI for user interaction, instead, check the box to allow user interaction in the user experience tab. You may also uncheck the 32-bit installation process, to allow native 64-bit.

Detection method

Remember to check correct version.

Deploy
Lastly, you may deploy the app. You may set it to run as whether user is logged on or not.
Remember to test thoroughly before deploying to production.

Updating Lenovo ThinkPad/ThinkCentre BIOS as SCCM application

Updating BIOS is no easy task. You probably have several models with differing BIOS versions. Also, the update requires a restart making it difficult to deploy without interrupting work. In this case, user interaction is recommended if a user happens to be logged on during deployment. This is where PSADT comes in to play.

Goal of this guide is to help you create a repository of Lenovo BIOS updates and automate updates using a single application in SCCM. User interaction is made possible by PSADT.
This repository may also be used during OSD. I’ll show this in an upcoming post.

Disclaimer: This has been tested on L/T/X series ThinkPads for *30-*70 generation. For ThinkCentres we only have M900. So adjust and test accordingly.

Getting latest BIOS
An easy way to get the latest BIOS is to download it from Lenovo. Let’s take a ThinkPad L460 as an example. The URL for downloads is: https://pcsupport.lenovo.com/us/en/products/laptops-and-netbooks/thinkpad-l-series-laptops/thinkpad-l460/downloads. Here you can find the BIOS section. You want to download the BIOS update utility pack. For other models, you can easily modify the URL.

After download, extract the update (run the .exe to extract, but don’t run utility afterwards) to a folder with the model name, in this case a folder named L460. Do this for all your models.

“Database”
Next, create a .txt file called biosversions.txt. Here, create tab delimited headers ‘Model’ and ‘Version’. Then enter all your models and the latest BIOS version you downloaded. As such:

Model Version
L530 2.67
L450 1.25
M900 7FA
X1 Carbon 6th 1.15

Later on, we’ll use this text file in conjunction with our detection method. Here’s a template if you want: biosversions.txt

You may have noticed the differing versioning for ThinkCentre M900. For some reason Lenovo doesn’t use conventional version numbers for ThinkCentre, but instead hexadecimal(?). The complete version number for M900 is FWKT7FA. The FWKT characters are constant, but the three last characters change between versions, and the version is ascending in hexadecimal value if you watch the changelog from previous version.

Folder structure/placement
As mentioned, we’ll use PSADT for this setup.
So, copy all the folders for the models under the PSADT Files folder. Also copy biosversions.txt to the root of the PSADT folder. Finally, get a copy of 32-bit ServiceUI.exe from MDT and place it in the root folder (this allows for user interaction in “Whether user logged on or not” scenario).

Root:

Inside the files folder:

Disregard SCCM-UpdateBIOS.ps1 and ServiceUI64.exe until the next blog post…

Make the contents of the PSADT and subfolder readable and executable for Domain Computers on a server. In our case, we keep it on the SCCM server. We do this so the client doesn’t need to download all BIOS updates. The script will see to it that the client only copies the applicable update. If you want to perform BIOS updates in WinPE during OSD (wait for next post!), you should give read/execute permissions to the Everyone group. Additionally, for anonymous access (WinPE), you need some more tweaking, see this guide: https://vitoriodelage.wordpress.com/2016/04/07/creating-an-anonymous-smb-network-share/

Installation script
Here’s the code for the pre-install phase, i.e. insert the code under pre-install phase in Deploy-Application.ps1.
In a nutshell, check for AC power and show prompt if anyone is logged on.

Here’s for the installation phase (thanks for bug report from /u/davidnait over on reddit):

And lastly, post-install phase. Note that ThinkCentres require a shutdown.

Full Deploy-Application.ps1 here: https://www.dropbox.com/s/nfadi4q4mobembv/Deploy-Application.ps1

Create application in SCCM
Create application as you normally do. For deployment type, select Script Installer.
Leave content empty.
For installation program command, use ServiceUI.exe Deploy-Application.exe in conjunction with Installation start in containing the path to the location of the contents. Lastly, check to run in 32-bit.

Detection method
Next up, detection method. Use custom script of type PowerShell. Remember the temporary registry key from the script? Here we’ll check for it and remove it.
Make sure you have the correct network location for the biosversions.txt file.

Deploy
Lastly, you may deploy the app. You may set it to run as whether user is logged on or not. This will allow automatic updating of BIOS if PC is on, but no user logged on. Wake-on-LAN is to recommend in this scenario.

Remember to test thoroughly before deploying to production.