Skip to content

Commit c4c865c

Browse files
authored
Merge pull request #164 from desjarlais/add-customlibrarysetting
add fix for #162 to add setting a custom path and directory for scintilla binaries
2 parents 484e045 + d736806 commit c4c865c

File tree

3 files changed

+30
-4
lines changed

3 files changed

+30
-4
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,9 @@ For the latest and greatest you can build the [Master](https://github.com/desjar
3434
**Versions before v.5.3.1.1:**
3535
[Microsoft Visual C++ Redistributable for Visual Studio 2015, 2017, 2019, and 2022](https://learn.microsoft.com/en-us/cpp/windows/latest-supported-vc-redist?view=msvc-170) is required for the component to work, see [#16](https://github.com/desjarlais/Scintilla.NET/issues/16).
3636

37-
Scintilla library version = 5.5.5
37+
Scintilla library version = 5.5.7
3838

39-
Lexilla library version = 5.4.3
39+
Lexilla library version = 5.4.5
4040

4141
## Background
4242
For more information about the history and background information, look at the wiki [here](https://github.com/desjarlais/Scintilla.NET/wiki/Scintilla.NET-History).

Scintilla.NET/Scintilla.NET.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<NeutralLanguage>en-US</NeutralLanguage>
66
<Description>Source Editing Component based on Scintilla 5 series.</Description>
77
<Copyright>Copyright (c) Jacob Slusser 2018, VPKSoft, cyber960 2022, desjarlais 2023, Ahmet Sait 2025</Copyright>
8-
<Version>6.0.1</Version>
8+
<Version>6.1.0</Version>
99
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
1010
<GenerateDocumentationFile>True</GenerateDocumentationFile>
1111
<UseWindowsForms>true</UseWindowsForms>

Scintilla.NET/Scintilla.cs

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,13 @@ procName is "devenv" or "DesignToolsServer" or // WinForms app in VS IDE
7676
/// </summary>
7777
public static IEnumerable<string> EnumerateSatelliteLibrarySearchPaths()
7878
{
79-
// check run-time paths
79+
// 1. User configured (must be set before first Scintilla usage)
80+
if (!string.IsNullOrWhiteSpace(SatelliteDirectory))
81+
{
82+
yield return SatelliteDirectory;
83+
}
84+
85+
// 2. check run-time paths
8086
string nativeSubFolder = Path.Combine("runtimes", "win-" + Helpers.GetArchitectureRid(WinApiHelpers.GetProcessArchitecture()), "native");
8187

8288
{
@@ -106,6 +112,7 @@ public static IEnumerable<string> EnumerateSatelliteLibrarySearchPaths()
106112
}
107113
}
108114

115+
// 3. check design-time paths
109116
if (InDesignProcess())
110117
{
111118
// Look for the assemblies in the nuget global packages folder
@@ -121,6 +128,19 @@ public static IEnumerable<string> EnumerateSatelliteLibrarySearchPaths()
121128
string rootProjectFolder = Path.GetFullPath(Path.Combine(nugetScintillaNETLocation, @"..\..\..\.."));
122129
yield return Path.Combine(rootProjectFolder, "packages", nugetScintillaPackageName + "." + versionString, nativeSubFolder);
123130
}
131+
132+
// 4. check environment variable custom paths
133+
string x86CustomPath = Environment.GetEnvironmentVariable("SCINTILLA_X86", EnvironmentVariableTarget.User);
134+
if (!string.IsNullOrWhiteSpace(x86CustomPath))
135+
{
136+
yield return x86CustomPath;
137+
}
138+
139+
string x64CustomPath = Environment.GetEnvironmentVariable("SCINTILLA_X64", EnvironmentVariableTarget.User);
140+
if (!string.IsNullOrWhiteSpace(x64CustomPath))
141+
{
142+
yield return x64CustomPath;
143+
}
124144
}
125145

126146
#region Fields
@@ -3557,6 +3577,12 @@ public void ClearChangeHistory()
35573577

35583578
#region Properties
35593579

3580+
/// <summary>
3581+
/// Optional absolute directory path probed first for native satellite libraries.
3582+
/// If set, this directory is checked before all default probing locations.
3583+
/// </summary>
3584+
public static string SatelliteDirectory { get; set; }
3585+
35603586
/// <summary>
35613587
/// Gets or sets whether Scintilla's native drag &amp; drop should be used instead of WinForms based one.
35623588
/// </summary>

0 commit comments

Comments
 (0)