Skip to content

Add helper script to the distribution - #1945

Open
andrewfg wants to merge 2 commits into
openhab:mainfrom
andrewfg:move-runhidden
Open

Add helper script to the distribution#1945
andrewfg wants to merge 2 commits into
openhab:mainfrom
andrewfg:move-runhidden

Conversation

@andrewfg

@andrewfg andrewfg commented Aug 13, 2026

Copy link
Copy Markdown
Contributor

In #1922 we fixed the 'Terminal has been closed' error. The solution for Windows requires a helper Visual Basic Script file that executes some shell commands in a hidden window in order to avoid confusing users. The original solution created the helper VBS file on the fly in the Windows temp folder. However as reported and discussed in #1940 creating the script on the fly can create problems; specifically due to paths with spaces. And it leaves an orphan copy of the script file in the Windows temp folder.

In this PR we no longer create the helper Visual Basic Script on the fly, but instead we include it as a fixed part of the distribution. Furthermore the batch file and the script are modified to handle paths with spaces.

Resolves #1940

Signed-off-by: Andrew Fiddian-Green software@whitebear.ch

Signed-off-by: Andrew Fiddian-Green <software@whitebear.ch>
@andrewfg andrewfg self-assigned this Aug 13, 2026
@andrewfg
andrewfg requested review from jlaur and a lite review from Copilot August 13, 2026 11:45

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot wasn't able to review any files in this pull request.


💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@andrewfg
andrewfg marked this pull request as ready for review August 13, 2026 21:21
@andrewfg
andrewfg requested a review from a team as a code owner August 13, 2026 21:21
wborn
wborn previously requested changes Aug 14, 2026

@wborn wborn left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PR is being reviewed with AI first.

The overall approach looks good: shipping runhidden.vbs as part of the distribution avoids creating the helper dynamically in %TEMP% and removes the associated timing, permission, path, and cleanup concerns.

One correctness issue should be addressed before merging: when runhidden.vbs is missing, the new error path exits after cache-refresh-lock has already been created. That stale lock causes subsequent startups to skip the cache refresh path entirely, including the helper-file check.

Apart from that issue, no further problems were found in the current changes. A human maintainer review is still needed.

Comment thread distributions/openhab/src/main/resources/bin/karaf.bat Outdated
- adopt reviewer suggestion
- support paths with spaces

Signed-off-by: Andrew Fiddian-Green <software@whitebear.ch>

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot wasn't able to review any files in this pull request.

@andrewfg

Copy link
Copy Markdown
Contributor Author

@wborn I addressed your (AI) comment. However can you please wait for @jlaur to confirm that it fixes his #1940

@andrewfg
andrewfg requested a review from wborn August 16, 2026 14:14
@wborn wborn changed the title Add helper script to the distrubution Add helper script to the distribution Aug 16, 2026
@wborn
wborn dismissed their stale review August 16, 2026 14:34

Issues fixed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Popups and error messages during initial startup of openHAB 5.3 snapshot in Windows 10

3 participants