mirror of
https://github.com/envmodules/modules.git
synced 2026-06-18 00:06:53 +08:00
install: provide a basic uninstall script for Windows
This commit is contained in:
1
Makefile
1
Makefile
@@ -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
21
UNINSTALL.bat
Normal 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:
|
||||
Reference in New Issue
Block a user