forked from nufeng1999/wsl_XWin_Cygwin
-
Notifications
You must be signed in to change notification settings - Fork 0
/
install.sh
executable file
·54 lines (53 loc) · 2.18 KB
/
install.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
#!/bin/bash
#install cygwin XServer
wintemp=`/mnt/c/WINDOWS/System32/cmd.exe /c "echo %TEMP%" 2>/dev/null|head -n 1 |tail -n 1`
winwsltemp=`wslpath -u $wintemp`
winwsltemp=${winwsltemp//$'\r'}
winwsltemp=${winwsltemp//$'\n'}
cygwininstallfile=`echo $winwsltemp/cygwin-install.bat`
cp $PWD/cygwin-auto-install/cygwin-install.bat $cygwininstallfile
cp $PWD/ucrtbase.dll /mnt/c/WINDOWS/System32/
cp $PWD/ucrtbased.dll /mnt/c/WINDOWS/System32/
cp $PWD/vcruntime140.dll /mnt/c/WINDOWS/System32/
cp $PWD/vcruntime140d.dll /mnt/c/WINDOWS/System32/
/mnt/c/WINDOWS/System32/cmd.exe /c "$wintemp\\cygwin-install.bat"
ln -sf $PWD/setguienv.sh /usr/bin/setguienv
ln -sf $PWD/setproxy.sh /usr/bin/setproxy
ln -sf $PWD/unsetproxy.sh /usr/bin/unsetproxy
ln -sf $PWD/startwslX.sh /usr/bin/startwslX
ln -sf $PWD/startXServer.sh /usr/bin/startXServer
ln -sf $PWD/wslfcitx.sh /usr/bin/wslfcitx
ln -sf $PWD/wslibus.sh /usr/bin/wslibus
ln -sf $PWD/wslpanel.sh /usr/bin/wslpanel
ln -sf $PWD/wslstartxfce4.sh /usr/bin/wslstartxfce4
ln -sf $PWD/wslterminator.sh /usr/bin/wslterminator
ln -sf $PWD/setwsl2bridge.sh /usr/bin/setwsl2bridge
ln -sf $PWD/00-wsl2-systemd.sh /usr/bin/wsl2-systemd
ln -sf $PWD/setresolv.sh /usr/bin/setresolv.sh
ln -sf $PWD/restartudev.sh /usr/bin/restartudev
ln -sf $PWD/docker-service.sh /usr/bin/docker-service
ln -sf $PWD/start-xfce4-panel.sh /usr/bin/start-xfce4-panel
ln -sf $PWD/start-xfce4.sh /usr/bin/start-xfce4
chmod +x /usr/bin/setguienv
chmod +x /usr/bin/setproxy
chmod +x /usr/bin/unsetproxy
chmod +x /usr/bin/startwslX
chmod +x /usr/bin/startXServer
chmod +x /usr/bin/wslfcitx
chmod +x /usr/bin/wslibus
chmod +x /usr/bin/wslpanel
chmod +x /usr/bin/wslstartxfce4
chmod +x /usr/bin/wslterminator
chmod +x /usr/bin/setwsl2bridge
chmod +x /usr/bin/wsl2-systemd
chmod +x /usr/bin/setresolv.sh
chmod +x /usr/bin/restartudev
chmod +x /usr/bin/docker-service
/mnt/c/WINDOWS/System32/cmd.exe /c "taskkill /F /IM ISwitch.exe" > /dev/null 2>&1
mkdir -p /mnt/c/ISwitch
cp -f $PWD/ISwitch* /mnt/c/ISwitch/ > /dev/null 2>&1
cp -f $PWD/XWin_Cygwin.cmd /mnt/c/XWin_Cygwin.cmd > /dev/null 2>&1
INCLUDENumber=`grep -i "setguienv" ~/.bashrc|wc -l`
if [ $INCLUDENumber -le 0 ];then
echo '. /usr/bin/setguienv' >> ~/.bashrc
fi