Hey James, if i understand this right, the initial exe is like a compressed zip file, which automatically expands to a folder when you run it, before the dialogue prompts for installation begin? Also not sure how you would resume an installation of a program when the process is already running?
Code wise, for killing the process, your function would consist of something like this :
$downloadedVersion = (Get-Command "C:\data\Downloads\ProgramExecutable.exe").FileVersionInfo.Fileversion
$currentVersion = (Get-Command "C:\Program Files (x86)\Microsoft Corporation\Microsoft Script Browser\ProgramExecutable").FileVersionInfo.Fileversion
If ($downloadedVersion -eq $currentVersion)
Get-Process -Name 'processname' | Stop-Process -Force
For the auto download you refer to, I guess you will have options of performing the download via a scheduled task, or a new registered event using a timer. A scheduled task has the advantage that you dont need to have an active powershell session open to perform the task.
I’m not sure if thats what you mean though. Can you be a bit more specific?