Powershell script to update SIMS & FMS

18th February 2014

SIMS is a large application made by Capita that the schools are forced to use by the LEA, one of its many features is that it installs its own updates on launch (in theory) but over the years I’ve had no end of problems with it either not updating or failing to update properly so I started looking into scripting it.

There is an EXE called SIMSLoad.exe that when run does nothing but install updates! Even on machines that have failed or just never decided to update. My first idea was to use this EXE to trigger updates, maybe by adding it as a startup script but I couldn’t get it to run silently.

Next came the idea to copy its functionality which at a very basic level is to check the SIMS\Setups Directory for the installer versions and compare them to the versions SIMSLoad.ini says are installed on this machine. If there are any differences it installs the version from the server.

This is the script I came up with:

1$SimsInstall = "C:\Program Files (x86)\SIMS\Sims .net"
2$FMSInstall = "C:\Program Files (x86)\SIMS\FMSSQL"
4if(Test-Path $SimsInstall){
5 Get-Content ($SimsInstall + "\SimsLoad.ini") | ForEach {
6 $application, $version = $_.Split("=")
8 if(!($application -Match "Last")){
9 $current_version = [System.Diagnostics.FileVersionInfo]::GetVersionInfo($SimsPath + "\Setups\" + $application + ".exe").FileVersion
10 if($current_version.compareTo($version)){
11 $install = $SimsPath + "\Setups\" + $application + '.exe'
12 & $install '{QuietMode} [SIMSDotNetDirectory]="' + $SimsInstall + '"'
13 }
14 }
15 }
18if(Test-Path $FMSInstall){
19 Get-Content ($FMSInstall + "\FMSLoad.ini") | ForEach {
20 $application, $version = $_.Split("=")
22 if(!($application -Match "Last")){
23 $current_version = [System.Diagnostics.FileVersionInfo]::GetVersionInfo($SimsPath + "\Setups\FMS\" + $application + ".exe").FileVersion
24 if($current_version.compareTo($version)){
25 $install = $SimsPath + "\Setups\FMS\" + $application + '.exe'
26 & $install '{QuietMode}'
27 }
28 }
29 }
Language powershell

So what does this script do? For SIMSLoad.ini and FMSLoad.ini it runs through all the applications listed in the file discarding any that contain "last" to ignore the check dates and then gets the current version from the EXE on the server. If the versions do not match (assuming that the only cause for this is that the server has been updated and this client hasn’t) it then runs that applications installer silently.

This script does require a permissions change on your SIMS share due to it being run on startup as SYSTEM. Firstly add all the machines with SIMS or FMS on to a security group in AD (I called mine SIMS Machines) then give SYSTEM and SIMS Machines read access to the shared area.

A Disclaimer

This script subverts SIMS normal updater and although it works fine for me you will need to perform significant testing before you roll it out to end users machines.

You can fake the need for a SIMS update by lowering the version numbers in SIMSLoad.ini and I urge you to mess around with this as much as possible before you make the final decision about using this script.

By using this script you agree that any damage caused to your SIMS is your fault, I can’t predict how it will effect updates years down the line.

I will happily respond to queries about this script and any suggestions for improvements will be taken seriously.