Deploying ThinInstaller With A Custom Repository Path Using Intune

This walk-through is a follow up to Hosting an Update Retriever Repository in an Azure Blob.

In this post, we're going to:
  • Deploy the latest version of Thin Installer as a Win32 App
  • Set custom Repository and Log paths in the Configuration File
  • Define a sample Scheduled Task to launch Thin Installer and check for updates
What you'll need:
  • Current version of Thin Installer - Link
  • Win32 Content Prep Tool - Link
  • PowerShell Sample Script below
Make sure to replace the repoPath variable with your Blob Storage path.

$pkg           = "lenovothininstaller1.3.0007-2019-04-25.exe"
$installSwitch = "/VERYSILENT /SUPPRESSMSGBOXES /NORESTART"

# Install ThinInstaller
Start-Process ".\$pkg" -ArgumentList $installSwitch -Wait

# Identify Configuration File and Repository/Log Paths
$configFile = [xml](Get-Content "${Env:ProgramFiles(x86)}\Lenovo\ThinInstaller\ThinInstaller.exe.configuration")
$repoPath   = "https://yourblobstoragepath"
# Change Log location if desired
$logPath    = "${Env:ProgramFiles(x86)}\Lenovo\ThinInstaller\Logs"

if ($configFile.configuration.RepositoryPath -ne $repoPath) {
    # Setting Repository Path
    $configFile.configuration.RepositoryPath = $repoPath
    # Setting Log Path
    $configFile.configuration.LogPath = $logPath
    # Saving the Config file
    $configFile.Save("${Env:ProgramFiles(x86)}\Lenovo\ThinInstaller\ThinInstaller.exe.configuration")
}

# Create Scheduled Task to Run ThinInstaller
$ti                = "${Env:ProgramFiles(x86)}\Lenovo\ThinInstaller\ThinInstaller.exe"

# Specify reboot type packages to search for and install
$arg               = "/CM -search A -action INSTALL -noicon -includerebootpackages 3 -noreboot"
$taskAction        = New-ScheduledTaskAction -Execute $ti -Argument $arg
$taskTrigger       = New-ScheduledTaskTrigger -AtStartup
$taskUserPrincipal = New-ScheduledTaskPrincipal -UserId 'SYSTEM'
$taskSettings      = New-ScheduledTaskSettingsSet -Compatibility Win8
$task              = New-ScheduledTask -Action $taskAction -Principal $taskUserPrincipal -Trigger $taskTrigger -Settings $taskSettings
Register-ScheduledTask -TaskName 'Run ThinInstaller' -InputObject $task -Force
 

Preparing the Content
Create a folder that will contain the ThinInstaller executable and PowerShell script.  


Launch an Admin command prompt, change location to where the content prep tool was downloaded to and run IntuneWinAppUtil.exe 

Specify the source folder - This is where the script and ThinInstaller reside
Specify the setup file - This will be the script itself, not the executable.  Enter Install-ThinInstaller.ps1
Specify the output folder - Where the converted app will be output to.  This can be the same as the source folder

When the tool completes the conversion you should see the IntuneWin package that will be uploaded to the Intune console.



 Upload/Configure the App
Login to https://devicemanagement.portal.azure.com and navigate to Client Apps > Apps > Add > Windows app (Win32) 

App Package File: Select the Install-ThinInstaller.intunewin app package file you created with the Content Prep Tool.

App information: Fill out the required app information and any other fields as desired.

Program
Install command

powershell.exe -executionpolicy bypass .\Install-ThinInstaller.ps1

 Uninstall command (this really isn't needed but something has to be entered)

cmd.exe /c rd "%PROGRAMFILES(x86)%\ThinInstaller" /Q/S 




Requirements: Set requirements as needed.  

 
Detection Rules: This rule will check if the the ThinInstaller folder exists.  A default install of ThinInstaller drops this under Program Files (x86) so we'll set that here


Once all information has been entered and saved, the app will be uploaded to your tenant and is ready to be assigned to a group.


Client Side Experience
 Open the Company Portal on a client and make sure the app is now available and ready for install







Click Install.  You can monitor the installation with the following log

C:\ProgramData\Microsoft\IntuneManagementExtension\Logs\IntuneManagementExtension.log

The Company Portal should now reflect a successful installation




If you navigate to C:\Program Files(X86), you should now see the ThinInstaller directory.  Now check the ThinInstaller.exe.configuration file and open it with Notepad to verify the Repository and Log Paths have been set





Open up Task Scheduler and confirm the new Scheduled Task has been created






Now your clients are configured to install updates hosted in your Azure Blob Storage!