Blue Iris Update Manager

User avatar
reddawg
Posts: 145
Joined: Sun Jun 30, 2019 11:29 am

Blue Iris Update Manager

Post by reddawg »

What is Blue Iris Update Manager
=========================================
Blue Iris Update Manager is a collection of batch file utilities that builds an archive of Blue Iris update files and backups of Blue Iris settings. The purpose of these utilities is to provide a way to rollback your current version of Blue Iris 5 to an earlier version in the event you encountered a problem. This is accomplished by the Windows Task Scheduler that runs two scheduled tasks upon logon or startup that repeats every 12 hours.

Archive Blue Iris Updates
-------------------------------
The batch file ArchiveBI5.cmd builds an archive of update files that Blue Iris has downloaded and installed so they contain the version of the Update and the bit architecture. When Blue Iris downloads a new update, it stores the update in C:\ProgramData\Blue Iris\temp. In the past, updates were stored in the Blue Iris program folder like C:\Program Files\Blue Iris 5. This utility can be run manually or can be run as a scheduled task by the Windows' Task Scheduler. The archived updates of Blue Iris's are renamed so they contain the version and bit architecture like 'Update_v5.2.0.1_x64.exe' and are stored in the folder %USERPROFILE%\AppData\Local\Blue Iris\Archives like C:\Users\RedDawg\AppData\Local\Blue Iris\Archives.

Backup Blue Iris Settings
-------------------------------
The batch file BackupBI5v2.cmd creates a backup of Blue Iris 5 settings stored in the registry using RegEdit.exe and save it in a compressed ZIP format to include the version and bit architecture as part of the filename like 'BlueIris_v5.2.0.1_x64.zip'. In order to run this batch file, you need to right click on it and select "Run as Administrator". To run BackupBI5v2.cmd as a scheduled task using Windows Task Scheduler so it does not prompt you for UAC, make sure you configure the task with "Run with highest privileges" and "Run whether user is logged on or not" options selected.

Restore Blue Iris to earlier version
------------------------------------------
The batch file RestoreBI5.cmd provides a user interface (UI) for displaying all archived Blue Iris update files from the folder %USERPROFILE%\AppData\Local\Blue Iris\Archives. It allows you to select a previous update and restore Blue Iris to a previous or different version. In order to run this batch file, you need to right click on it and select "Run as Administrator".


REQUIREMENTS
=============
+ WMI / WMIC must be installed. WMI is installed by default on Windows 10
+ PowerShell. Powershell is installed by default on Windows 10

Compatibility
============
+ Windows 10


DOWNLOADS
===========
Latest Version (Updated on June 18, 2020)
* BI5UpdateMgmt-v2.0.zip (version 2.0) from https://drive.google.com/open?id=1ck0Gv ... yWDMz0m7iL

Previous Version
* BI5UpdateMgmt.zip (version 1.0) from https://drive.google.com/open?id=1O6ril ... uTzFaUqqk-


INSTALLATION
============
1. Unzip " BI5UpdateMgmt-v2.0.zip" to C:\. This will unpack ArchiveBI5.cmd, BackupBI5v2.cmd,
RestoreBI5.cmd, InstallBI5Tasks.cmd, BI5_Config.txt and README.txt files to following directory:

C:\Bat

FYI: If Blue Iris 5 is NOT installed on C:, then open the configuration file called 'BI5_Config.txt'
with notepad and just change the following line:

DRV=C:

2. Run the batch file 'InstallBI5Tasks.cmd' using "Run as Administrator" to create scheduled tasks that backup Blue Iris' settings and archive Blue Iris updates. Depending upon whether Blue Iris is running as a service or application, it will create scheduled tasks that will run upon startup or logon and will repeat every 12 hours.

Scheduled Task1
-------------------
Name: BlueIrisSettings
[x] Run whether user is logged on or not
[x] Run with highest privileges
Begin task: At log on
Delay task for: 2 minutes
Repeat task every: 12 hours
For duration of: Indefinitely
Start program: C:\Bat\BackupBI5v2.cmd

Scheduled Task2
-------------------
Name: BlueIrisUpdates
[x] Run whether user is logged on or not
[x] Run with highest privileges
Begin task: At log on
Delay task for: 2 minutes
Repeat task every: 12 hours
For duration of: Indefinitely
Start program: C:\Bat\ArchiveBI5.cmd


When running 'InstallBI5Tasks.cmd', it will prompt you for:
1. The Windows local user account and password needed to run the scheduled tasks
2. The program to start for scheduled task1
3. The program to start for scheduled task2.

Example below:

InstallBI5Tasks.png
InstallBI5Tasks.png (28.06 KiB) Viewed 12714 times

With the exception of the password, you can press ENTER and accept the defaults for the local user account, program for scheduled task1 and program for scheduled tasks2.


HOW TO RESTORE Blue Iris to an earlier version
==========================================
To restore Blue Iris to a previous version, enter the Index number that corresponds to the Update version you want to roll back to and then answer Y for YES. The restore process will import the Blue Iris registry settings and install the Update from the selected Update version. The below example shows rolling back the version from v5.2.2.1 to v5.2.1.4.

Example:
RestoreBI5-1.png
RestoreBI5-1.png (25.45 KiB) Viewed 12471 times
RestoreBI5-2.png
RestoreBI5-2.png (29.8 KiB) Viewed 12471 times
Last edited by reddawg on Fri Jun 19, 2020 12:07 am, edited 20 times in total.
Blue Iris v5.3.9.10 | Win10 x64 version 22H2 | Dahua IPC-HFW2100, Amcrest IP2M-841W, Hikvision MINI PT DS-2CD2F52F-IS, Edimax IC-3030iWn | Intel i5-2500 CPU, 8GB Ram, Samsung 860 EVO 512GB SSD, WD Black 1TB HD.
User avatar
reddawg
Posts: 145
Joined: Sun Jun 30, 2019 11:29 am

Re: Blue Iris Update Manager

Post by reddawg »

HOW TO RESTORE Blue Iris to an earlier version (Continued)
====================================================

RestoreBI5-3.png
RestoreBI5-3.png (49.07 KiB) Viewed 12471 times
RestoreBI5-4.png
RestoreBI5-4.png (33.31 KiB) Viewed 12471 times
RestoreBI5-5.png
RestoreBI5-5.png (40.64 KiB) Viewed 12471 times
Last edited by reddawg on Sun Mar 22, 2020 5:37 am, edited 1 time in total.
Blue Iris v5.3.9.10 | Win10 x64 version 22H2 | Dahua IPC-HFW2100, Amcrest IP2M-841W, Hikvision MINI PT DS-2CD2F52F-IS, Edimax IC-3030iWn | Intel i5-2500 CPU, 8GB Ram, Samsung 860 EVO 512GB SSD, WD Black 1TB HD.
User avatar
reddawg
Posts: 145
Joined: Sun Jun 30, 2019 11:29 am

Re: Blue Iris Update Manager

Post by reddawg »

Alternate download location, see attached files:

(Version 2.0) - 'BI5UpdateMgmt-v2.0.zip' - (LATEST June 18, 2020)
(Version 1.0) - 'BI5UpdateMgmt.zip'
Attachments
BI5UpdateMgmt-v2.0.zip
(234.36 KiB) Downloaded 400 times
BI5UpdateMgmt.zip
(246.46 KiB) Downloaded 414 times
Last edited by reddawg on Fri Jun 19, 2020 12:14 am, edited 24 times in total.
Blue Iris v5.3.9.10 | Win10 x64 version 22H2 | Dahua IPC-HFW2100, Amcrest IP2M-841W, Hikvision MINI PT DS-2CD2F52F-IS, Edimax IC-3030iWn | Intel i5-2500 CPU, 8GB Ram, Samsung 860 EVO 512GB SSD, WD Black 1TB HD.
User avatar
Thixotropic
Posts: 743
Joined: Wed Sep 04, 2019 7:20 pm
Location: Low-Earth Orbit

Re: Blue Iris Update Manager

Post by Thixotropic »

Super cool stuff, well written and easy to modify or customize.

Thank you, reddawg!


reddawg wrote: Mon Mar 09, 2020 5:45 pm Alternate download location, see attached file 'BI5UpdateMgmt.zip'
Blue Iris 5.x x64 | Windows 10 Pro x64 | 16GB RAM | i7-7700 3.6 GHz | 1TB HDD | 2TB RAID NAS | 9 Cameras | Almost Dual NIC | 2KVA UPS
User avatar
reddawg
Posts: 145
Joined: Sun Jun 30, 2019 11:29 am

Re: Blue Iris Update Manager

Post by reddawg »

I just released an updated version of Blue Iris Update Manager that backs up all Blue Iris' settings stored in the registry using RegEdit.exe and now saves it in a ZIP compressed file instead of REG files. This reduces each backup from about 25MB to 282KB.

DOWNLOAD BI5UpdateMgmt-v2.0.zip
===============================
Latest Version (2.0)
* BI5UpdateMgmt-v2.0.zip from https://drive.google.com/open?id=1ck0Gv ... yWDMz0m7iL
Last edited by reddawg on Sat Mar 28, 2020 8:52 am, edited 3 times in total.
Blue Iris v5.3.9.10 | Win10 x64 version 22H2 | Dahua IPC-HFW2100, Amcrest IP2M-841W, Hikvision MINI PT DS-2CD2F52F-IS, Edimax IC-3030iWn | Intel i5-2500 CPU, 8GB Ram, Samsung 860 EVO 512GB SSD, WD Black 1TB HD.
User avatar
reddawg
Posts: 145
Joined: Sun Jun 30, 2019 11:29 am

Re: Blue Iris Update Manager

Post by reddawg »

NOTICE:

I have noticed that Update version 5.2.2.1 gets stuck and does not complete when you manually run it outside of the Blue Iris app. I first discovered this problem because only this specific Update (v5.2.2.1) was hanging and not completing in my Restore utility called "RestoreBI5.cmd". All other previous updates worked properly.

I don't know if this is a functionality change on how future updates starting with version 5.2.2.1 will work or a bug, but it appears that this specific update gets stuck if you are manually running Update.exe outside of Blue Iris when BlueIris.exe is not running. If you manually run Update.exe (v5.2.2.1) outside Blue Iris and Blue Iris is running minimized or in the background, then the update will properly complete.

My restore utility is designed to work when Blue Iris console is not running because it is restoring registry settings from an earlier version before launching the Update.exe to revert the program version. It even checks if Blue Iris is running as a service and stops and restarts the service during this operation. I am waiting on a answer from support. Until then the following workaround should work.

Workaround:

1. Launch "RestoreBI5.cmd"
2. Select the version you want to restore
3. Launch Blue Iris, but turn off the traffic signal (Shield). Click on Shield so Blue Iris is disarmed
4. Enter Y to "Do you want to restore update" in RestoreBI5.cmd

** RESOLVED ** as of 3/22/2020 Update version 5.2.2.2

Please avoid restoring Update version 5.2.2.1 using the RestoreBI5.cmd utility as it will not complete. This problem in the Update.exe has been fixed in Update version 5.2.2.2.
Blue Iris v5.3.9.10 | Win10 x64 version 22H2 | Dahua IPC-HFW2100, Amcrest IP2M-841W, Hikvision MINI PT DS-2CD2F52F-IS, Edimax IC-3030iWn | Intel i5-2500 CPU, 8GB Ram, Samsung 860 EVO 512GB SSD, WD Black 1TB HD.
User avatar
Thixotropic
Posts: 743
Joined: Wed Sep 04, 2019 7:20 pm
Location: Low-Earth Orbit

Re: Blue Iris Update Manager

Post by Thixotropic »

Reddawg,

Many thanks for the Blue Iris Update Manager scripts, they've already helped me out of a jam once.

I haven't installed the scheduled tasks for backing up the Blue Iris settings and archiving updates; I usually just run both scripts before I upgrade BI to make sure I'm up to date.

Could I combine the ArchiveBI5.cmd script and the BackupBI5v2.cmd script into a single script so they run together, with the BackupBI5v2.cmd running first?

Is there any reason I shouldn't do that, or maybe add a line to launch the ArchiveBI5 at the end of the BackupBI5 script?
Blue Iris 5.x x64 | Windows 10 Pro x64 | 16GB RAM | i7-7700 3.6 GHz | 1TB HDD | 2TB RAID NAS | 9 Cameras | Almost Dual NIC | 2KVA UPS
User avatar
reddawg
Posts: 145
Joined: Sun Jun 30, 2019 11:29 am

Re: Blue Iris Update Manager

Post by reddawg »

Thixotropic wrote: Sun Mar 29, 2020 2:56 pm Reddawg,

Many thanks for the Blue Iris Update Manager scripts, they've already helped me out of a jam once.

I haven't installed the scheduled tasks for backing up the Blue Iris settings and archiving updates; I usually just run both scripts before I upgrade BI to make sure I'm up to date.

Could I combine the ArchiveBI5.cmd script and the BackupBI5v2.cmd script into a single script so they run together, with the BackupBI5v2.cmd running first?

Is there any reason I shouldn't do that, or maybe add a line to launch the ArchiveBI5 at the end of the BackupBI5 script?
Greetings Thixotropic,

Either method would work, but adding a line to launch the ArchiveBI5.cmd batch file and the end of BackupBI5v2.cmd batch file would be the easiest way. I would Edit "BackupBI5v2.cmd" and add the following line at the end of the batch file:

CALL "C:\Bat\ArchiveBI5.cmd"

so it launches "ArchiveBI5.cmd" after the "POPD" command below the label :DONE.

:DONE
POPD
CALL "C:\Bat\ArchiveBI5.cmd"
TIMEOUT /T 3
GOTO :EOF
Blue Iris v5.3.9.10 | Win10 x64 version 22H2 | Dahua IPC-HFW2100, Amcrest IP2M-841W, Hikvision MINI PT DS-2CD2F52F-IS, Edimax IC-3030iWn | Intel i5-2500 CPU, 8GB Ram, Samsung 860 EVO 512GB SSD, WD Black 1TB HD.
User avatar
Thixotropic
Posts: 743
Joined: Wed Sep 04, 2019 7:20 pm
Location: Low-Earth Orbit

Re: Blue Iris Update Manager

Post by Thixotropic »

Thank you, this worked like a charm. One less click, lol.

Here's something I use as a daily scheduled task. BI will prune local directories by size but not by the age of the stored clips. This can be run as a nightly job and will delete all clips older than "X" number of days:

Code: Select all

# file_pruner.ps1- removes files older than a given number of days.

# really delete files or just display what will be deleted? 
# integer, either "0" or "1". Using "1" will enable deletion, "0" will jus display files that would have been deleted. 
$delete_files = "1"

# delete files older than 'X'. Use an integer in the .AddDays(X) parameter.
# for example, AddDays(-200) will remove files more than 200 days old. 
$limit = (Get-Date).AddDays(-200)

# path to the file directory to be pruned 
$path = "\\NAS10TB\BlueIris\Stored"

#=============================================

# display files older than $limit - just for visualization, doesn't delete anything. 
Get-ChildItem $path | Where-Object {$_.LastWriteTime -lt $limit}

# really delete files? 
if ($delete_files -eq 1) { 
    # delete files that are older than the $limit.
    Get-ChildItem -Path $path -Recurse -Force | Where-Object { !$_.PSIsContainer -and $_.CreationTime -lt $limit } | Remove-Item -Force
}
Blue Iris 5.x x64 | Windows 10 Pro x64 | 16GB RAM | i7-7700 3.6 GHz | 1TB HDD | 2TB RAID NAS | 9 Cameras | Almost Dual NIC | 2KVA UPS
User avatar
reddawg
Posts: 145
Joined: Sun Jun 30, 2019 11:29 am

Re: Blue Iris Update Manager

Post by reddawg »

I just released an updated version of Blue Iris Update Manager restore utility (RestoreBI5.cmd) that adds the ability to sort Updates by either date or name. To change how Updates are displayed in the restore utility (RestoreBI5.cmd):

1. Download a fresh copy of BI5UpdateMgmt-v2.0.zip from https://drive.google.com/open?id=1ck0Gv ... yWDMz0m7iL or from above.
2. Unzip the contents of BI5UpdateMgmt-v2.0.zip to C:\Bat or to the folder you originally installed it to.
3. Open the configuration file called 'BI5_Config.txt' with notepad and change the following line:

SORTORDER=D

D=Sort by Date
N=Sort by name (alphanumeric)
Attachments
SortedByName.png
SortedByName.png (15.81 KiB) Viewed 11918 times
SortedByDate.png
SortedByDate.png (16.57 KiB) Viewed 11918 times
Blue Iris v5.3.9.10 | Win10 x64 version 22H2 | Dahua IPC-HFW2100, Amcrest IP2M-841W, Hikvision MINI PT DS-2CD2F52F-IS, Edimax IC-3030iWn | Intel i5-2500 CPU, 8GB Ram, Samsung 860 EVO 512GB SSD, WD Black 1TB HD.
Post Reply