Silently upgrade psychopy from 2.2/2.4 to 2.5?

How do you silently upgrade PsychoPy from 2.2 or 2.4 to 2.5?

If I just run:

start /wait StandalonePsychoPy-2022.2.5-win64.exe /S

It exits with error -1073741819

If I don’t do it silently, it gives me an option to uninstall the old version.

To me the ideal is to make the installer an msi. Since the nsis uninstaller runs “un_a.exe” in the background, problems happen.

I have the same problem with version 2023.1.2:

If the installer is run silent, I get the error -1073741819 back.

If the installer is run in GUI mode (without /S), I get the result 0.

Here’s my current ridiculous upgrade .bat script. Any nsis installer needs this including firefox.

if exist "C:\Program Files\PsychoPy\uninst.exe" (
  start /wait "" "C:\Program Files\PsychoPy\uninst.exe" /S
  powershell "while (! (get-process Un_a -ea 0)) { sleep 1 }; 'waiting'; wait-process Un_a"
)

start /wait %~dp0StandalonePsychoPy-2022.2.5-win64.exe /S

Thanks for the advice. I have now implemented the installation similar in Powershell and lo and behold: Now the silent installation also works without errors:

$file = "StandalonePsychoPy-2023.1.2-win64.exe"
Start-Process $file -ArgumentList '/S' -Wait -NoNewWindow -PassThru

Similarly with the uninstallation: I think if you use the start-process-cmdlet, then it no longer needs the loop:

$file = 'C:\Program Files\PsychoPy\uninst.exe'
Start-Process $file -ArgumentList '/S' -Wait -PassThru

You probably still need the loop. Un_a gets launched in the background during uninstall.

In Powershell: When Start-Process is initiated with -Wait, the loop is no longer necessary.