]> git.street.me.uk Git - andy/viking.git/commitdiff
Windows: Script full generation of Windows build from scratch for version 1.4.
authorRob Norris <rw_norris@hotmail.com>
Sun, 3 Feb 2013 22:13:30 +0000 (22:13 +0000)
committerRob Norris <rw_norris@hotmail.com>
Sun, 3 Feb 2013 22:14:06 +0000 (22:14 +0000)
Aim to be able to automate the generation of Windows Viking Installer executable from scratch.
[Preferably from a Linux System using Wine]

Script to setup full Windows build environment (including various work-a-rounds),
 using old but known to work MinGW5.1.6 + gcc3.4.5 compiler and various dependencies.
Miscellaneous scripts to make this work via Wine.

TODO: In the future look to using the current MinGW (Dev System) with gcc4.6+
This should hopefully simplify the auto build environment.

src/Makefile_windows [deleted file]
win32/README.txt
win32/configure_and_make-wine.sh [new file with mode: 0755]
win32/configure_and_make.bat [new file with mode: 0644]
win32/generate_install.sh [new file with mode: 0755]
win32/make-wine.sh [new file with mode: 0755]
win32/make.bat [new file with mode: 0644]
win32/msys-pi-wine.sh [new file with mode: 0755]
win32/msys-pi.bat [new file with mode: 0644]
win32/msys-pi.sh [new file with mode: 0644]
win32/prepare.bat [new file with mode: 0644]

diff --git a/src/Makefile_windows b/src/Makefile_windows
deleted file mode 100644 (file)
index 63ff1dd..0000000
+++ /dev/null
@@ -1,47 +0,0 @@
-# This is the Makefile for the viking gps viewer program.
-# This file is licensed through the GPL version 2 or newer.
-
-ifeq ($shell uname -o),Cygwin)
-CYGWIN = 1
-EXE = .exe
-endif
-
-TARGET=viking$(EXE)
-OBJECTS=viktrack.o vikwaypoint.o clipboard.o coords.o gpsmapper.o gpspoint.o file.o main.o dialog.o http.o viktreeview.o viktrwlayer.o viklayer.o viklayerspanel.o vikcoordlayer.o vikstatus.o vikwindow.o vikviewport.o vikaggregatelayer.o vikgeoreflayer.o vikfileentry.o viktrwlayer_tpwin.o viktrwlayer_propwin.o thumbnails.o background.o vikradiogroup.o vikcoord.o expedia.o mapcache.o vikmapslayer.o terraserver.o gtkcellrendererprogress.o
-
-CCFLAGS = -DWINDOWS -mms-bitfields -Wall -g
-LINKFLAGS = -lwsock32
-
-ifdef DEBUG
-DFLAGS += -g
-endif
-
-all:: viking
-
-.PHONY: all clean realclean depend
-
--include .depend
-
-.compile_config:
-       pkg-config --cflags gtk+-2.0 | sed -e 's/ -I/ -isystem/g' -e 's/^-I/-isystem/g' >$@.tmp
-       mv $@.tmp $@
-.link_config:
-       pkg-config --libs gtk+-2.0 gthread-2.0 >$@.tmp
-       mv $@.tmp $@
-
-clean::
-       rm -f *.o core $(TARGET).core *.tmp
-realclean:: clean
-       rm -f $(TARGET) .depend .compile_config .link_config
-
-$(TARGET): $(OBJECTS) .link_config
-       $(CC) $(LINKFLAGS) -o $@ $(OBJECTS) `cat .link_config`
-%.o: %.c .compile_config
-       $(CC) $(CCFLAGS) -o $@ -c $< `cat .compile_config`
-
-.depend: .compile_config .link_config
-       $(CC) $(CFLAGS) -MM -MG $(OBJECTS:.o=.c) `cat .compile_config` >$@.tmp
-       mv $@.tmp $@
-       @echo dependencys got built.
-depend::
-       @#
index 542aa59189781a8d75d9e0e4f71e7050bf3d22be..158cc5c705871aec406e818f31f9e347d0916eb5 100644 (file)
@@ -11,3 +11,24 @@ To generate the installer (once the code has been compiled as above) run the ins
 \r
 For further details (especially about how to set up the development dependencies) see:\r
 http://sourceforge.net/apps/mediawiki/viking/index.php?title=WindowsBuildInstructions\r
+\r
+These instructions have now been turned turned into a series of scripts to produce the Viking installer:\r
+\r
+1. prepare.bat\r
+2a. configure_and_make.bat\r
+2b. make.bat\r
+3. installer.bat\r
+\r
+The scripts are aimed at a pristine Windows XP installation.\r
+Using *prepare.bat* will attempt to *download* and *install* various Open Source software to aid this process.\r
+An administrator level account is needed to run this which will *modify* your system.\r
+\r
+The other scripts simply make use of these (assumed) available system programs.\r
+\r
+This setup is for dedicated usage to build Viking, primarily under Wine with:\r
+\r
+ ./generate_install.sh\r
+\r
+Such that any Windows system (or of course a Virtual Machine) can be simply deleted (e.g. rm -rf /.wine) and recreated fully via the scripts.\r
+\r
+From Viking 1.4 onwards this is how the Windows viking-W.X.Y.Z.exe installer file is produced.\r
diff --git a/win32/configure_and_make-wine.sh b/win32/configure_and_make-wine.sh
new file mode 100755 (executable)
index 0000000..cc5529c
--- /dev/null
@@ -0,0 +1,7 @@
+#!/bin/sh
+# Note the configure stage under wine** is really slow can easily be over 15 minutes
+# make of the icons is also very slow** - can easily over 5 minutes
+# compartively the make of the actual src code is not too bad
+wine ~/.wine/drive_c/windows/system32/cmd.exe /c configure_and_make.bat
+
+# ** slowness is probably due to lots of forking going on starting many new small processes
diff --git a/win32/configure_and_make.bat b/win32/configure_and_make.bat
new file mode 100644 (file)
index 0000000..4993760
--- /dev/null
@@ -0,0 +1,5 @@
+:: Full build\r
+set PATH=%PATH%;C:\Mingw\bin;C:\msys\1.0\bin\r
+cd ..\\r
+sh configure CFLAGS=-DWINDOWS LIBCURL=-lcurldll LIBS=-lzdll --disable-realtime-gps-tracking --disable-scrollkeeper\r
+make\r
diff --git a/win32/generate_install.sh b/win32/generate_install.sh
new file mode 100755 (executable)
index 0000000..2abec4f
--- /dev/null
@@ -0,0 +1,23 @@
+#!/bin/bash
+# NB Annoyingly pushd/popd are bashisms!
+#
+# You don't want to do this on a previously configured/built Linux source tree
+#  as the build system will get confused so make clean and start again...
+#
+
+# Ensure a basic Windows compatible system is set up
+# Use wget to get wget!
+if [ ! -e ~/.wine/drive_c/Program\ Files/GnuWin32/bin/wget.exe ]; then
+       if [ ! -e cache ]; then
+               mkdir cache
+       fi
+       pushd cache
+       WGET_EXE=wget-1.11.4-1-setup.exe
+       if [ ! -e $WGET_EXE ]; then
+               wget http://downloads.sourceforge.net/gnuwin32/$WGET_EXE
+       fi
+       wine $WGET_EXE \/silent
+       popd
+fi
+
+wine ~/.wine/drive_c/windows/system32/cmd.exe /c prepare.bat
diff --git a/win32/make-wine.sh b/win32/make-wine.sh
new file mode 100755 (executable)
index 0000000..92cba7f
--- /dev/null
@@ -0,0 +1,3 @@
+#!/bin/sh
+
+wine ~/.wine/drive_c/windows/system32/cmd.exe /c make.bat
diff --git a/win32/make.bat b/win32/make.bat
new file mode 100644 (file)
index 0000000..e6f43d5
--- /dev/null
@@ -0,0 +1,4 @@
+:: Standard build\r
+set PATH=%PATH%;C:\MinGW\bin;C:\msys\1.0\bin\r
+cd ..\src\r
+make\r
diff --git a/win32/msys-pi-wine.sh b/win32/msys-pi-wine.sh
new file mode 100755 (executable)
index 0000000..42350bb
--- /dev/null
@@ -0,0 +1,4 @@
+#!/bin/sh
+# Run this when msys install halts
+
+wine ~/.wine/drive_c/windows/system32/cmd.exe /c msys-pi.bat
diff --git a/win32/msys-pi.bat b/win32/msys-pi.bat
new file mode 100644 (file)
index 0000000..e6a2644
--- /dev/null
@@ -0,0 +1,3 @@
+\r
+set PATH=%PATH%;C:\msys\1.0\bin\r
+sh msys-pi.sh\r
diff --git a/win32/msys-pi.sh b/win32/msys-pi.sh
new file mode 100644 (file)
index 0000000..c055b70
--- /dev/null
@@ -0,0 +1,40 @@
+# Fix up MSYS install
+# Don't ask for questions
+# fix fstab to the values I need
+
+. /etc/profile
+
+echo
+echo "Creating /etc/fstab with mingw mount bindings."
+cat <<EOF>/etc/fstab
+C:\MinGW /mingw
+C:\Perl /opt/perl
+EOF
+
+# Stuff from original post MSYS install script
+echo
+echo    "        Normalizing your MSYS environment."
+echo
+
+for I in awk cmd echo egrep ex fgrep printf pwd rvi rview rvim vi view
+do
+  if [ -f /bin/$I. ]
+  then
+    echo You have script /bin/$I
+    if [ -f /bin/$I.exe ]
+    then
+      echo Removing /bin/$I.exe
+      rm -f /bin/$I.exe
+    fi
+  fi
+done
+
+for I in ftp ln make
+do
+  if [ -f /bin/$I.exe ] && [ -f /bin/$I. ]
+  then
+    echo You have both /bin/$I.exe and /bin/$I.
+    echo Removing /bin/$I.
+    rm -f /bin/$I.
+  fi
+done
diff --git a/win32/prepare.bat b/win32/prepare.bat
new file mode 100644 (file)
index 0000000..250c057
--- /dev/null
@@ -0,0 +1,315 @@
+@echo OFF\r
+::\r
+:: Setup wget first - this has to be done manually\r
+:: http://gnuwin32.sourceforge.net/packages/wget.htm\r
+:: http://downloads.sourceforge.net/gnuwin32/wget-1.11.4-1-setup.exe\r
+::\r
+:: Simple script to check required built environment in default locations\r
+::  Versions downloaded are specified absolutely as otherwise it's tricky to try and work out the latest/stable version\r
+:: In principal the idea is to try and automate the process as much as possible\r
+::\r
+set PATH=%PATH%;%ProgramFiles%\GnuWin32\bin\r
+\r
+set MINGW=%SystemDrive%\MinGW\r
+set MINGW_BIN=%MinGW%\bin\r
+\r
+set ERRORLEVEL=0\r
+\r
+if not exist cache mkdir cache\r
+pushd cache\r
+\r
+echo =+=+=\r
+echo Checking mingw...\r
+echo =+=+=\r
+set MINGW_EXE=MinGW-5.1.6.exe\r
+set BIN_UTILS=binutils-2.19.1-mingw32-bin.tar.gz\r
+set GCC_CORE=gcc-core-3.4.5-20060117-3.tar.gz\r
+set GCC_GPP=gcc-g++-3.4.5-20060117-3.tar.gz\r
+set MINGWRTDLL=mingwrt-3.15.2-mingw32-dll.tar.gz\r
+set MINGWRTDEV=mingwrt-3.15.2-mingw32-dll.tar.gz\r
+set W32API=w32api-3.13-mingw32-dev.tar.gz\r
+\r
+if not exist "%MINGW_BIN%" (\r
+       :: Here we download all default components manually in an attempt to get autoinstall to work...\r
+       if not exist %MINGW_EXE% (\r
+               wget "http://sourceforge.net/projects/mingw/files/OldFiles/MinGW 5.1.6/%MINGW_EXE%"\r
+       )\r
+       if not exist %BIN_UTILS% (\r
+               wget "http://sourceforge.net/projects/mingw/files/MinGW/Base/binutils/binutils-2.19.1/%BIN_UTILS%/download"\r
+       )\r
+       if not exist %GCC_CORE% (\r
+               wget "http://sourceforge.net/projects/mingw/files/MinGW/Base/gcc/Version3/Current Release_ gcc-3.4.5-20060117-3/%GCC_CORE%/download"\r
+       )\r
+       if not exist %GCC_GPP% (\r
+               wget "http://sourceforge.net/projects/mingw/files/MinGW/Base/gcc/Version3/Current Release_ gcc-3.4.5-20060117-3/%GCC_GPP%/download"\r
+       )\r
+       if not exist %MINGWRTDEV% (\r
+               wget http://sourceforge.net/projects/mingw/files/MinGW/Base/mingw-rt/mingwrt-3.15.2/%MINGWRTDEV%/download\r
+       )\r
+       if not exist %MINGWRTDLL% (\r
+               wget http://sourceforge.net/projects/mingw/files/MinGW/Base/mingw-rt/mingwrt-3.15.2/%MINGWRTDLL%/download\r
+       )\r
+       if not exist %W32API% (\r
+               wget http://sourceforge.net/projects/mingw/files/MinGW/Base/w32api/w32api-3.13/%W32API%/download\r
+       )\r
+       :: Can't get it to silent install. As a NSIS installer it supports /S, but it doesn't seem to work - it just hangs\r
+       :: Have to click through manually\r
+       %MINGW_EXE%\r
+       if ERRORLEVEL 1 goto Error\r
+)\r
+\r
+echo =+=+=\r
+echo Checking MSYS...\r
+echo =+=+=\r
+set MSYS_EXE=MSYS-1.0.11.exe\r
+if not exist "%SystemDrive%\msys" (\r
+       if not exist %MSYS_EXE% (\r
+               wget http://downloads.sourceforge.net/mingw/%MSYS_EXE%\r
+       )\r
+       if not [%WINELOADER%]==[] (\r
+               echo Running under WINE - Requires MSYS install fixes: run msys-pi-wine.sh when msys install halts..."\r
+               echo Ctrl-C to stop and then rerun the installation if necessary\r
+       )\r
+       %MSYS_EXE% /sp- /silent\r
+       if ERRORLEVEL 1 goto Error\r
+)\r
+\r
+:: We need a program to be able to extract not only zips, but bz2 and *lzma*\r
+set PATH=%PATH%;%ProgramFiles%\7-Zip\r
+echo =+=+=\r
+echo Checking 7Zip is Available...\r
+echo =+=+=\r
+set ZIP_INST=7z920.exe\r
+if not exist "%ProgramFiles%\7-Zip\7z.exe" (\r
+       if not exist %ZIP_INST% (\r
+               wget http://downloads.sourceforge.net/sevenzip/%ZIP_INST%\r
+       )\r
+       %ZIP_INST% /S\r
+       if ERRORLEVEL 1 goto Error\r
+)\r
+\r
+::\r
+echo =+=+=\r
+echo Checking gtk+-bundle...\r
+echo =+=+=\r
+set GTK_ZIP=gtk+-bundle_2.24.10-20120208_win32.zip\r
+if not exist "%MINGW_BIN%\gtk-update-icon-cache.exe" (\r
+       if not exist %GTK_ZIP% (\r
+               wget http://ftp.gnome.org/pub/gnome/binaries/win32/gtk+/2.24/%GTK_ZIP%\r
+       )\r
+       7z x %GTK_ZIP% -o"%MinGW%"\r
+       if ERRORLEVEL 1 goto Error\r
+)\r
+\r
+set EXPAT_ZIP=expat-dev_2.0.1-1_win32.zip\r
+echo =+=+=\r
+echo Checking expat-dev...\r
+echo =+=+=\r
+if not exist "%MINGW%\include\expat.h" (\r
+       if not exist %EXPAT_ZIP% (\r
+               wget http://ftp.gnome.org/pub/gnome/binaries/win32/dependencies/%EXPAT_ZIP%\r
+       )\r
+       7z x %EXPAT_ZIP% -o"%MinGW%"\r
+       if ERRORLEVEL 1 goto Error\r
+)\r
+\r
+set GTT_ZIP=gettext-tools-dev_0.18.1.1-2_win32.zip\r
+echo =+=+=\r
+echo Checking gettext-tools-dev...\r
+echo =+=+=\r
+if not exist "%MINGW_BIN%\libgettextlib-0-18-1.dll" (\r
+       if not exist %GTT_ZIP% (\r
+               wget http://ftp.gnome.org/pub/gnome/binaries/win32/dependencies/%GTT_ZIP%\r
+       )\r
+       7z x -y %GTT_ZIP% -o"%MinGW%"\r
+       if ERRORLEVEL 1 goto Error\r
+)\r
+\r
+echo =+=+=\r
+echo Checking intltool...\r
+echo =+=+=\r
+set INTLTOOL_ZIP=intltool_0.40.4-1_win32.zip\r
+if not exist "%MINGW_BIN%\intltoolize" (\r
+       if not exist %INTLTOOL_ZIP% (\r
+               wget http://ftp.acc.umu.se/pub/GNOME/binaries/win32/intltool/0.40/%INTLTOOL_ZIP%\r
+       )\r
+       7z x %INTLTOOL_ZIP% -o"%MinGW%"\r
+       if ERRORLEVEL 1 goto Error\r
+)\r
+\r
+echo =+=+=\r
+echo Checking iconv...\r
+echo =+=+=\r
+set ICONV_ZIP=libiconv-1.9.2-1-bin.zip\r
+if not exist "%MINGW_BIN%\iconv.exe" (\r
+       if not exist %ICONV_ZIP% (\r
+               wget http://sourceforge.net/projects/gnuwin32/files/libiconv/1.9.2-1/%ICONV_ZIP%\r
+       )\r
+       7z x -y %ICONV_ZIP% -o"%MinGW%"\r
+       if ERRORLEVEL 1 goto Error\r
+)\r
+\r
+echo =+=+=\r
+echo Checking libintl...\r
+echo =+=+=\r
+:: Needed by iconv\r
+set LIBINTL_ZIP=libintl-0.14.4-bin.zip\r
+if not exist "%MINGW_BIN%\libintl3.dll" (\r
+       if not exist %LIBINTL_ZIP% (\r
+               wget http://sourceforge.net/projects/gnuwin32/files/libintl/0.14.4/%LIBINTL_ZIP%\r
+       )\r
+       7z x -y %LIBINTL_ZIP% -o"%MinGW%"\r
+       if ERRORLEVEL 1 goto Error\r
+)\r
+\r
+echo =+=+=\r
+echo Checking libcurl...\r
+echo =+=+=\r
+set CURL_TAR=libcurl-7.14.0_nossl-1sid.tar\r
+set CURL_BZ2=%CURL_TAR%.bz2\r
+if not exist "%MINGW_BIN%\libcurl.dll" (\r
+       if not exist %CURL_BZ2% (\r
+               wget http://downloads.sourceforge.net/devpaks/libcurl-7.14.0_nossl-1sid.DevPak?download\r
+               move libcurl-7.14.0_nossl-1sid.DevPak %CURL_BZ2%\r
+       )\r
+       echo Extracting libcurl...\r
+       7z e %CURL_BZ2%\r
+       7z x %CURL_TAR% -o"libcurl"\r
+       if ERRORLEVEL 1 goto Error\r
+       @echo ON\r
+       move libcurl\include "%MinGW%\include\curl\r
+       copy /Y libcurl\bin\*.* "%MinGW_BIN%"\r
+       copy /Y libcurl\lib\*.* "%MinGW%\lib"\r
+       copy /Y libcurl\docs\*.* "%MinGW%\doc"\r
+       rmdir /S /Q libcurl\r
+       del %CURL_TAR%\r
+       @echo OFF\r
+)\r
+\r
+echo =+=+=\r
+echo Checking libexif...\r
+echo =+=+=\r
+set EXIF=libexif-0.6.20_winxp_mingw\r
+set EXIF_7Z=%EXIF%.7z\r
+if not exist "%MINGW_BIN%\libexif-12.dll" (\r
+       if not exist %EXIF_7Z% (\r
+               wget "http://sourceforge.net/projects/maille/files/Extern libs/%EXIF_7Z%/download"\r
+       )\r
+       echo Extracting libexif...\r
+       7z x %EXIF_7Z%\r
+       if ERRORLEVEL 1 goto Error\r
+\r
+       echo Using *xcopy* (to get all subdirs) libexif into place...\r
+       @echo ON\r
+       xcopy /Y /S %EXIF%\*.* "%MinGW%"\r
+       rmdir /S /Q %EXIF%\r
+       @echo OFF\r
+)\r
+\r
+echo =+=+=\r
+echo Checking libstdc++...\r
+echo =+=+=\r
+set STDCPP_TAR=libstdc++-4.6.2-1-mingw32-dll-6.tar\r
+set STDCPP_LZ=%STDCPP_TAR%.lzma\r
+if not exist "%MINGW_BIN%\libstdc++-6.dll" (\r
+       if not exist %STDCPP_LZ% (\r
+               wget http://sourceforge.net/projects/mingw/files/MinGW/Base/gcc/Version4/gcc-4.6.2-1/%STDCPP_LZ%\r
+       )\r
+       echo Extracting lidstdc++...\r
+       7z e %STDCPP_LZ%\r
+       7z x %STDCPP_TAR% -o"%MinGW%"\r
+       if ERRORLEVEL 1 goto Error\r
+       del %STDCPP_TAR%\r
+)\r
+\r
+echo =+=+=\r
+echo Checking Gnome Doc Utils...\r
+echo =+=+=\r
+set GNOME_DOC_ZIP=gnome-doc-utils-0.12.0.zip\r
+if not exist "%MINGW_BIN%\gnome-doc-prepare" (\r
+       if not exist %GNOME_DOC_ZIP% (\r
+               wget http://ftp.gnome.org/pub/gnome/binaries/win32/gnome-doc-utils/0.12/%GNOME_DOC_ZIP%\r
+       )\r
+       echo Extracting Gnome Doc Utils...\r
+       7z x %GNOME_DOC_ZIP% -o"%MinGW%"\r
+       if ERRORLEVEL 1 goto Error\r
+)\r
+\r
+:: Note GPSBabel can not be directly downloaded via wget\r
+:: ATM get it manually from here:\r
+::   http://www.gpsbabel.org/download.html\r
+set GPSBABEL_INST=GPSBabel-1.4.4-Setup.exe\r
+if not exist "%ProgramFiles%\GPSBabel" (\r
+       echo Installing GPSBabel...\r
+       if exist %GPSBABEL_INST% (\r
+               %GPSBABEL_INST% /silent\r
+               if ERRORLEVEL 1 goto Error\r
+       )\r
+)\r
+\r
+echo =+=+=\r
+echo Checking Perl Installation...\r
+echo =+=+=\r
+set PERL_MSI=ActivePerl-5.14.3.1404-MSWin32-x86-296513.msi\r
+if not exist "%SystemDrive%\Perl" (\r
+       if not exist %PERL_MSI% (\r
+               wget http://downloads.activestate.com/ActivePerl/releases/5.14.3.1404/%PERL_MSI%\r
+       )\r
+       echo Installing Perl takes a little time...\r
+       msiexec /qb /i %PERL_MSI% PERL_PATH=Yes PERL_EXT=Yes\r
+       if ERRORLEVEL 1 goto Error\r
+)\r
+\r
+echo =+=+=\r
+echo Checking NSIS installed...\r
+echo =+=+=\r
+set NSIS_INST=nsis-2.46-setup.exe\r
+if not exist "%ProgramFiles%\NSIS" (\r
+       if not exist %NSIS_INST% (\r
+               wget http://prdownloads.sourceforge.net/nsis/nsis-2.46-setup.exe?download\r
+       )\r
+       echo Installing NSIS...\r
+       %NSIS_INST% /S\r
+       if ERRORLEVEL 1 goto Error\r
+)\r
+\r
+echo =+=+=\r
+echo Checking NSIS Plugins installed...\r
+echo =+=+=\r
+set FPDLLZIP=FindProc.zip\r
+if not exist "%ProgramFiles%\NSIS\Plugins\FindProcDLL.dll" (\r
+       if not exist %FPDLLZIP% (\r
+               wget http://nsis.sourceforge.net/mediawiki/images/3/3c/%FPDLLZIP%\r
+       )\r
+       echo Extracting NSIS Plugins...\r
+       7z e %FPDLLZIP% -o"%ProgramFiles%\NSIS\Plugins"\r
+       if ERRORLEVEL 1 goto Error\r
+)\r
+\r
+popd\r
+\r
+echo Fixing Perl reference\r
+REM Sadly '-i' for in place changes doesn't seem available with Windows sed 3.02\r
+set PATH=%PATH%;C:\msys\1.0\bin\r
+sed -e 's:#! /bin/perl:#! /opt/perl/bin/perl:' %MINGW_BIN%\glib-mkenums > tmp.enums\r
+if ERRORLEVEL 1 goto Error\r
+xcopy /Y tmp.enums %MINGW_BIN%\glib-mkenums\r
+if ERRORLEVEL 1 goto Error\r
+del tmp.enums\r
+\r
+:: Potentially Clean Up\r
+:: If any parameters given on the command line then remove all downloaded items\r
+:Clean\r
+if not [%1]==[] (\r
+       echo Removing downloaded files\r
+       if exist cache rmdir /S /Q cache\r
+)\r
+\r
+goto End\r
+\r
+:Error\r
+echo exitting due to error: %ERRORLEVEL%\r
+exit\r
+\r
+:End\r
+echo Finished\r