Skip to content

Commit 696db04

Browse files
committed
Add detect Windows version
1 parent 44ea850 commit 696db04

File tree

3 files changed

+31
-35
lines changed

3 files changed

+31
-35
lines changed

extra/README.md

+1-4
Original file line numberDiff line numberDiff line change
@@ -31,12 +31,9 @@ git clone https://github.com/rdp/ffmpeg-windows-build-helpers
3131
cd ffmpeg-windows-build-helpers
3232
3333
# Windows 11 WLS Ubuntu
34+
# Windows 10 WLS Ubuntu
3435
./extra/make.sh
3536
36-
or
37-
38-
# Windows 10 WLS Ubuntu
39-
./extra/make_win10.sh
4037
4138
* FFmpeg is Win64 (64-bit only).
4239
Edit ./extra/build.sh if you want the 32-bit version .

extra/make.sh

+30-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,28 @@
33
# Copyright (C) 2023 FREE WING,Y.Sakamoto, the script is under the GPLv3, but output FFmpeg's executables aren't
44
# set -x
55

6-
echo "FFmpeg for Windows 11"
6+
WIN_VER=""
7+
WIN_CMD_EXE=/mnt/c/Windows/System32/cmd.exe
8+
if [ -e $WIN_CMD_EXE ]; then
9+
sudo sh -c "echo 1 > /proc/sys/fs/binfmt_misc/WSLInterop"
10+
11+
$WIN_CMD_EXE /C "VER" | grep "Version 11"
12+
if [ $? = 0 ]; then
13+
WIN_VER="11"
14+
fi
15+
16+
$WIN_CMD_EXE /C "VER" | grep "Version 10"
17+
if [ $? = 0 ]; then
18+
WIN_VER="10"
19+
fi
20+
fi
21+
22+
if [ -z "$WIN_VER" ]; then
23+
echo "Can't detect Windows Version"
24+
exit 1
25+
fi
26+
27+
echo "FFmpeg for Windows $WIN_VER"
728
echo "Make file for WSL Ubuntu"
829

930
# WSL Debian
@@ -18,6 +39,14 @@ grep -E "^9" /etc/debian_version && echo "Not Support Windows 10 WSL Debian 9.x"
1839

1940
bash ./extra/wsl_patch.sh
2041

42+
if [ "$WIN_VER" = "10" ]; then
43+
echo "Windows 10 Ubuntu 20.04 Trouble patch"
44+
bash ./extra/wsl_win10_ubuntu_2004_patch.sh
45+
46+
echo "Windows 10 Ubuntu 20.04 Trouble patch"
47+
bash ./extra/disable_git_sslverify.sh
48+
fi
49+
2150
echo $'\a'
2251
bash ./extra/build.sh
2352
echo $'\a'

extra/make_win10.sh

-30
This file was deleted.

0 commit comments

Comments
 (0)