Trying to update windows openhab 2.5.0.M1 to M2

hey all,

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>

Newer PowerShells don’t let you launch scripts by default. You have to change a security setting.

The error message you posted included this:

That link explains the security model and has examples on how to change it. You’ll need to pick a less restrictive model.

Once you set it to something more open, the update should work.

1 Like

sweet thanks for that Lou,

i still get the st1 error though. when i start the .ps1 file nothing happens. should there be something that comes up?

from this line

PrintAndReturn : 2.5.0.M1 is not formatted correctly (d.d.d)

makes me think its not expecting the M1 as its a extra dot