MCPcopy Create free account
hub / github.com/TCOTC/CleanFlash_Installer / SystemInfo

Class SystemInfo

CleanFlashCommon/SystemInfo.cs:6–104  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4
5namespace CleanFlashCommon {
6 public class SystemInfo {
7
8 private static string system32Path = Environment.GetFolderPath(Environment.SpecialFolder.SystemX86);
9 private static string system64Path = Environment.GetFolderPath(Environment.SpecialFolder.System);
10 private static string program32Path = Environment.GetEnvironmentVariable("PROGRAMFILES(X86)") ?? Environment.GetFolderPath(Environment.SpecialFolder.ProgramFiles);
11 private static string flashProgram32Path = Path.Combine(program32Path, "Flash Player");
12 private static string macromed32Path = Path.Combine(system32Path, "Macromed");
13 private static string macromed64Path = Path.Combine(system64Path, "Macromed");
14 private static string flash32Path = Path.Combine(macromed32Path, "Flash");
15 private static string flash64Path = Path.Combine(macromed64Path, "Flash");
16 private static string version = UpdateChecker.GetFlashVersion();
17 private static string versionPath = version.Replace(".", "_");
18 private static string versionComma = version.Replace(".", ",");
19 private static Dictionary<string, string> replacementStrings = new Dictionary<string, string>() {
20 { "${SYSTEM_32_PATH}", system32Path.Replace(@"\", @"\\") },
21 { "${SYSTEM_64_PATH}", system64Path.Replace(@"\", @"\\") },
22 { "${PROGRAM_32_PATH}", program32Path.Replace(@"\", @"\\") },
23 { "${PROGRAM_FLASH_32_PATH}", flashProgram32Path.Replace(@"\", @"\\") },
24 { "${FLASH_32_PATH}", flash32Path.Replace(@"\", @"\\") },
25 { "${FLASH_64_PATH}", flash64Path.Replace(@"\", @"\\") },
26 { "${VERSION}", version },
27 { "${VERSION_PATH}", versionPath },
28 { "${VERSION_COMMA}", versionComma },
29 { "${ARCH}", Environment.Is64BitOperatingSystem ? "64" : "32" }
30 };
31
32 public static string GetSystem32Path() {
33 return system32Path;
34 }
35
36 public static string GetSystem64Path() {
37 return system64Path;
38 }
39
40 public static string GetProgram32Path()
41 {
42 return program32Path;
43 }
44
45 public static string GetProgramFlash32Path()
46 {
47 return flashProgram32Path;
48 }
49
50 public static string[] GetSystemPaths() {
51 if (Environment.Is64BitOperatingSystem) {
52 return new string[] { system32Path, system64Path };
53 } else {
54 return new string[] { system32Path };
55 }
56 }
57
58 public static string GetMacromed32Path() {
59 return macromed32Path;
60 }
61
62 public static string GetMacromed64Path() {
63 return macromed64Path;

Callers

nothing calls this directly

Calls 1

GetFlashVersionMethod · 0.80

Tested by

no test coverage detected