We have a software package, lets call it “Nachos” and installing new versions of the software does not uninstall the previous versions.
I can manually create a fixlet or fixlets that will uninstall old versions; but what I want to accomplish is to look at the version numbers in the registry (or on the files themselves) and identify the largest version number and uninstall all of the other versions.
I created an analysis that shows me all of the currently installed versions:
concatenation ", " of ((it as string) of values "DisplayVersion" of keys whose (value "DisplayName" of it as string contains "Nachos") of key "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall" of native registry)
The install folders contain part of the version number. As an example:
C:\Program Files\Nachos\Nachos Application 9.2\Folder\nachos.exe
C:\Program Files\Nachos\Nachos Application 9.8\Folder\nachos.exe
C:\Program Files\Nachos\Nachos Application 10.1\Folder\nachos.exe
Might exist on a machine together.
I’d like to create a fixlet that will look at all of the versions and uninstall any thing that is not the maximum version currently installed.
I can also get the version of file by running the relevance:
versions of files "bin\nachos.exe" of folders of folders "c:\Program Files\Nachos"
I cannot figure out the relevance to show me the maximum of those though. Once I have that, I believe I can do a for each and accomplish the uninstall routines.