Improved and fixed installer. No more indiscriminately deleting files.

This commit is contained in:
2017-01-11 02:06:20 +01:00
parent ae23563723
commit f497a30629
3 changed files with 546 additions and 14 deletions
+27
View File
@@ -0,0 +1,27 @@
#!/bin/bash
# Execute this script in the root folder of the install dir
# Dont't forget to set OUTPUTFILE to a path that is writeable
OUTPUTFILE=../../installed_files.txt
INSTALLDIR=.
# Get command line arguments
if [ $# -eq 1 ]; then
OUTPUTFILE=$1
elif [ $# -gt 1 ]; then
OUTPUTFILE=$1
INSTALLDIR=$2
fi
# Find all files
find "$INSTALLDIR" -iname '*' -type f -exec echo "Delete \$INSTDIR/{}" \; > $OUTPUTFILE
# Find all directories and print them out in reverse order
find "$INSTALLDIR" -iname '*' -type d -exec echo "RMdir \$INSTDIR/{}" \; | tac.exe >> $OUTPUTFILE
# Remove "/./" from the file paths
sed -i 's/\/\.//g' $OUTPUTFILE
# Replace "/" with "\"
sed -i 's/\//\\/g' $OUTPUTFILE