Hi,
I’ve noticed in PSADT version 3.10.1 that Get-FileVersion with the -ProductVersion parameter will return the version with extra whitespace at the end for the unins000.exe for what looks like software packaged using INNO Setup.
Some examples are:
TreeSize Free 4.7.3 by JAM Software
Reope Toolbox 1.7.3
PyRevit 4.8.13
It looks like the cause of this is the product version set by INNO Setup, so this isn’t actually a bug in Get-FileVersion (or Get-Command, which Get-FileVersion calls) and has been mentioned on their forums already https://groups.google.com/g/innosetup/c/wJZ4RQKsxq8/m/TW27JaR1CQAJ
If you have an affected .exe you can reproduce this with
$aa = Get-FileVersion -File "<path to file>" -ProductVersion
"+$aa+"
$aa = Get-FileVersion -File "C:\Program Files\JAM Software\TreeSize Free\unins000.exe" -ProductVersion
"+$aa+"
[06-18-2024 17:52:38.617] [Execution] [Get-FileVersion] :: Getting version info for file [C:\ProgramData\Reope\Toolbox\unins000.exe].
[06-18-2024 17:52:38.625] [Execution] [Get-FileVersion] :: Product version is [1.7.3 ].
+1.7.3 +
Since it’s returned as a string anyway a possible fix/workaround would be to add this line after line 7240 in AppDeployToolkitMain.ps1
Before
If ($fileVersion) {
If ($ProductVersion) {
After
If ($fileVersion) {
$fileVersion = $fileVersion.Trim()
If ($ProductVersion) {
Looks like a fix has already been made based on your finding, so, subject to testing I guess this fix will find it’s way into a future patch (or full) release