Repository navigation
Fixed Windows data path resolution and installer default folder - #9754
Conversation
|
@aliviahossain The following names might be missing from the
Please consider applying the following patch: --- AUTHORS 2026-07-17 14:53:04.970465505 +0000
+++ AUTHORS.new 2026-07-17 14:53:10.571585727 +0000
@@ -14,6 +14,7 @@
- Alexandra Scherbart
- Alexandra Zerck
- Alivia Hossain
+ - Alivia Hossain
- Amanda Wein
- Andreas Bertsch
- Andreas Simon |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (4)
🚧 Files skipped from review as they are similar to previous changes (4)
📝 WalkthroughWalkthroughOpenMS now resolves Windows shared data relative to the executable before consulting ChangesWindows data path handling
Sequence Diagram(s)sequenceDiagram
participant OpenMSInfo
participant FileResolver
participant Executable
participant FileSystem
participant Environment
OpenMSInfo->>FileResolver: request data path
FileResolver->>FileSystem: check compiled-in path
FileResolver->>Executable: derive executable-relative path
Executable->>FileSystem: check share/OpenMS
FileResolver->>Environment: use OPENMS_DATA_PATH if needed
FileResolver-->>OpenMSInfo: return path source
Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
📋 Issue PlannerLet us write the prompt for your AI agent so you can ship faster (with fewer bugs). View plan for ticket: ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
src/openms/include/OpenMS/SYSTEM/File.h (1)
228-231: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low valueFormat the documentation using Doxygen
@brieftags.As per coding guidelines, Doxygen documentation for C++ headers should use the
/**@brief... */format with a blank line before details, rather than the///style.♻️ Proposed refactor
- /// Returns a human-readable description of where getOpenMSDataPath() resolved from - /// (e.g. "the executable location (../share/OpenMS)"). Useful for diagnostics. + /** + `@brief` Returns a human-readable description of where getOpenMSDataPath() resolved from + + (e.g. "the executable location (../share/OpenMS)"). Useful for diagnostics. + */ static const std::string& getOpenMSDataPathSource();🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/openms/include/OpenMS/SYSTEM/File.h` around lines 228 - 231, Update the Doxygen comment for getOpenMSDataPathSource() to use the /** `@brief` ... */ format, preserving the existing description and example details after a blank line.Source: Coding guidelines
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In `@src/openms/include/OpenMS/SYSTEM/File.h`:
- Around line 228-231: Update the Doxygen comment for getOpenMSDataPathSource()
to use the /** `@brief` ... */ format, preserving the existing description and
example details after a blank line.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 64904b82-3c03-4252-a116-11ebe2f30cba
📒 Files selected for processing (6)
CHANGELOGcmake/Windows/Include/NsisMultiUser.nshcmake/Windows/NSIS.template.insrc/openms/include/OpenMS/SYSTEM/File.hsrc/openms/source/SYSTEM/File.cppsrc/topp/OpenMSInfo.cpp
|
@timosachsenberg Can you please review this PR if you have time ? Thanks ! |
cbielow
left a comment
There was a problem hiding this comment.
looks good to me. Thanks for providing screenshots and a local build.
Just one minor comment about formatting in OpenMSInfo (see below) and the screenshot of the installer:
The installation path when running the installer points to OpenMS-3.2 for an OpenMS 3.6 installer (in your screenshot). That is supposed to be fixed now, right?
…#9635) Address review feedback on OpenMS#9754: - OpenMSInfo prints the data path and its source on a single line: "Data path : <path> (via <source>)". - Shorten the data-path source tags so they read well inline (e.g. "OPENMS_DATA_PATH env", "exe-relative (../share/OpenMS)"). - File.h: use Doxygen @brief for getOpenMSDataPathSource(); fix the getOpenMSDataPath() comment (the env var is now a last-resort fallback, not an override). - File.cpp: reword the file-not-found hint to match the new resolution order. - CHANGELOG: clarify that probing OPENMS_DATA_PATH last applies on all platforms, with the Windows-specific changes called out separately.
|
Thanks! Fixed both. @cbielow For the OpenMSInfo formatting, I collapsed it to the single line you suggested and shortened the source strings so they read well inline: Data path : C:/.../share/OpenMS (via OPENMS_DATA_PATH env) On the installer: good catch, I just overlooked it, that 3.2.0 shot was actually the pre-fix behaviour. I re-ran the harness with a stale 3.2.0 entry seeded in the registry, and with the version gate (
Pushed a new single commit to this PR. |
|
🙏 |


Description
@cbielow , @timosachsenberg On Windows the installer wrote an
OPENMS_DATA_PATHenvironment variable andFile::getOpenMSDataPath()checked that variable first. So a value left behind by an old or side by side install could quietly hijack data resolution for a newer version. On top of that, the install wizard defaulted to the folder of the previously installed version (for example a fresh 3.6.0 install still pointed atC:\Program Files\OpenMS-3.2.0).Checklist
Resolution order
Before:
OPENMS_DATA_PATH env var->OPENMS_INSTALL_DATA_PATH-> compiled macro -> executable relativeAfter (Windows): compiled macro -> executable relative ->
OPENMS_DATA_PATH env var(last)After (Linux and macOS):
OPENMS_INSTALL_DATA_PATH-> compiled macro -> executable relative ->OPENMS_DATA_PATH env var(last)Before and after
Data path resolution with a stale
OPENMS_DATA_PATHset to a different valid share:Before:
Data pathfollows the stale variable and points at the wrong share.After:
Data pathresolves to the real share andData path srcis never the env var.Installer, with an older 3.2.0 recorded in the registry while installing 3.6.0:
Before: wizard defaults to
C:\Program Files\OpenMS-3.2.0.After: wizard defaults to
C:\Program Files\OpenMS-3.6.0. Same version reinstall or repair still reuses the stored folder.Files changed:
src/openms/source/SYSTEM/File.cpp: reorder resolution, env var probed last, skipOPENMS_INSTALL_DATA_PATHon Windows, make the source getter public and update its one caller.src/openms/include/OpenMS/SYSTEM/File.h: promotegetOpenMSDataPathSource()to public.src/topp/OpenMSInfo.cpp: printData path srcfor diagnostics.cmake/Windows/NSIS.template.in: stop writingOPENMS_DATA_PATH, keep the stale value cleanup on install and uninstall.cmake/Windows/Include/NsisMultiUser.nsh: version gate the default install folder in both install modes.Testing:
Built and run on Windows.
File_testpasses (also covers the missing data file hint from 'CHEMISTRY/custom_mods.xml' could not be found #9636).ParamXMLFile_test,UnimodXMLFile_test,ModificationsDB_test,ResidueDB_testpass withOPENMS_DATA_PATHunset, which proves devs and CI still find share on Windows through the compiled macro.OpenMSInfo.Screenshots
Before, data path hijacked by a stale OPENMS_DATA_PATH:
After, stale OPENMS_DATA_PATH ignored, resolves to the real share:
After, executable relative resolution on Windows:
After, install wizard defaults to OpenMS-3.6.0 with an old 3.2.0 in the registry:
Notes:
pyOpenMS keeps its env var fallback and is unchanged. It is not built in my local setup so it is verified by reasoning, but I have not run here.
The legacy
.onInitauto uninstall of a previous version and the version agnostic uninstall registry key are out of scope for this issue and left for a follow up.Please review this PR, suggestions are most welcome and if everything is fine you may merge it.
Closes #9635
Summary by CodeRabbit
Bug Fixes
OPENMS_DATA_PATHis now only a last-resort fallback.OPENMS_DATA_PATHin the registry.Diagnostics