Skip to content

Attempt to fix problems with post.bat#2

Open
dagewa wants to merge 2 commits into
mainfrom
fix-post-install
Open

Attempt to fix problems with post.bat#2
dagewa wants to merge 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 

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