diff --git a/config-distros.sh b/config-distros.sh index 57d76f5..f07d909 100755 --- a/config-distros.sh +++ b/config-distros.sh @@ -197,6 +197,8 @@ do cmd /C del "%LOCALAPPDATA%\\Microsoft\\WindowsApps\\$name.bat" cmd /C del "%LOCALAPPDATA%\\Microsoft\\WindowsApps\\$name~.bat" else + cmd /C copy mkshortcut.bat mkshortcut.vbs + # desktop shortcut in %USERPROFILE% -> Start Menu - WSLtty cscript /nologo mkshortcut.vbs "/name:$name Terminal %" cmd /C copy "$name Terminal %.lnk" "%APPDATA%\\Microsoft\\Windows\\Start Menu\\Programs\\WSLtty" diff --git a/install.bat b/install.bat index 73ab00a..5e34fef 100755 --- a/install.bat +++ b/install.bat @@ -28,7 +28,7 @@ copy "remove from context menu.lnk" "%installdir%" copy "configure WSL shortcuts.lnk" "%installdir%" copy wsl.ico "%installdir%" copy config-distros.sh "%installdir%" -copy mkshortcut.vbs "%installdir%" +copy mkshortcut.bat "%installdir%" if not exist "%installdir%\bin" goto instbin rem move previous programs possibly in use out of the way diff --git a/makefile b/makefile index 90b2b48..950f8ea 100644 --- a/makefile +++ b/makefile @@ -163,7 +163,7 @@ cop: ver cp *.url rel/ cp *.bat rel/ cp *.sh rel/ - cp *.vbs rel/ + #cp *.vbs rel/ cab: cop cd rel; iexpress /n wsltty.SED diff --git a/makewinx.cfg b/makewinx.cfg index bbe08f4..876d774 100644 --- a/makewinx.cfg +++ b/makewinx.cfg @@ -41,7 +41,7 @@ FILE5="LICENSE.mintty" FILE6="LICENSE.wslbridge" FILE7="config-distros.sh" FILE8="configure WSL shortcuts.lnk" -FILE9="mkshortcut.vbs" +FILE9="mkshortcut.bat" FILE10="VERSION" FILE11="dash.exe" FILE12="regtool.exe" diff --git a/mkshortcut.bat b/mkshortcut.bat new file mode 100755 index 0000000..59ef717 --- /dev/null +++ b/mkshortcut.bat @@ -0,0 +1,57 @@ +rem cscript mkshortcut [/param:arg] /target:link + +rem /target:%LOCALAPPDATA%\wsltty\bin\mintty.exe +rem /workingdir:%USERPROFILE% +rem /icon:%LOCALAPPDATA%\wsltty\wsl.ico +rem deprecated: /icon:%LOCALAPPDATA%\lxss\bash.ico +rem deprecated: % +rem /arguments:--wsl -o Locale=C -o Charset=UTF-8 /bin/wslbridge -t /bin/bash +rem deprecated: ~ +rem /arguments:--wsl -o Locale=C -o Charset=UTF-8 /bin/wslbridge -C~ -t /bin/bash +rem deprecated: -l +rem /arguments:--wsl -o Locale=C -o Charset=UTF-8 /bin/wslbridge -t /bin/bash -l + +rem General - Name: +name = Wscript.Arguments.Named("name") & ".lnk" +set wshell = WScript.CreateObject("WScript.Shell") +wscript.echo "Creating " & name +set lnk = wshell.CreateShortcut(name) + +rem Target: +rem lnk.TargetPath = Wscript.Arguments.Named("target") +rem lnk.Arguments = Wscript.Arguments.Named("arguments") + +lnk.TargetPath = wshell.ExpandEnvironmentStrings("%target%") +minttyargs = wshell.ExpandEnvironmentStrings("%minttyargs%") +bridgeargs = wshell.ExpandEnvironmentStrings("%bridgeargs%") +lnk.Arguments = minttyargs & bridgeargs +rem wscript.echo "minttyargs: " & minttyargs +rem wscript.echo lnk.Arguments + +rem Start in: +rem lnk.WorkingDirectory = Wscript.Arguments.Named("workingdir") +lnk.WorkingDirectory = "%USERPROFILE%" + +rem Icon: +rem icon = Wscript.Arguments.Named("icon") +rem rem iconoffset = Wscript.Arguments.Named("iconoffset") +rem rem icon = icon & ", " & iconoffset +icon = wshell.ExpandEnvironmentStrings("%icon%") +rem wscript.echo "icon: " & icon +lnk.IconLocation = icon +rem rem lnk.IconLocation = "%LOCALAPPDATA%\lxss\bash.ico" +rem lnk.IconLocation = "%LOCALAPPDATA%\wsltty\wsl.ico" + +rem Shorcut key: +rem lnk.HotKey = "ALT+CTRL+W" + +rem Run: +rem lnk.WindowStyle = 1 + +rem Comment: +rem lnk.IconLocation = Wscript.Arguments.Named("desc") +rem lnk.Description = "WSLtty" + +lnk.Save +wscript.echo "Created " & name +wscript.echo