I wrote a very basic powershell script to get the latest BPQ beta binaries and DLL from John¡¯s website to help simplify the process of updating. It is not a smart script, its basic but could be the foundation for a more advanced script that does version backups and so forth. However, as I do not run windows myself that is a bit beyond my scope of abilities :-)
Here¡¯s a write-up included for the list, but any corrections will be posted here:
73s Red de PE1RRR
Simple (Windows) Powershell Script to Update?BPQ32
This very VERY basic script was created for a friend to update their Windows 10 install of BPQ32 to the latest beta releases. As beta releases by John G8BPQ don¡¯t have any identifying characteristics other than file server time stamp, the update process is as simple as downloading the latest binaries and zipped DLL from the same locations periodically.
To get this script to work on your system you will be required to enable Powershell scripts in the system settings. Follow the below menu path to locate the section containing the security override.?
Start Menu -> PC Settings -> Updates & Security -> Developer Options -> Scroll down to Powershell section.
Check the box next to ¡±Change execution policy to allow local Powershell scripts to run¡± and click Apply.
To create the script, find and run from the start menu:
powershell_ise
Clear-Host
# Edit paths below to suit your system
# Please note that the Upgrade folder is emptied on each script run.
$BpqUpgradeFolder = "D:\BPQ32\UPGRADE"
$BpqMainFolder = "D:\BPQ32"
Write-Host "Updating BPQ DLL and EXE files, please make sure BPQ is shut down first..."
pause
New-Item -ItemType Directory -Force -Path "$BpqUpgradeFolder"
Get-ChildItem -Path $BpqUpgradeFolder -File -Recurse | Remove-Item
Invoke-WebRequest -Uri "https://www.cantab.net/users/john.wiseman/Downloads/Beta/bpq32.zip" -OutFile "$BpqUpgradeFolder\bpq32.zip"
Invoke-WebRequest -Uri "https://www.cantab.net/users/john.wiseman/Downloads/Beta/BPQChat.exe" -OutFile "$BpqUpgradeFolder\BPQChat.exe"
Invoke-WebRequest -Uri "https://www.cantab.net/users/john.wiseman/Downloads/Beta/BPQMail.exe" -OutFile "$BpqUpgradeFolder\BPQMail.exe"
Expand-Archive -Path "$BpqUpgradeFolder\bpq32.zip" -DestinationPath "$BpqUpgradeFolder" -Force
ForEach($file in Get-Childitem $BpqUpgradeFolder -Recurse -ErrorAction SilentlyContinue `
| Where-Object {$_.Extension -Match "dll" -or $_.Extension -Match "pdb" -or $_.Extension -Match "exe"} )
{
Write-Host "Copying file: $file"
Copy-Item -Path $file.fullname -Destination $BpqMainFolder -force
}
Write-Host "Update Complete"
pause
Copy the contents of the script into the upper part of the PowerShell editor,?
Then edit the following lines to match your system:
The ¡±BpqUpgradeFolder¡± folder mentioned above is a temporary directory created each time the script is run where the zip file and executables are then downloaded to, the entire directory is erased each time the script is executed, so be sure not to set this incorrectly as you may lose files.
After setting the paths appropriately, use the?File?menu to save the script into an appropriate location.
Before testing, shut down your BPQ32 application, test the script by using the green Play button in the PowerShell editor. It is necessary to shut down BPQ before running the script from wherever you saved it to.