1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

tools/vsymlink: use the win32 api to update the system environment

This commit is contained in:
Ryan Willis
2020-06-08 00:19:31 -07:00
committed by GitHub
parent 0058b8253d
commit 08814d6de4
3 changed files with 152 additions and 56 deletions

View File

@@ -202,6 +202,10 @@ fn C.SetHandleInformation(hObject voidptr, dwMask u32, dw_flags u32) bool
fn C.ExpandEnvironmentStringsW(lpSrc &u16, lpDst &u16, nSize u32) u32
fn C.SendMessageTimeout() u32
fn C.SendMessageTimeoutW(hWnd voidptr, Msg u32, wParam &u16, lParam &u32, fuFlags u32, uTimeout u32, lpdwResult &u64) u32
fn C.CreateProcessW(lpApplicationName &u16, lpCommandLine &u16, lpProcessAttributes voidptr, lpThreadAttributes voidptr, bInheritHandles bool, dwCreationFlags u32, lpEnvironment voidptr, lpCurrentDirectory &u16, lpStartupInfo voidptr, lpProcessInformation voidptr) bool
@@ -211,18 +215,21 @@ fn C.ReadFile(hFile voidptr, lpBuffer voidptr, nNumberOfBytesToRead u32, lpNumbe
fn C.GetFileAttributesW(lpFileName byteptr) u32
fn C.RegQueryValueEx() voidptr
fn C.RegQueryValueExW(hKey voidptr, lpValueName &u16, lp_reserved &u32, lpType &u32, lpData byteptr, lpcbData &u32) int
fn C.RegOpenKeyEx() voidptr
fn C.RegOpenKeyExW(hKey voidptr, lpSubKey &u16, ulOptions u32, samDesired u32, phkResult voidptr) int
fn C.RegSetValueEx() voidptr
fn C.RegSetValueExW(hKey voidptr, lpValueName &u16, Reserved u32, dwType u32, lpData byteptr, lpcbData u32) int
fn C.RegCloseKey()
fn C.RegQueryValueEx() voidptr
fn C.RemoveDirectory() int
@@ -338,7 +345,6 @@ fn C.CloseHandle()
fn C.GetExitCodeProcess()
fn C.RegOpenKeyEx() voidptr
fn C.GetTickCount() i64

View File

@@ -118,7 +118,7 @@ fn find_windows_kit_root(host_arch string) ?WindowsKit {
shared_include_path: kit_include_highest + '\\shared'
}
}
return error('Host OS does not support funding a windows kit')
return error('Host OS does not support finding a windows kit')
}
struct VsInstallation {
@@ -129,7 +129,7 @@ struct VsInstallation {
fn find_vs(vswhere_dir, host_arch string) ?VsInstallation {
$if !windows {
return error('Host OS does not support finding a Vs installation')
return error('Host OS does not support finding a Visual Studio installation')
}
// Emily:
// VSWhere is guaranteed to be installed at this location now