im having issues trying to update openhab on my windows 10 pc.
what i have done so far is stop openhab from running.
started powershell and got to the update.bat file in runtime/bin foler with the version number i wanted to update to
C:\openhab\runtime\bin\update.bat 2.5.0.M2
looks to download ok
then it fails after its done downloading
Windows PowerShell
Copyright (C) Microsoft Corporation. All rights reserved.
Try the new cross-platform PowerShell https://aka.ms/pscore6 PS C:\WINDOWS\system32> C:\openhab\runtime\bin\update.bat 2.5.0.M2 #################################
# openHAB 2.x.x update script #
#################################
Checking whether a service exists
Checking the specified openHAB directory
Using C:\openhab\conf as conf folder
Using C:\openhab\userdata as userdata folder
Using C:\openhab\runtime as runtime folder
Using C:\openhab\addons as addons folder
The current version is 2.5.0.M1
Changing location to C:\openhab
Creating temporary update directory C:\Users\nick_\AppData\Local\Temp\openhab
Downloading the openHAB 2.5.0.M2 distribution to C:\Users\nick_\AppData\Local\Temp\openhab\openhab-2.5.0.zip
Downloaded 72934K of 72934K [100%]
Finished Download
Extracting the archive (C:\Users\nick_\AppData\Local\Temp\openhab\openhab-2.5.0.zip) to C:\Users\nick_\AppData\Local\Temp\openhab\update
########################################################################################################################################
# New update.ps1 was found - executing it instead (found in C:\Users\nick_\AppData\Local\Temp\openhab\update\runtime\bin\update.ps1) #
########################################################################################################################################
#################################
# openHAB 2.x.x update script #
#################################
Checking whether a service exists
Checking the specified openHAB directory
Using C:\openhab\conf as conf folder
Using C:\openhab\userdata as userdata folder
Using C:\openhab\runtime as runtime folder
Using C:\openhab\addons as addons folder
The current version is 2.5.0.M1
Changing location to C:\openhab
########################################################################################################################################################
# Execution of new update.ps1 failed - please execute it yourself (found in C:\Users\nick_\AppData\Local\Temp\openhab\update\runtime\bin\update.ps1) #
########################################################################################################################################################
PrintAndReturn : 2.5.0.M1 is not formatted correctly (d.d.d)
At C:\openhab\runtime\bin\update.ps1:568 char:22
+ ... exit PrintAndReturn "Execution of new update.ps1 failed - plea ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [Write-Error], WriteErrorException
+ FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException,PrintAndReturn
Press any key to continue . . .
so i hit any key navagate to where it says i need to try execting it myself. which also fails.
PS C:\WINDOWS\system32> C:\Users\nick_\AppData\Local\Temp\openhab\update\runtime\bin\update.ps1
C:\Users\nick_\AppData\Local\Temp\openhab\update\runtime\bin\update.ps1 : File
C:\Users\nick_\AppData\Local\Temp\openhab\update\runtime\bin\update.ps1 cannot be loaded because running scripts is
disabled on this system. For more information, see about_Execution_Policies at
https:/go.microsoft.com/fwlink/?LinkID=135170.
At line:1 char:1
+ C:\Users\nick_\AppData\Local\Temp\openhab\update\runtime\bin\update.p ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : SecurityError: (:) [], PSSecurityException
+ FullyQualifiedErrorId : UnauthorizedAccess
PS C:\WINDOWS\system32>
It is not always easy to decide if it is the same problem or just similar. In the forum guidelines is also written, you should first search for a same error. I consider this question to be legitimate, since update.bat last changed in December 2018. This is valid for all distributions that have been released after that time.
update.bat calls update.ps1 and update.ps1 checks if there is a newer version in downloaded and extracted folder, if so, it uses this newer version.
See above:
“New update.ps1 was found - executing it instead (found in c:\ …)”
The newer update.ps1 should be valid exactly for the version you are trying to install.
update.ps1 was last changed on 02 Aug 2019 (=7 days before 2.5.0.M2 was released.) So the latest update.ps1 is used in 2.5.0.M2, 2.5.0.M3, 2.5.0.M4 and all Snapshots after 1651.
I’m afraid I can’t get that to work. I have tried both powershell and command prompt but similar results. If I use the syntax 2.5.0-M4 it fails to find files to download. If I use the syntax 2.5.0.M4 then it will download the files and extract but then fail with an error “PrintAndReturn : 2.5.0.M1 is not formatted correctly (d.d.d)”. 2.5.0.M1 is the version that I am currently running.
Note that I have changed my openhab folder to openHAB2 but I can’t change the path to the root of C for a range of reasons.
If you knew the current documentation is in error, why did you not file an issue or PR on GitHub? The developers are not omniscient. Unless you document an issue, they may not know about it. That is what GitHub is used for. Not all OH developers use this user forum.
sorry, @Bruce_Osborne, I didn’t know what the issue was, I just knew that I couldn’t figure it out and worked around it using methods I had used previously