dsh-remote 0.8.91 → 0.8.93

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (181) hide show
  1. package/LICENSE +21 -21
  2. package/README.en.md +369 -368
  3. package/README.md +354 -353
  4. package/cordis.patch.yml +9 -9
  5. package/lib/audit.js +45 -45
  6. package/lib/binding.js +172 -172
  7. package/lib/client.js +4647 -4550
  8. package/lib/credential.js +270 -263
  9. package/lib/errors.js +141 -141
  10. package/lib/exec-job.js +242 -242
  11. package/lib/file-reference.js +457 -457
  12. package/lib/forwards.js +258 -258
  13. package/lib/host-api.js +822 -822
  14. package/lib/hostkey.js +108 -108
  15. package/lib/http-transport.js +201 -201
  16. package/lib/ignore.js +202 -202
  17. package/lib/index.js +4488 -4394
  18. package/lib/instructions-dynamic.js +415 -415
  19. package/lib/instructions.js +288 -288
  20. package/lib/open-folder.js +56 -56
  21. package/lib/openssh.js +940 -881
  22. package/lib/paths.js +292 -292
  23. package/lib/pool.js +1029 -970
  24. package/lib/posix-shell.cjs +34 -0
  25. package/lib/registry.js +296 -296
  26. package/lib/remote-fs.js +173 -173
  27. package/lib/remote-sandbox.js +183 -183
  28. package/lib/remote-shell-child.cjs +397 -400
  29. package/lib/remote-shell.js +697 -697
  30. package/lib/remote-skills.js +312 -0
  31. package/lib/routes-audit.js +58 -58
  32. package/lib/routes-forwards.js +72 -72
  33. package/lib/routes-fs.js +251 -245
  34. package/lib/routes-machines.js +186 -186
  35. package/lib/routes-misc.js +187 -150
  36. package/lib/routes-term.js +169 -169
  37. package/lib/routes-update.js +143 -143
  38. package/lib/routes-web-attach.js +112 -112
  39. package/lib/routes-workspace.js +312 -312
  40. package/lib/search.js +235 -235
  41. package/lib/sftp-surface.js +119 -119
  42. package/lib/sshconfig.js +779 -779
  43. package/lib/sync.js +350 -350
  44. package/lib/tasks.js +95 -95
  45. package/lib/telemetry.js +247 -247
  46. package/lib/terminal.js +205 -205
  47. package/lib/tui/flow.js +130 -130
  48. package/lib/tui/format.js +380 -380
  49. package/lib/tui/i18n.js +350 -350
  50. package/lib/tui/index.js +531 -531
  51. package/lib/tui/provider.js +344 -344
  52. package/lib/tui/scene.js +986 -986
  53. package/lib/update.js +490 -472
  54. package/lib/web-attach.js +860 -850
  55. package/lib/workspace-cleanup.js +337 -337
  56. package/package.json +103 -100
  57. package/node_modules/buildcheck/.eslintrc.js +0 -5
  58. package/node_modules/buildcheck/.github/workflows/ci.yml +0 -88
  59. package/node_modules/buildcheck/.github/workflows/lint.yml +0 -27
  60. package/node_modules/buildcheck/.npmignore +0 -3
  61. package/node_modules/buildcheck/LICENSE +0 -19
  62. package/node_modules/buildcheck/README.md +0 -106
  63. package/node_modules/buildcheck/deps/Find-VisualStudio.cs +0 -250
  64. package/node_modules/buildcheck/lib/findvs.js +0 -361
  65. package/node_modules/buildcheck/lib/index.js +0 -738
  66. package/node_modules/buildcheck/package.json +0 -36
  67. package/node_modules/buildcheck/test/test.js +0 -8
  68. package/node_modules/cpu-features/.eslintrc.js +0 -5
  69. package/node_modules/cpu-features/.github/workflows/ci.yml +0 -74
  70. package/node_modules/cpu-features/.github/workflows/lint.yml +0 -27
  71. package/node_modules/cpu-features/LICENSE +0 -19
  72. package/node_modules/cpu-features/README.md +0 -59
  73. package/node_modules/cpu-features/binding.gyp +0 -16
  74. package/node_modules/cpu-features/buildcheck.js +0 -32
  75. package/node_modules/cpu-features/deps/cpu_features/.clang-format +0 -4
  76. package/node_modules/cpu-features/deps/cpu_features/.dockerignore +0 -31
  77. package/node_modules/cpu-features/deps/cpu_features/.github/workflows/Dockerfile +0 -5
  78. package/node_modules/cpu-features/deps/cpu_features/.github/workflows/aarch64_linux_cmake.yml +0 -30
  79. package/node_modules/cpu-features/deps/cpu_features/.github/workflows/amd64_freebsd_cmake.yml +0 -22
  80. package/node_modules/cpu-features/deps/cpu_features/.github/workflows/amd64_linux_bazel.yml +0 -26
  81. package/node_modules/cpu-features/deps/cpu_features/.github/workflows/amd64_linux_cmake.yml +0 -31
  82. package/node_modules/cpu-features/deps/cpu_features/.github/workflows/amd64_macos_cmake.yml +0 -43
  83. package/node_modules/cpu-features/deps/cpu_features/.github/workflows/amd64_windows_cmake.yml +0 -25
  84. package/node_modules/cpu-features/deps/cpu_features/.github/workflows/arm_linux_cmake.yml +0 -31
  85. package/node_modules/cpu-features/deps/cpu_features/.github/workflows/clang_format.yml +0 -24
  86. package/node_modules/cpu-features/deps/cpu_features/.github/workflows/mips_linux_cmake.yml +0 -30
  87. package/node_modules/cpu-features/deps/cpu_features/.github/workflows/power_linux_cmake.yml +0 -29
  88. package/node_modules/cpu-features/deps/cpu_features/.github/workflows/riscv_linux_cmake.yml +0 -28
  89. package/node_modules/cpu-features/deps/cpu_features/.github/workflows/s390x_linux_cmake.yml +0 -27
  90. package/node_modules/cpu-features/deps/cpu_features/.grenrc.yml +0 -21
  91. package/node_modules/cpu-features/deps/cpu_features/BUILD.bazel +0 -329
  92. package/node_modules/cpu-features/deps/cpu_features/CMakeLists.txt +0 -261
  93. package/node_modules/cpu-features/deps/cpu_features/CONTRIBUTING.md +0 -23
  94. package/node_modules/cpu-features/deps/cpu_features/LICENSE +0 -230
  95. package/node_modules/cpu-features/deps/cpu_features/README.md +0 -272
  96. package/node_modules/cpu-features/deps/cpu_features/WORKSPACE +0 -19
  97. package/node_modules/cpu-features/deps/cpu_features/bazel/ci/README.md +0 -5
  98. package/node_modules/cpu-features/deps/cpu_features/bazel/platforms.bzl +0 -11
  99. package/node_modules/cpu-features/deps/cpu_features/cmake/CpuFeaturesConfig.cmake.in +0 -3
  100. package/node_modules/cpu-features/deps/cpu_features/cmake/CpuFeaturesNdkCompatConfig.cmake.in +0 -3
  101. package/node_modules/cpu-features/deps/cpu_features/cmake/README.md +0 -30
  102. package/node_modules/cpu-features/deps/cpu_features/cmake/ci/Makefile +0 -252
  103. package/node_modules/cpu-features/deps/cpu_features/cmake/ci/README.md +0 -40
  104. package/node_modules/cpu-features/deps/cpu_features/cmake/ci/doc/docker.dot +0 -64
  105. package/node_modules/cpu-features/deps/cpu_features/cmake/ci/doc/docker.svg +0 -312
  106. package/node_modules/cpu-features/deps/cpu_features/cmake/ci/doc/generate_image.sh +0 -7
  107. package/node_modules/cpu-features/deps/cpu_features/cmake/ci/docker/amd64/Dockerfile +0 -48
  108. package/node_modules/cpu-features/deps/cpu_features/cmake/ci/docker/toolchain/Dockerfile +0 -34
  109. package/node_modules/cpu-features/deps/cpu_features/cmake/ci/sample/CMakeLists.txt +0 -22
  110. package/node_modules/cpu-features/deps/cpu_features/cmake/ci/sample/main.cpp +0 -11
  111. package/node_modules/cpu-features/deps/cpu_features/cmake/ci/vagrant/freebsd/Vagrantfile +0 -107
  112. package/node_modules/cpu-features/deps/cpu_features/cmake/googletest.CMakeLists.txt.in +0 -15
  113. package/node_modules/cpu-features/deps/cpu_features/cpu_features.gyp +0 -105
  114. package/node_modules/cpu-features/deps/cpu_features/include/cpu_features_cache_info.h +0 -54
  115. package/node_modules/cpu-features/deps/cpu_features/include/cpu_features_macros.h +0 -384
  116. package/node_modules/cpu-features/deps/cpu_features/include/cpuinfo_aarch64.h +0 -259
  117. package/node_modules/cpu-features/deps/cpu_features/include/cpuinfo_arm.h +0 -121
  118. package/node_modules/cpu-features/deps/cpu_features/include/cpuinfo_mips.h +0 -74
  119. package/node_modules/cpu-features/deps/cpu_features/include/cpuinfo_ppc.h +0 -149
  120. package/node_modules/cpu-features/deps/cpu_features/include/cpuinfo_riscv.h +0 -72
  121. package/node_modules/cpu-features/deps/cpu_features/include/cpuinfo_s390x.h +0 -108
  122. package/node_modules/cpu-features/deps/cpu_features/include/cpuinfo_x86.h +0 -288
  123. package/node_modules/cpu-features/deps/cpu_features/include/internal/bit_utils.h +0 -40
  124. package/node_modules/cpu-features/deps/cpu_features/include/internal/cpuid_x86.h +0 -37
  125. package/node_modules/cpu-features/deps/cpu_features/include/internal/filesystem.h +0 -39
  126. package/node_modules/cpu-features/deps/cpu_features/include/internal/hwcaps.h +0 -240
  127. package/node_modules/cpu-features/deps/cpu_features/include/internal/stack_line_reader.h +0 -49
  128. package/node_modules/cpu-features/deps/cpu_features/include/internal/string_view.h +0 -110
  129. package/node_modules/cpu-features/deps/cpu_features/include/internal/windows_utils.h +0 -70
  130. package/node_modules/cpu-features/deps/cpu_features/ndk_compat/CMakeLists.txt +0 -60
  131. package/node_modules/cpu-features/deps/cpu_features/ndk_compat/README.md +0 -4
  132. package/node_modules/cpu-features/deps/cpu_features/ndk_compat/cpu-features.c +0 -205
  133. package/node_modules/cpu-features/deps/cpu_features/ndk_compat/cpu-features.h +0 -320
  134. package/node_modules/cpu-features/deps/cpu_features/ndk_compat/ndk-compat-test.c +0 -12
  135. package/node_modules/cpu-features/deps/cpu_features/patches/0001-Add-Apple-Silicon-Support.patch +0 -456
  136. package/node_modules/cpu-features/deps/cpu_features/scripts/generate_badges.d +0 -165
  137. package/node_modules/cpu-features/deps/cpu_features/scripts/make_release.sh +0 -75
  138. package/node_modules/cpu-features/deps/cpu_features/scripts/run_integration.sh +0 -490
  139. package/node_modules/cpu-features/deps/cpu_features/scripts/test_integration.sh +0 -79
  140. package/node_modules/cpu-features/deps/cpu_features/src/copy.inl +0 -19
  141. package/node_modules/cpu-features/deps/cpu_features/src/define_introspection.inl +0 -86
  142. package/node_modules/cpu-features/deps/cpu_features/src/define_introspection_and_hwcaps.inl +0 -26
  143. package/node_modules/cpu-features/deps/cpu_features/src/equals.inl +0 -22
  144. package/node_modules/cpu-features/deps/cpu_features/src/filesystem.c +0 -62
  145. package/node_modules/cpu-features/deps/cpu_features/src/hwcaps.c +0 -169
  146. package/node_modules/cpu-features/deps/cpu_features/src/impl_aarch64__base_implementation.inl +0 -88
  147. package/node_modules/cpu-features/deps/cpu_features/src/impl_aarch64_linux_or_android.c +0 -79
  148. package/node_modules/cpu-features/deps/cpu_features/src/impl_aarch64_macos_or_iphone.c +0 -82
  149. package/node_modules/cpu-features/deps/cpu_features/src/impl_aarch64_windows.c +0 -138
  150. package/node_modules/cpu-features/deps/cpu_features/src/impl_arm_linux_or_android.c +0 -212
  151. package/node_modules/cpu-features/deps/cpu_features/src/impl_mips_linux_or_android.c +0 -93
  152. package/node_modules/cpu-features/deps/cpu_features/src/impl_ppc_linux.c +0 -163
  153. package/node_modules/cpu-features/deps/cpu_features/src/impl_riscv_linux.c +0 -111
  154. package/node_modules/cpu-features/deps/cpu_features/src/impl_s390x_linux.c +0 -120
  155. package/node_modules/cpu-features/deps/cpu_features/src/impl_x86__base_implementation.inl +0 -2055
  156. package/node_modules/cpu-features/deps/cpu_features/src/impl_x86_freebsd.c +0 -68
  157. package/node_modules/cpu-features/deps/cpu_features/src/impl_x86_linux_or_android.c +0 -58
  158. package/node_modules/cpu-features/deps/cpu_features/src/impl_x86_macos.c +0 -57
  159. package/node_modules/cpu-features/deps/cpu_features/src/impl_x86_windows.c +0 -58
  160. package/node_modules/cpu-features/deps/cpu_features/src/stack_line_reader.c +0 -132
  161. package/node_modules/cpu-features/deps/cpu_features/src/string_view.c +0 -192
  162. package/node_modules/cpu-features/deps/cpu_features/src/utils/list_cpu_features.c +0 -461
  163. package/node_modules/cpu-features/deps/cpu_features/test/CMakeLists.txt +0 -114
  164. package/node_modules/cpu-features/deps/cpu_features/test/bit_utils_test.cc +0 -53
  165. package/node_modules/cpu-features/deps/cpu_features/test/cpuinfo_aarch64_test.cc +0 -396
  166. package/node_modules/cpu-features/deps/cpu_features/test/cpuinfo_arm_test.cc +0 -384
  167. package/node_modules/cpu-features/deps/cpu_features/test/cpuinfo_mips_test.cc +0 -176
  168. package/node_modules/cpu-features/deps/cpu_features/test/cpuinfo_ppc_test.cc +0 -131
  169. package/node_modules/cpu-features/deps/cpu_features/test/cpuinfo_riscv_test.cc +0 -180
  170. package/node_modules/cpu-features/deps/cpu_features/test/cpuinfo_s390x_test.cc +0 -82
  171. package/node_modules/cpu-features/deps/cpu_features/test/cpuinfo_x86_test.cc +0 -1729
  172. package/node_modules/cpu-features/deps/cpu_features/test/filesystem_for_testing.cc +0 -103
  173. package/node_modules/cpu-features/deps/cpu_features/test/filesystem_for_testing.h +0 -61
  174. package/node_modules/cpu-features/deps/cpu_features/test/hwcaps_for_testing.cc +0 -52
  175. package/node_modules/cpu-features/deps/cpu_features/test/hwcaps_for_testing.h +0 -31
  176. package/node_modules/cpu-features/deps/cpu_features/test/stack_line_reader_test.cc +0 -132
  177. package/node_modules/cpu-features/deps/cpu_features/test/string_view_test.cc +0 -202
  178. package/node_modules/cpu-features/lib/index.js +0 -5
  179. package/node_modules/cpu-features/package.json +0 -40
  180. package/node_modules/cpu-features/src/binding.cc +0 -151
  181. package/node_modules/cpu-features/test/test.js +0 -12
@@ -1,250 +0,0 @@
1
- // Copyright 2017 - Refael Ackermann
2
- // Distributed under MIT style license
3
- // See accompanying file LICENSE at https://github.com/node4good/windows-autoconf
4
-
5
- // Usage:
6
- // powershell -ExecutionPolicy Unrestricted -Command "Add-Type -Path Find-VisualStudio.cs; [VisualStudioConfiguration.Main]::PrintJson()"
7
- // This script needs to be compatible with PowerShell v2 to run on Windows 2008R2 and Windows 7.
8
-
9
- using System;
10
- using System.Text;
11
- using System.Runtime.InteropServices;
12
- using System.Collections.Generic;
13
-
14
- namespace VisualStudioConfiguration
15
- {
16
- [Flags]
17
- public enum InstanceState : uint
18
- {
19
- None = 0,
20
- Local = 1,
21
- Registered = 2,
22
- NoRebootRequired = 4,
23
- NoErrors = 8,
24
- Complete = 4294967295,
25
- }
26
-
27
- [Guid("6380BCFF-41D3-4B2E-8B2E-BF8A6810C848")]
28
- [InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
29
- [ComImport]
30
- public interface IEnumSetupInstances
31
- {
32
-
33
- void Next([MarshalAs(UnmanagedType.U4), In] int celt,
34
- [MarshalAs(UnmanagedType.LPArray, ArraySubType = UnmanagedType.Interface), Out] ISetupInstance[] rgelt,
35
- [MarshalAs(UnmanagedType.U4)] out int pceltFetched);
36
-
37
- void Skip([MarshalAs(UnmanagedType.U4), In] int celt);
38
-
39
- void Reset();
40
-
41
- [return: MarshalAs(UnmanagedType.Interface)]
42
- IEnumSetupInstances Clone();
43
- }
44
-
45
- [Guid("42843719-DB4C-46C2-8E7C-64F1816EFD5B")]
46
- [InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
47
- [ComImport]
48
- public interface ISetupConfiguration
49
- {
50
- }
51
-
52
- [Guid("26AAB78C-4A60-49D6-AF3B-3C35BC93365D")]
53
- [InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
54
- [ComImport]
55
- public interface ISetupConfiguration2 : ISetupConfiguration
56
- {
57
-
58
- [return: MarshalAs(UnmanagedType.Interface)]
59
- IEnumSetupInstances EnumInstances();
60
-
61
- [return: MarshalAs(UnmanagedType.Interface)]
62
- ISetupInstance GetInstanceForCurrentProcess();
63
-
64
- [return: MarshalAs(UnmanagedType.Interface)]
65
- ISetupInstance GetInstanceForPath([MarshalAs(UnmanagedType.LPWStr), In] string path);
66
-
67
- [return: MarshalAs(UnmanagedType.Interface)]
68
- IEnumSetupInstances EnumAllInstances();
69
- }
70
-
71
- [Guid("B41463C3-8866-43B5-BC33-2B0676F7F42E")]
72
- [InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
73
- [ComImport]
74
- public interface ISetupInstance
75
- {
76
- }
77
-
78
- [Guid("89143C9A-05AF-49B0-B717-72E218A2185C")]
79
- [InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
80
- [ComImport]
81
- public interface ISetupInstance2 : ISetupInstance
82
- {
83
- [return: MarshalAs(UnmanagedType.BStr)]
84
- string GetInstanceId();
85
-
86
- [return: MarshalAs(UnmanagedType.Struct)]
87
- System.Runtime.InteropServices.ComTypes.FILETIME GetInstallDate();
88
-
89
- [return: MarshalAs(UnmanagedType.BStr)]
90
- string GetInstallationName();
91
-
92
- [return: MarshalAs(UnmanagedType.BStr)]
93
- string GetInstallationPath();
94
-
95
- [return: MarshalAs(UnmanagedType.BStr)]
96
- string GetInstallationVersion();
97
-
98
- [return: MarshalAs(UnmanagedType.BStr)]
99
- string GetDisplayName([MarshalAs(UnmanagedType.U4), In] int lcid);
100
-
101
- [return: MarshalAs(UnmanagedType.BStr)]
102
- string GetDescription([MarshalAs(UnmanagedType.U4), In] int lcid);
103
-
104
- [return: MarshalAs(UnmanagedType.BStr)]
105
- string ResolvePath([MarshalAs(UnmanagedType.LPWStr), In] string pwszRelativePath);
106
-
107
- [return: MarshalAs(UnmanagedType.U4)]
108
- InstanceState GetState();
109
-
110
- [return: MarshalAs(UnmanagedType.SafeArray, SafeArraySubType = VarEnum.VT_UNKNOWN)]
111
- ISetupPackageReference[] GetPackages();
112
-
113
- ISetupPackageReference GetProduct();
114
-
115
- [return: MarshalAs(UnmanagedType.BStr)]
116
- string GetProductPath();
117
-
118
- [return: MarshalAs(UnmanagedType.VariantBool)]
119
- bool IsLaunchable();
120
-
121
- [return: MarshalAs(UnmanagedType.VariantBool)]
122
- bool IsComplete();
123
-
124
- [return: MarshalAs(UnmanagedType.SafeArray, SafeArraySubType = VarEnum.VT_UNKNOWN)]
125
- ISetupPropertyStore GetProperties();
126
-
127
- [return: MarshalAs(UnmanagedType.BStr)]
128
- string GetEnginePath();
129
- }
130
-
131
- [Guid("DA8D8A16-B2B6-4487-A2F1-594CCCCD6BF5")]
132
- [InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
133
- [ComImport]
134
- public interface ISetupPackageReference
135
- {
136
-
137
- [return: MarshalAs(UnmanagedType.BStr)]
138
- string GetId();
139
-
140
- [return: MarshalAs(UnmanagedType.BStr)]
141
- string GetVersion();
142
-
143
- [return: MarshalAs(UnmanagedType.BStr)]
144
- string GetChip();
145
-
146
- [return: MarshalAs(UnmanagedType.BStr)]
147
- string GetLanguage();
148
-
149
- [return: MarshalAs(UnmanagedType.BStr)]
150
- string GetBranch();
151
-
152
- [return: MarshalAs(UnmanagedType.BStr)]
153
- string GetType();
154
-
155
- [return: MarshalAs(UnmanagedType.BStr)]
156
- string GetUniqueId();
157
-
158
- [return: MarshalAs(UnmanagedType.VariantBool)]
159
- bool GetIsExtension();
160
- }
161
-
162
- [Guid("c601c175-a3be-44bc-91f6-4568d230fc83")]
163
- [InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
164
- [ComImport]
165
- public interface ISetupPropertyStore
166
- {
167
-
168
- [return: MarshalAs(UnmanagedType.SafeArray, SafeArraySubType = VarEnum.VT_BSTR)]
169
- string[] GetNames();
170
-
171
- object GetValue([MarshalAs(UnmanagedType.LPWStr), In] string pwszName);
172
- }
173
-
174
- [Guid("42843719-DB4C-46C2-8E7C-64F1816EFD5B")]
175
- [CoClass(typeof(SetupConfigurationClass))]
176
- [ComImport]
177
- public interface SetupConfiguration : ISetupConfiguration2, ISetupConfiguration
178
- {
179
- }
180
-
181
- [Guid("177F0C4A-1CD3-4DE7-A32C-71DBBB9FA36D")]
182
- [ClassInterface(ClassInterfaceType.None)]
183
- [ComImport]
184
- public class SetupConfigurationClass
185
- {
186
- }
187
-
188
- public static class Main
189
- {
190
- public static void PrintJson()
191
- {
192
- ISetupConfiguration query = new SetupConfiguration();
193
- ISetupConfiguration2 query2 = (ISetupConfiguration2)query;
194
- IEnumSetupInstances e = query2.EnumAllInstances();
195
-
196
- int pceltFetched;
197
- ISetupInstance2[] rgelt = new ISetupInstance2[1];
198
- List<string> instances = new List<string>();
199
- while (true)
200
- {
201
- e.Next(1, rgelt, out pceltFetched);
202
- if (pceltFetched <= 0)
203
- {
204
- Console.WriteLine(String.Format("[{0}]", string.Join(",", instances.ToArray())));
205
- return;
206
- }
207
-
208
- try
209
- {
210
- instances.Add(InstanceJson(rgelt[0]));
211
- }
212
- catch (COMException)
213
- {
214
- // Ignore instances that can't be queried.
215
- }
216
- }
217
- }
218
-
219
- private static string JsonString(string s)
220
- {
221
- return "\"" + s.Replace("\\", "\\\\").Replace("\"", "\\\"") + "\"";
222
- }
223
-
224
- private static string InstanceJson(ISetupInstance2 setupInstance2)
225
- {
226
- // Visual Studio component directory:
227
- // https://docs.microsoft.com/en-us/visualstudio/install/workload-and-component-ids
228
-
229
- StringBuilder json = new StringBuilder();
230
- json.Append("{");
231
-
232
- string path = JsonString(setupInstance2.GetInstallationPath());
233
- json.Append(String.Format("\"path\":{0},", path));
234
-
235
- string version = JsonString(setupInstance2.GetInstallationVersion());
236
- json.Append(String.Format("\"version\":{0},", version));
237
-
238
- List<string> packages = new List<string>();
239
- foreach (ISetupPackageReference package in setupInstance2.GetPackages())
240
- {
241
- string id = JsonString(package.GetId());
242
- packages.Add(id);
243
- }
244
- json.Append(String.Format("\"packages\":[{0}]", string.Join(",", packages.ToArray())));
245
-
246
- json.Append("}");
247
- return json.ToString();
248
- }
249
- }
250
- }
@@ -1,361 +0,0 @@
1
- 'use strict';
2
-
3
- const { execFileSync } = require('child_process');
4
- const { readFileSync, statSync } = require('fs');
5
- const { win32: path } = require('path');
6
-
7
- const modernMSBuildPath = (() => {
8
- let arch;
9
- switch (process.arch) {
10
- case 'x64':
11
- arch = 'amd64';
12
- break;
13
- case 'arm64':
14
- arch = process.arch;
15
- break;
16
- default:
17
- arch = '';
18
- }
19
- return path.join('MSBuild', 'Current', 'Bin', arch, 'MSBuild.exe');
20
- })();
21
- const VS_VERSIONS_MODERN = new Map([
22
- [15, {
23
- year: 2017,
24
- msbuild: path.join('MSBuild', '15.0', 'Bin', 'MSBuild.exe'),
25
- toolset: 'v141',
26
- }],
27
- [16, {
28
- year: 2019,
29
- msbuild: path.join('MSBuild', 'Current', 'Bin', 'MSBuild.exe'),
30
- toolset: 'v142',
31
- }],
32
- [17, {
33
- year: 2022,
34
- msbuild: modernMSBuildPath,
35
- toolset: 'v143',
36
- }],
37
- [18, {
38
- year: 2026,
39
- msbuild: modernMSBuildPath,
40
- toolset: 'v145',
41
- }],
42
- ]);
43
- const PACKAGES = {
44
- msbuild: /^Microsoft[.]VisualStudio[.]VC[.]MSBuild[.](?:v\d+[.])?Base$/i,
45
- vctools: /^Microsoft[.]VisualStudio[.]Component[.]VC[.]Tools[.](x86[.]x64|ARM64)$/i,
46
- express: /^Microsoft[.]VisualStudio[.]WDExpress$/i,
47
- winsdk:
48
- /^Microsoft[.]VisualStudio[.]Component[.]Windows(81|10|11)SDK(?:[.](\d+)(?:[.]Desktop.*)?)?$/,
49
- };
50
- const SDK_REG = 'HKLM\\Software\\Microsoft\\Microsoft SDKs\\Windows';
51
- const SDK32_REG =
52
- 'HKLM\\Software\\Wow6432Node\\Microsoft\\Microsoft SDKs\\Windows';
53
-
54
- function checkRequiredPackages(packages) {
55
- if (!Array.isArray(packages))
56
- return false;
57
-
58
- let foundMSBuild = false;
59
- let foundVCTools = false;
60
- let foundExpress = false;
61
- for (const pkg of packages) {
62
- if (!foundMSBuild && PACKAGES.msbuild.test(pkg))
63
- foundMSBuild = true;
64
- else if (!foundVCTools && PACKAGES.vctools.test(pkg))
65
- foundVCTools = true;
66
- else if (!foundExpress && PACKAGES.express.test(pkg))
67
- foundExpress = true;
68
-
69
- if (foundMSBuild && (foundVCTools || foundExpress))
70
- return true;
71
- }
72
- }
73
-
74
- // Sorts newest to oldest
75
- function versionStringCompare(a, b) {
76
- const splitA = a.split('.');
77
- const splitB = b.split('.');
78
- const len = Math.min(splitA.length, splitB.length);
79
- for (let i = 0; i < len; ++i) {
80
- const nA = parseInt(splitA[i], 10);
81
- const nB = parseInt(splitB[i], 10);
82
- if (nA > nB)
83
- return -1;
84
- if (nA < nB)
85
- return 1;
86
- }
87
- if (splitA.length > splitB.length)
88
- return -1;
89
- else if (splitA.length < splitB.length)
90
- return 1;
91
- return 0;
92
- }
93
-
94
- function sdkVersionCompare(a, b) {
95
- return versionStringCompare(a.fullVersion, b.fullVersion);
96
- }
97
-
98
- function getSDKPaths(fullVer) {
99
- if (typeof fullVer !== 'string' || !fullVer)
100
- return;
101
- try {
102
- const arch = (process.arch === 'ia32' ? 'x86' : process.arch);
103
- const shortVer = `v${/^\d+[.]\d+/.exec(fullVer)[0]}`;
104
- let verPath = getRegValue(`${SDK_REG}\\${shortVer}`, 'InstallationFolder');
105
- if (!verPath)
106
- verPath = getRegValue(`${SDK32_REG}\\${shortVer}`, 'InstallationFolder');
107
- if (!verPath)
108
- return;
109
-
110
- // Includes
111
- const includePaths = [];
112
- for (const type of ['shared', 'um', 'ucrt']) {
113
- const testPath = path.resolve(verPath, 'Include', fullVer, type);
114
- statSync(testPath);
115
- includePaths.push(testPath);
116
- }
117
-
118
- // Libraries
119
- const libPaths = [];
120
- for (const type of ['um', 'ucrt']) {
121
- const testPath = path.resolve(verPath, 'Lib', fullVer, type, arch);
122
- statSync(testPath);
123
- libPaths.push(testPath);
124
- }
125
-
126
- return { includePaths, libPaths };
127
- } catch {}
128
- }
129
-
130
- const execOpts = {
131
- encoding: 'utf8',
132
- stdio: ['ignore', 'pipe', 'pipe'],
133
- windowsHide: true,
134
- };
135
-
136
- function findModernVS() {
137
- const versions = [];
138
- const ps = path.join(
139
- process.env.SystemRoot,
140
- 'System32',
141
- 'WindowsPowerShell',
142
- 'v1.0',
143
- 'powershell.exe'
144
- );
145
- const cs = path.resolve(__dirname, '..', 'deps', 'Find-VisualStudio.cs');
146
- const args = [
147
- '-ExecutionPolicy',
148
- 'Unrestricted',
149
- '-NoProfile',
150
- '-Command',
151
- `&{Add-Type -Path '${cs}';[VisualStudioConfiguration.Main]::PrintJson()}`
152
- ];
153
- try {
154
- const out = execFileSync(ps, args, execOpts);
155
- const info = JSON.parse(out);
156
- if (Array.isArray(info)) {
157
- for (const vs of info) {
158
- const vsPath = path.resolve(vs.path);
159
- let vsVer = /^(?<major>\d+)[.](?<minor>\d+)[.]/.exec(vs.version);
160
- if (!vsVer)
161
- continue;
162
- vsVer = {
163
- full: vs.version,
164
- major: +vsVer.groups.major,
165
- minor: +vsVer.groups.minor,
166
- };
167
- const verInfo = VS_VERSIONS_MODERN.get(vsVer.major);
168
- if (verInfo === undefined)
169
- continue;
170
- if (!checkRequiredPackages(vs.packages))
171
- continue;
172
- const vsSDKs = [];
173
- for (const pkg of vs.packages) {
174
- let fullVersion;
175
- let version;
176
- const m = PACKAGES.winsdk.exec(pkg);
177
- if (!m)
178
- continue;
179
- const sdk = m[1];
180
- switch (sdk) {
181
- case '81':
182
- fullVersion = version = '8.1';
183
- break;
184
- case '10':
185
- case '11': {
186
- if (m[2] === undefined)
187
- continue;
188
- const sdkVer = parseInt(m[2], 10);
189
- if (!isFinite(sdkVer) || sdkVer < 0)
190
- continue;
191
- fullVersion = `10.0.${sdkVer}.0`;
192
- version = '10.0';
193
- break;
194
- }
195
- }
196
- const paths = getSDKPaths(fullVersion);
197
- if (!paths)
198
- continue;
199
- vsSDKs.push({
200
- version,
201
- fullVersion,
202
- ...paths,
203
- });
204
- }
205
- if (vsSDKs.length === 0)
206
- continue;
207
- let clPath;
208
- const includePaths = [];
209
- const libPaths = [];
210
- try {
211
- let vcVerFile;
212
- let clVer;
213
- try {
214
- vcVerFile = path.join(
215
- vsPath,
216
- 'VC',
217
- 'Auxiliary',
218
- 'Build',
219
- `Microsoft.VCToolsVersion.${verInfo.toolset}.default.txt`
220
- );
221
- clVer = readFileSync(vcVerFile, { encoding: 'utf8' }).trim();
222
- } catch {}
223
- if (!clVer) {
224
- vcVerFile = path.join(
225
- vsPath,
226
- 'VC',
227
- 'Auxiliary',
228
- 'Build',
229
- 'Microsoft.VCToolsVersion.default.txt'
230
- );
231
- clVer = readFileSync(vcVerFile, { encoding: 'utf8' }).trim();
232
- }
233
- const arch = (process.arch === 'ia32' ? 'x86' : process.arch);
234
- let testPath = path.join(
235
- vsPath,
236
- 'VC',
237
- 'Tools',
238
- 'MSVC',
239
- clVer,
240
- 'bin',
241
- `Host${arch}`,
242
- arch,
243
- 'cl.exe'
244
- );
245
- statSync(testPath);
246
- clPath = testPath;
247
-
248
- testPath = path.join(
249
- vsPath,
250
- 'VC',
251
- 'Tools',
252
- 'MSVC',
253
- clVer,
254
- 'include'
255
- );
256
- statSync(testPath);
257
- includePaths.push(testPath);
258
-
259
- testPath = path.join(
260
- vsPath,
261
- 'VC',
262
- 'Tools',
263
- 'MSVC',
264
- clVer,
265
- 'lib',
266
- arch
267
- );
268
- statSync(testPath);
269
- libPaths.push(testPath);
270
- } catch {
271
- continue;
272
- }
273
- vsSDKs.sort(sdkVersionCompare);
274
- versions.push({
275
- path: vsPath,
276
- version: vsVer,
277
- sdks: vsSDKs,
278
- ...verInfo,
279
- msbuild: path.join(vsPath, verInfo.msbuild),
280
- cl: clPath,
281
- includePaths,
282
- libPaths,
283
- });
284
- }
285
- }
286
- } catch {}
287
- return versions;
288
- }
289
-
290
- const VS_VERSIONS_OLDER = [
291
- {
292
- version: { full: '12.0', major: 12, minor: 0 },
293
- year: 2013,
294
- toolset: 'v120',
295
- },
296
- {
297
- version: { full: '14.0', major: 14, minor: 0 },
298
- year: 2015,
299
- toolset: 'v140',
300
- },
301
- ];
302
-
303
- const VC_REG = 'HKLM\\Software\\Microsoft\\VisualStudio\\SxS\\VC7';
304
- const VC32_REG =
305
- 'HKLM\\Software\\Wow6432Node\\Microsoft\\VisualStudio\\SxS\\VC7';
306
- const MSBUILD_REG = 'HKLM\\Software\\Microsoft\\MSBuild\\ToolsVersions';
307
-
308
- function getRegValue(key, value, use32) {
309
- const extraArgs = (use32 ? [ '/reg:32' ] : []);
310
- const regexp = new RegExp(`^\\s+${value}\\s+REG_\\w+\\s+(\\S.*)$`, 'im');
311
- const reg = path.join(process.env.SystemRoot, 'System32', 'reg.exe');
312
- const args = [ 'query', key, '/v', value, ...extraArgs ];
313
-
314
- try {
315
- const out = execFileSync(reg, args, execOpts);
316
- const m = regexp.exec(out);
317
- if (m)
318
- return m[1];
319
- } catch {}
320
- }
321
-
322
- function findOlderVS() {
323
- const versions = [];
324
- try {
325
- for (const vs of VS_VERSIONS_OLDER) {
326
- let vsPath = getRegValue(VC_REG, vs.version.full);
327
- if (!vsPath)
328
- vsPath = getRegValue(VC32_REG, vs.version.full);
329
- if (!vsPath)
330
- continue;
331
- vsPath = path.resolve(vsPath, '..');
332
-
333
- const msbuildPath = getRegValue(
334
- `${MSBUILD_REG}\\${vs.version.full}`,
335
- 'MSBuildToolsPath',
336
- (process.arch === 'ia32')
337
- );
338
- if (!msbuildPath)
339
- continue;
340
- versions.push({
341
- path: vsPath,
342
- ...vs,
343
- msbuild: path.join(msbuildPath, 'MSBuild.exe'),
344
- cl: path.join(vsPath, 'VC', 'bin', 'cl.exe'),
345
- includePaths: [path.join(vsPath, 'VC', 'include')],
346
- libPaths: [path.join(vsPath, 'VC', 'lib')],
347
- sdks: [],
348
- });
349
- }
350
- } catch {}
351
- return versions;
352
- }
353
-
354
- module.exports = () => {
355
- const versions = findModernVS().concat(findOlderVS());
356
- // Sorts newest to oldest
357
- versions.sort((a, b) => {
358
- return versionStringCompare(a.version.full, b.version.full);
359
- });
360
- return versions;
361
- };