Skip to content

Attempt to fix problems with post.bat#2

Merged
dagewa merged 2 commits into
mainfrom
fix-post-install
Jul 17, 2026
Merged

Attempt to fix problems with post.bat#2
dagewa merged 2 commits into
mainfrom
fix-post-install

Conversation

@dagewa

@dagewa dagewa commented Jul 14, 2026

Copy link
Copy Markdown
Member

The Windows post-install file post.bat would raise an error during install:

image

If "Retry" was then clicked, it completed successfully. Claude's diagnosis is that the script had no explicit exit code, and instead used the exit code of the last step (writing the Start menu entry). It's guess as to why this may have been non-zero is this:

Why PowerShell's exit code would be non-zero here, and why Retry "fixes" it, is very plausibly a COM timing/context issue: New-Object -ComObject WScript.Shell is being invoked from inside the installer process while Windows Explorer/shell infrastructure may not yet be fully available (installers sometimes run with a different session/integrity context than your interactive desktop). That can make the COM instantiation throw on the first attempt.

I asked Claude to fix the problem, and it produced this version of the script. Now it has an explicit exit code, and the PowerShell command is in a try/catch. In addition, all steps are logged, so we can look for WARNINGs if any particular stage has failed.

@dagewa

dagewa commented Jul 14, 2026

Copy link
Copy Markdown
Member Author

I'm doing a build on this branch to see if it really does fix the issue, before deciding whether to merge.

@dagewa

dagewa commented Jul 14, 2026

Copy link
Copy Markdown
Member Author

Ok, this revealed the error. In post_install.log I see:

[Stage 5] Creating Start Menu shortcut 
'powershell' is not recognized as an internal or external command,
operable program or batch file.
[Stage 5] WARNING: shortcut not found after creation attempt 

@dagewa

dagewa commented Jul 17, 2026

Copy link
Copy Markdown
Member Author

Yes, providing the full path to powershell works, and Claude says

Since Windows 7, PowerShell has been included by default, so on most consumer and standard server installs, this path is reliable

I think it is worth keeping the post_install.log mechanism to debug any further Windows issues that may become apparent when users start trying this out. So, will merge this PR in its current state.

@dagewa
dagewa merged commit 7a4cf93 into main Jul 17, 2026
5 checks passed
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.

1 participant