|
|
|
@ -374,7 +374,7 @@ namespace ICSharpCode.Decompiler.Metadata
@@ -374,7 +374,7 @@ namespace ICSharpCode.Decompiler.Metadata
|
|
|
|
|
if (DetectMono()) { |
|
|
|
|
path = GetMonoMscorlibBasePath(version); |
|
|
|
|
} else { |
|
|
|
|
path = GetMscorlibBasePath(version); |
|
|
|
|
path = GetMscorlibBasePath(version, reference.PublicKeyToken.ToHexString(8)); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (path == null) |
|
|
|
@ -387,8 +387,35 @@ namespace ICSharpCode.Decompiler.Metadata
@@ -387,8 +387,35 @@ namespace ICSharpCode.Decompiler.Metadata
|
|
|
|
|
return null; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
string GetMscorlibBasePath(Version version) |
|
|
|
|
string GetMscorlibBasePath(Version version, string publicKeyToken) |
|
|
|
|
{ |
|
|
|
|
string GetSubFolderForVersion() |
|
|
|
|
{ |
|
|
|
|
switch (version.Major) { |
|
|
|
|
case 1: |
|
|
|
|
if (version.MajorRevision == 3300) |
|
|
|
|
return "v1.0.3705"; |
|
|
|
|
return "v1.1.4322"; |
|
|
|
|
case 2: |
|
|
|
|
return "v2.0.50727"; |
|
|
|
|
case 4: |
|
|
|
|
return "v4.0.30319"; |
|
|
|
|
default: |
|
|
|
|
if (throwOnError) |
|
|
|
|
throw new NotSupportedException("Version not supported: " + version); |
|
|
|
|
return null; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (publicKeyToken == "969db8053d3322ac") { |
|
|
|
|
string programFiles = Environment.Is64BitOperatingSystem ? |
|
|
|
|
Environment.GetFolderPath(Environment.SpecialFolder.ProgramFilesX86) : |
|
|
|
|
Environment.GetFolderPath(Environment.SpecialFolder.ProgramFiles); |
|
|
|
|
string cfPath = $@"Microsoft.NET\SDK\CompactFramework\v{version.Major}.{version.Minor}\WindowsCE\"; |
|
|
|
|
string cfBasePath = Path.Combine(programFiles, cfPath); |
|
|
|
|
if (Directory.Exists(cfBasePath)) |
|
|
|
|
return cfBasePath; |
|
|
|
|
} else { |
|
|
|
|
string rootPath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.Windows), "Microsoft.NET"); |
|
|
|
|
string[] frameworkPaths = new[] { |
|
|
|
|
Path.Combine(rootPath, "Framework"), |
|
|
|
@ -404,39 +431,11 @@ namespace ICSharpCode.Decompiler.Metadata
@@ -404,39 +431,11 @@ namespace ICSharpCode.Decompiler.Metadata
|
|
|
|
|
return basePath; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (version.Major == 3 && version.Minor == 5) { |
|
|
|
|
string cfBasePath = Path.Combine((Environment.Is64BitOperatingSystem ? |
|
|
|
|
Environment.GetFolderPath(Environment.SpecialFolder.ProgramFilesX86) : |
|
|
|
|
Environment.GetFolderPath(Environment.SpecialFolder.ProgramFiles)), |
|
|
|
|
@"Microsoft.NET\SDK\CompactFramework\v3.5\WindowsCE\"); |
|
|
|
|
|
|
|
|
|
if (Directory.Exists(cfBasePath)) { |
|
|
|
|
return cfBasePath; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (throwOnError) |
|
|
|
|
throw new NotSupportedException("Version not supported: " + version); |
|
|
|
|
return null; |
|
|
|
|
|
|
|
|
|
string GetSubFolderForVersion() |
|
|
|
|
{ |
|
|
|
|
switch (version.Major) { |
|
|
|
|
case 1: |
|
|
|
|
if (version.MajorRevision == 3300) |
|
|
|
|
return "v1.0.3705"; |
|
|
|
|
return "v1.1.4322"; |
|
|
|
|
case 2: |
|
|
|
|
return "v2.0.50727"; |
|
|
|
|
case 4: |
|
|
|
|
return "v4.0.30319"; |
|
|
|
|
default: |
|
|
|
|
if (throwOnError) |
|
|
|
|
throw new NotSupportedException("Version not supported: " + version); |
|
|
|
|
return null; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
string GetMonoMscorlibBasePath(Version version) |
|
|
|
|