How to check what ThinApp version a package was built with

To check what ThinApp runtime version was used to build a single package you can use a simple command line argument.

MyThinAppPackage.exe -thinstall


While this is good enough to check one or two packages it isn’t very practical if you need to check a whole bunch of packages. Also the -thinstallversion command line parameter isn’t very script friendly either. But no worries the ThinApp SDK and PowerShell come to the rescue. The following script allows us to list the ThinApp runtime version of a specific file or all files in a folder (and subfolders):

[ValidateScript({ Test-Path $_ })]

$ThinApp = New-Object -ComObject ThinApp.Management
$files = Get-ChildItem $Path -Recurse | ForEach-Object {$_.Fullname}

ForEach ($file in $files)
$ThinAppType = $ThinApp.GetThinAppType($file)
$ThinAppType = $null

If (($ThinAppType -lt 6) -and ($ThinAppType -gt 0))
$ThinAppPackage = $ThinApp.OpenPackage($file)
New-Object -TypeName PSObject -Property @{
Name = $ThinAppPackage.InventoryName
Version = $ThinAppPackage.ThinAppVersion
Path = $file

Row 1-7 is used to quiz the user for a path or a file. Then in row 9 the ThinApp com object is created and in row 10 a list of fully qualified file names (even of files in subfolders) based on the user provided path or file is created. In row 14 to 21 the script checks if it can get the ThinApp type of the current file and if not it catches the error. Within lines 23 – 30 if the current file is a valid (1-5) ThinApp package it reads out the InventoryName, file name and path and the ThinApp runtime version and creates a new PowerShell object for it.

In action it looks like this:

In order to use this script you have to register the ThinApp SDK (to learn how to do it visit my “Getting started with ThinApp SDK and PowerShell” article) and then just execute the script in a PowerShell console and provide a folder or file. Here are some examples:

To check the version of a single file:

.\Get-ThinAppVersion.ps1 -Path 'Z:\ThinAppApps\Mozilla Firefox.exe'

To check the version of all files in the provided folder and subfolders:

.\Get-ThinAppVersion.ps1 -Path Z:\ThinAppApps

You can even check files and folders on a network share:

.\Get-ThinAppVersion.ps1 -Path \\server\thinapp

To execute this script your PowerShell execution policy need to be set to “Unrestricted” (or lower) as this script isn’t signed. More information about the PowerShell execution policy can be found via the following link:

As the output is a fully functional PowerShell object you can do some cool stuff. For example you can create a CSV file listing all your ThinApp packages and the corresponding version or filter for a specific runtime version.

To export the results to a CSV use this command:

.\Get-ThinAppVersion.ps1 -Path Z:\ThinAppApps | Export-Csv -Path C:\temp\MyThinAppRuntimeVersions.txt

To only list ThinApp packages which are using a specific runtime version use this command:

.\Get-ThinAppVersion.ps1 -Path Z:\ThinAppApps | Where-Object {$_.Version -eq "4.7.0-556613"}

Download the script using the button below:

One thought on “How to check what ThinApp version a package was built with

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s