diff --git a/install.bat b/install.bat index 05532cf..832e450 100755 --- a/install.bat +++ b/install.bat @@ -1,8 +1,12 @@ @echo off + +:deploy + mkdir "%LOCALAPPDATA%\wsltty" copy LICENSE.mintty "%LOCALAPPDATA%\wsltty" copy LICENSE.wslbridge "%LOCALAPPDATA%\wsltty" +copy uninstall.bat "%LOCALAPPDATA%\wsltty" mkdir "%LOCALAPPDATA%\wsltty\bin" copy cygwin1.dll "%LOCALAPPDATA%\wsltty\bin" @@ -15,6 +19,9 @@ rem create "home directory" to enable storage of config file mkdir "%LOCALAPPDATA%\wsltty\home mkdir "%LOCALAPPDATA%\wsltty\home\%USERNAME%" + +:shortcuts + rem create Desktop Shorcut copy "Bash on UoW in Mintty.lnk" "%USERPROFILE%\Desktop" @@ -23,6 +30,7 @@ copy "Bash on UoW in Mintty.lnk" "%APPDATA%\Microsoft\Windows\Start Menu" :explorer + rem Explorer context menu set userdirname=HKEY_CURRENT_USER\Software\Classes\Directory\shell set userdirpane=HKEY_CURRENT_USER\Software\Classes\Directory\Background\shell @@ -50,3 +58,5 @@ reg add "%userdirpane%\wsltty" /d "%label% %here%" /f reg add "%userdirpane%\wsltty" /v Icon /d "%icon%" /f reg add "%userdirpane%\wsltty\command" /d "%target%" /f + +:end diff --git a/makefile b/makefile index 3c5ebe3..783149f 100644 --- a/makefile +++ b/makefile @@ -59,6 +59,7 @@ pkg: cp LICENSE.wslbridge rel/ cp "Bash on UoW in Mintty.lnk" rel/ cp install.bat rel/ + cp uninstall.bat rel/ cd rel; iexpress /n wsltty.SED ############################################################################# diff --git a/makewinx.cfg b/makewinx.cfg index 452ba0d..867aa6b 100644 --- a/makewinx.cfg +++ b/makewinx.cfg @@ -41,6 +41,7 @@ FILE5="LICENSE.mintty" FILE6="LICENSE.wslbridge" FILE7="Bash on UoW in Mintty.lnk" FILE8="install.bat" +FILE9="uninstall.bat" [SourceFiles] SourceFiles0=. @@ -55,4 +56,5 @@ SourceFiles0=. %FILE6%= %FILE7%= %FILE8%= +%FILE9%= diff --git a/uninstall.bat b/uninstall.bat new file mode 100755 index 0000000..f3b8ee7 --- /dev/null +++ b/uninstall.bat @@ -0,0 +1,27 @@ +@echo off + + +:undeploy + +rem currently not removing software +rem in any case, at least the config file (home\...) should not be removed + + +:shortcuts + +rem delete Desktop Shortcut and Start Menu Shortcut +del "%USERPROFILE%\Desktop\Bash on UoW in Mintty.lnk" +del "%APPDATA%\Microsoft\Windows\Start Menu\Bash on UoW in Mintty.lnk" + + +:explorer + +rem delete Explorer context menu +set userdirname=HKEY_CURRENT_USER\Software\Classes\Directory\shell +set userdirpane=HKEY_CURRENT_USER\Software\Classes\Directory\Background\shell + +reg delete "%userdirname%\wsltty" /f +reg delete "%userdirpane%\wsltty" /f + + +:end