Better fallbacks for finding olmapi32 #122
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This pull request refactors and enhances how the code locates and prioritizes MAPI DLL paths, especially focusing on Outlook's
olmapi32.dll. It introduces a preference flag forolmapi32.dll, improves the search order for MAPI DLLs, and generalizes the mechanism for finding Outlook-related components. The changes also add new configuration options and refactor related functions for clarity and maintainability.These changes align with recent changes in mapi-rs to load MAPI in environments where New Outlook and 365 are installed, but Outlook desktop is not:
Support Office installations without requiring Outlook for MAPI detection
Enhancements to MAPI DLL path discovery and prioritization:
s_fPreferOlmapi32) and a new functionPreferOlmapi32to allow prioritizingolmapi32.dllpaths in the returned list of possible MAPI DLLs. (library/stubutils.cpp,library/stubutils.h) [1] [2] [3]GetMAPIPathsto document and enforce a clear order of preference for MAPI DLL discovery, and to bubbleolmapi32.dllpaths to the top if the preference is set. (library/stubutils.cpp)Generalization and refactoring of Outlook MAPI path lookup:
GetOutlookPathwith a more flexibleGetOLMAPI32Pathfunction that iterates through a list of possible Outlook qualifiers to find the correct path toolmapi32.dll. (library/stubutils.cpp,library/stubutils.h) [1] [2]g_OutlookQualifierscontaining possible Outlook-related executables and DLLs to use as qualifiers for component lookup. (library/stubutils.cpp)GetOLMAPI32Pathmechanism, simplifying logic and improving maintainability. (library/stubutils.cpp)