mirror of
https://github.com/mintty/wsltty.git
synced 2025-11-03 08:31:51 +00:00
Compare commits
9 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
be4e7fef44 | ||
|
|
a2df28017b | ||
|
|
09972471b9 | ||
|
|
c13340b328 | ||
|
|
8d7ffa75bb | ||
|
|
305fd0f273 | ||
|
|
fb1bf601e9 | ||
|
|
adc7036609 | ||
|
|
fef944e1bb |
40
0012-get-vmid-from-registry.patch
Normal file
40
0012-get-vmid-from-registry.patch
Normal file
@@ -0,0 +1,40 @@
|
||||
--- wslbridge2/src/wslbridge2.cpp 2024-10-10 20:20:21.931891800 +0000
|
||||
+++ wslbridge2-0.12/src/wslbridge2.cpp 2024-10-08 09:31:35.954145800 +0000
|
||||
@@ -228,6 +228,26 @@ static void start_dummy(std::wstring wsl
|
||||
CloseHandle(pi.hThread);
|
||||
}
|
||||
|
||||
+bool GetIdFromRegistry(GUID *guid) {
|
||||
+ HKEY hKeyRoot = HKEY_LOCAL_MACHINE;
|
||||
+ std::wstring subKey = L"SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\HostComputeService\\VolatileStore\\ComputeSystem";
|
||||
+ HKEY hKey;
|
||||
+ if (RegOpenKeyEx(hKeyRoot, subKey.c_str(), 0, KEY_READ, &hKey) == ERROR_SUCCESS) {
|
||||
+ DWORD index = 0;
|
||||
+ WCHAR keyName[256];
|
||||
+ DWORD keyNameSize = sizeof(keyName) / sizeof(keyName[0]);
|
||||
+
|
||||
+ while (RegEnumKeyEx(hKey, index, keyName, &keyNameSize, nullptr, nullptr, nullptr, nullptr) == ERROR_SUCCESS) {
|
||||
+ RegCloseKey(hKey);
|
||||
+ std::wstring id = L"{" + std::wstring(keyName) + L"}";
|
||||
+ return IIDFromString(id.c_str(), guid) == S_OK;
|
||||
+ }
|
||||
+ RegCloseKey(hKey);
|
||||
+ }
|
||||
+ return false;
|
||||
+}
|
||||
+
|
||||
+
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
/* Minimum requirement Windows 10 build 17763 aka. version 1809 */
|
||||
@@ -387,8 +407,8 @@ int main(int argc, char *argv[])
|
||||
if (LiftedWSLVersion)
|
||||
start_dummy(wslPath, wslCmdLine, distroName, debugMode);
|
||||
|
||||
- const HRESULT hRes = GetVmId(&DistroId, &VmId, LiftedWSLVersion);
|
||||
- if (hRes != 0)
|
||||
+ const bool hRes = GetIdFromRegistry(&VmId);
|
||||
+ if (!hRes)
|
||||
fatal("GetVmId: %s\n", GetErrorMessage(hRes).c_str());
|
||||
|
||||
inputSock = win_vsock_create();
|
||||
31
makefile
31
makefile
@@ -10,16 +10,16 @@
|
||||
|
||||
|
||||
# wsltty release
|
||||
ver=3.7.1
|
||||
ver=3.7.6
|
||||
|
||||
# wsltty appx release - must have 4 parts!
|
||||
verx=3.7.1.1
|
||||
verx=3.7.6.1
|
||||
|
||||
|
||||
##############################
|
||||
# mintty release version
|
||||
|
||||
minttyver=3.7.1
|
||||
minttyver=3.7.6
|
||||
|
||||
##############################
|
||||
|
||||
@@ -56,7 +56,7 @@ wslbridgedir=wslbridge2-$(wslbridgever)
|
||||
#minttyver=master
|
||||
|
||||
# wslbridge branch or commit to build from source;
|
||||
wslbridge=wslbridge-frontend wslbridge-backend
|
||||
wslbridge=wslbridge-source wslbridge-frontend wslbridge-backend
|
||||
|
||||
##############################
|
||||
# build backend on a musl-libc-based distribution
|
||||
@@ -73,10 +73,15 @@ WINSDKVER=`regtool list '$(WINSDKKEY)' | sed -e '$$ q' -e d`
|
||||
|
||||
all: all-$(notdir $(CURDIR))
|
||||
|
||||
all-wsltty: check pkg
|
||||
# targets and version checking
|
||||
|
||||
all-wsltty: check committed pkg
|
||||
|
||||
all-wsltty.appx: appx
|
||||
|
||||
committed:
|
||||
if git status -suno | sed -e "s,^..,," | grep .; then false; fi
|
||||
|
||||
#############################################################################
|
||||
# target checking and some defs
|
||||
|
||||
@@ -154,8 +159,10 @@ wslbridge-source: $(wslbridgedir).zip
|
||||
#cd $(wslbridgedir); patch -p1 < ../0001-notify-size-change-inband.patch
|
||||
# patch to https://github.com/Biswa96/wslbridge2/commit/41575379b416703c49e2687e957440239a4cdfb7
|
||||
#cd $(wslbridgedir); patch -p0 < ../0002-add-com-for-lifted-wsl.patch
|
||||
# patch to fix WSL 2 launching, again
|
||||
cd $(wslbridgedir); patch -p1 < ../0012-get-vmid-from-registry.patch
|
||||
|
||||
wslbridge-frontend: wslbridge-source
|
||||
wslbridge-frontend:
|
||||
echo ------------- Compiling wslbridge2 frontend
|
||||
mkdir -p bin
|
||||
# frontend build
|
||||
@@ -165,7 +172,7 @@ wslbridge-frontend: wslbridge-source
|
||||
|
||||
windir=$(shell cd "${WINDIR}"; pwd)
|
||||
|
||||
wslbridge-backend: wslbridge-source
|
||||
wslbridge-backend:
|
||||
echo ------------- Compiling wslbridge2 backend
|
||||
#uname -m | grep x86_64
|
||||
mkdir -p bin
|
||||
@@ -176,10 +183,16 @@ wslbridge-backend: wslbridge-source
|
||||
# extract binaries
|
||||
cp $(wslbridgedir)/bin/wslbridge2-backend bin/
|
||||
|
||||
mintty-get:
|
||||
mintty-get: mintty-git # mintty-download or mintty-git
|
||||
cp mintty-$(minttyver)/icon/terminal.ico mintty.ico
|
||||
|
||||
mintty-download:
|
||||
$(wgeto) https://github.com/mintty/mintty/archive/$(minttyver).zip -o mintty-$(minttyver).zip
|
||||
unzip -o mintty-$(minttyver).zip
|
||||
cp mintty-$(minttyver)/icon/terminal.ico mintty.ico
|
||||
|
||||
mintty-git:
|
||||
test -d mintty-$(minttyver) || git clone --depth 111 https://github.com/mintty/mintty.git mintty-$(minttyver)
|
||||
cd mintty-$(minttyver); git checkout $(minttyver)
|
||||
|
||||
wslbuild=LDFLAGS="-static -static-libgcc -s"
|
||||
appxbuild=$(wslbuild) CCOPT=-DWSLTTY_APPX
|
||||
|
||||
Reference in New Issue
Block a user