Skip to content

Fix runtime directory creation for Windows installer - #58

Merged
thiagoralves merged 3 commits into
mainfrom
devin/1767158684-fix-runtime-dir
Dec 31, 2025
Merged

Fix runtime directory creation for Windows installer#58
thiagoralves merged 3 commits into
mainfrom
devin/1767158684-fix-runtime-dir

Conversation

@devin-ai-integration

@devin-ai-integration devin-ai-integration Bot commented Dec 31, 2025

Copy link
Copy Markdown
Contributor

Summary

Fixes the FileNotFoundError: [Errno 2] No such file or directory: '/var/run/runtime/.env' error that occurs when the Windows installer runs for the first time.

The issue was that the runtime directory doesn't exist when the packaged installer runs, unlike manual MSYS2 installations where install.sh creates it. This PR adds a get_runtime_dir() function that:

  • Dynamically determines the runtime directory based on platform (/run/runtime on MSYS2/Cygwin, /var/run/runtime on Linux)
  • Ensures the directory exists before writing the .env file

Also fixes pre-existing pylint warnings (encoding, sys.exit, too-few-public-methods).

Updates since last revision

  • Added Autonomy Logic icon (openplc.ico) downloaded from autonomylogic.com favicon
  • Configured installer to use the icon (SetupIconFile, UninstallDisplayIcon)
  • Added icon to Start Menu and desktop shortcuts
  • Icon is bundled with installation for shortcut references

Review & Testing Checklist for Human

  • Test on Windows/MSYS2: Run the installer and verify the runtime starts without FileNotFoundError
  • Verify icon appears correctly: Check that the Autonomy Logic icon shows on desktop shortcut, Start Menu shortcuts, and in Add/Remove Programs
  • Verify platform detection: The code uses platform.system() != "Linux" which catches ALL non-Linux platforms. Confirm this is the intended behavior for MSYS2 detection
  • Verify path consistency: Ensure /run/runtime on MSYS2 matches what install.sh and start_openplc.sh expect
  • Test on Linux/Docker: Verify the change doesn't break existing Linux deployments (should still use /var/run/runtime)

Recommended test plan:

  1. Build the Windows installer via GitHub Actions
  2. Install on a Windows machine
  3. Verify the Autonomy Logic icon appears on shortcuts and in the installer
  4. Launch OpenPLC Runtime and verify it starts without errors
  5. Also test a fresh Docker deployment to ensure Linux behavior is unchanged

Notes

Link to Devin run: https://app.devin.ai/sessions/64ffd9e3ddb84cc08e3e414b5296e07d
Requested by: Thiago Alves (@thiagoralves)

- Add get_runtime_dir() function to dynamically determine runtime directory
- Use /run/runtime on MSYS2/Cygwin, /var/run/runtime on Linux
- Ensure directory exists before writing .env file
- Fixes FileNotFoundError when installer runs for the first time
- Fix pre-existing pylint warnings (encoding, sys.exit, too-few-public-methods)

Co-Authored-By: Thiago Alves <thiagoralves@gmail.com>
@devin-ai-integration

Copy link
Copy Markdown
Contributor Author

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment and CI monitoring

devin-ai-integration Bot and others added 2 commits December 31, 2025 05:36
- Download favicon from autonomylogic.com as openplc.ico
- Configure SetupIconFile for installer icon
- Add icon to Start Menu and desktop shortcuts
- Bundle icon with installation for shortcut references

Co-Authored-By: Thiago Alves <thiagoralves@gmail.com>
- Replace favicon with the blue Autonomy logo provided by user
- ICO file includes 6 sizes (16x16 to 256x256) for best Windows compatibility

Co-Authored-By: Thiago Alves <thiagoralves@gmail.com>
@thiagoralves
thiagoralves merged commit 13941fa into main Dec 31, 2025
1 check passed
@thiagoralves
thiagoralves deleted the devin/1767158684-fix-runtime-dir branch December 31, 2025 06:14
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