install: provide a basic uninstall script for Windows

This commit is contained in:
Xavier Delaruelle
2020-01-17 06:47:17 +01:00
parent d6362eef3d
commit 53d9c95a8c
2 changed files with 22 additions and 0 deletions

View File

@@ -513,6 +513,7 @@ dist-win: modulecmd.tcl ChangeLog README version.inc pkgdoc
cp doc/build/modulefile.txt $(DIST_WIN_PREFIX)/doc/
$(MAKE) -C init dist-win DIST_WIN_PREFIX=../$(DIST_WIN_PREFIX)
cp INSTALL.bat $(DIST_WIN_PREFIX)/
cp UNINSTALL.bat $(DIST_WIN_PREFIX)/
zip -r $(DIST_WIN_PREFIX).zip $(DIST_WIN_PREFIX)
rm -rf $(DIST_WIN_PREFIX)

21
UNINSTALL.bat Normal file
View File

@@ -0,0 +1,21 @@
@echo off
:: installation path can be passed as argument
if [%1]==[] (
set "installpath=%ProgramFiles%\Environment Modules"
) else (
set "installpath=%1"
)
:: remove bin directory from system path
set "binpath=%installpath%\bin"
setlocal enableextensions enabledelayedexpansion
setx /M PATH "!PATH:%binpath%;=!"
if errorlevel 1 ( exit /b 1 )
:: remove installation directory and content
rd /s /q "%installpath%"
:: quit on error if directory still exists
if exist "%installpath%" ( exit /b 2 )
:: vim:set tabstop=3 shiftwidth=3 expandtab autoindent: