Index: main/trunk/greenstone2/common-src/indexers/winMake.bat
===================================================================
--- main/trunk/greenstone2/common-src/indexers/winMake.bat	(revision 35701)
+++ main/trunk/greenstone2/common-src/indexers/winMake.bat	(revision 35702)
@@ -53,9 +53,5 @@
 	cd packages\windows\iconv
 	set ICONVZIP=iconv-VS14-PLUS.zip
-	:: Following line loosely based on
-	::   https://stackoverflow.com/questions/32578014/how-to-extract-version-number-in-a-windows-batch-file/32578368
-	set "VSMajor=%VISUAL_STUDIO_VERSION:.= & set VSMinor=%"
-	
-	if %VSMajor% LSS 14 set ICONVZIP=iconv-PRE-VS14.zip
+	if %VISUAL_STUDIO_MAJORVERSION% LSS 14 set ICONVZIP=iconv-PRE-VS14.zip
 	echo Selected iconvzip: %ICONVZIP%
 	if NOT EXIST "iconv" unzip "%ICONVZIP%"
Index: main/trunk/greenstone2/common-src/win32.mak
===================================================================
--- main/trunk/greenstone2/common-src/win32.mak	(revision 35701)
+++ main/trunk/greenstone2/common-src/win32.mak	(revision 35702)
@@ -64,5 +64,5 @@
 JDBMEDIT_DIR = src\jdbmedit
 
-MAKECMD = $(MAKE) $(MDEFINES) GSDLHOME="$(GSDLHOME)" VISUAL_STUDIO_VERSION="$(VISUAL_STUDIO_VERSION)" BINDIR="$(GSDLHOME)\bin\windows" LIBDIR="$(GSDLHOME)\lib\windows"
+MAKECMD = $(MAKE) $(MDEFINES) GSDLHOME="$(GSDLHOME)" VISUAL_STUDIO_MAJORVERSION="$(VISUAL_STUDIO_MAJORVERSION)" BINDIR="$(GSDLHOME)\bin\windows" LIBDIR="$(GSDLHOME)\lib\windows"
 
 !IF $(GSDL_VC4)
@@ -142,12 +142,6 @@
 	cd "$(COMMONHOME)"
 	cd indexers\packages\windows\iconv
-	@ set ICONVZIP=iconv-VS14-PLUS.zip
-
-# Following line loosely based on
-#   https://stackoverflow.com/questions/32578014/how-to-extract-version-number-in-a-windows-batch-file/32578368
-	@ set "VSMajor=$(VISUAL_STUDIO_VERSION):.= & set VSMinor=%"
-	@ echo VSMajor = %VSMajor%
-	
-	@ if %VSMajor% LSS 14 set ICONVZIP=iconv-PRE-VS14.zip
+	@ set ICONVZIP=iconv-VS14-PLUS.zip	
+	@ if $(VISUAL_STUDIO_MAJORVERSION) LSS 14 set ICONVZIP=iconv-PRE-VS14.zip
 	@ echo Selected iconv to unzip: %ICONVZIP%
 	if NOT EXIST "iconv" unzip "%ICONVZIP%"
@@ -215,5 +209,5 @@
 	cd indexers
 	set DEBUG=$(DEBUG)
-	set VISUAL_STUDIO_VERSION=$(VISUAL_STUDIO_VERSION)
+	set VISUAL_STUDIO_MAJORVERSION=$(VISUAL_STUDIO_MAJORVERSION)
 	set ENABLE_MG=$(ENABLE_MG)
 	set ENABLE_MGPP=$(ENABLE_MGPP)
@@ -221,5 +215,5 @@
 	call winMake.bat clean
 	set DEBUG=
-	set VISUAL_STUDIO_VERSION=
+	set VISUAL_STUDIO_MAJORVERSION=
 	set ENABLE_MG=
 	set ENABLE_MGPP=
@@ -279,5 +273,5 @@
 	cd "$@"
 	set DEBUG=$(DEBUG)
-	set VISUAL_STUDIO_VERSION=$(VISUAL_STUDIO_VERSION)
+	set VISUAL_STUDIO_MAJORVERSION=$(VISUAL_STUDIO_MAJORVERSION)
 	set ENABLE_MG=$(ENABLE_MG)
 	set ENABLE_MGPP=$(ENABLE_MGPP)
@@ -293,5 +287,5 @@
 
 	set DEBUG=
-	set VISUAL_STUDIO_VERSION=
+	set VISUAL_STUDIO_MAJORVERSION=
 	set ENABLE_MG=
 	set ENABLE_MGPP=
Index: main/trunk/greenstone3/build.xml
===================================================================
--- main/trunk/greenstone3/build.xml	(revision 35701)
+++ main/trunk/greenstone3/build.xml	(revision 35702)
@@ -134,8 +134,8 @@
   <if>
     <bool><isset property="env.VisualStudioVersion"/></bool>
-    <property name="visualstudio.version" value="${env.VisualStudioVersion}"/>
+    <property name="visualstudio.majorversion" value="${env.VisualStudioVersion}"/>
     <else>
       <!-- possible that earlier versions of VS don't set this, so default to VS13 to trigger iconv-PRE-VS14.zip -->
-      <property name="visualstudio.version" value="13.0"/> 
+      <property name="visualstudio.majorversion" value="13"/> 
     </else>
   </if>
@@ -3755,5 +3755,5 @@
       <arg value="/f"/>
       <arg value="win32.mak"/>
-      <arg value="VISUAL_STUDIO_VERSION=${visualstudio.version}"/>      
+      <arg value="VISUAL_STUDIO_MAJORVERSION=${visualstudio.majorversion}"/>      
       <arg value="GSDLHOME=${gs2build.home}"/>
       <arg value="ENABLE_JNI=${gs2.windows.enablejni}"/>
@@ -3803,5 +3803,5 @@
       <arg value="win32.mak"/>
       <arg value="install"/>
-      <arg value="VISUAL_STUDIO_VERSION=${env.VisualStudioVersion}"/>
+      <arg value="VISUAL_STUDIO_MAJORVERSION=${visualstudio.majorversion}"/>
       <arg value="GSDLHOME=${gs2build.home}"/>
       <arg value="ENABLE_JNI=${gs2.windows.enablejni}"/>
@@ -4253,27 +4253,19 @@
       src="${common.src.home}/packages/sqlite/${sqlite.targz.version}"
       dest="${common.src.home}/packages/sqlite"/>
-    <!-- VisualStudioVersion = 16.0 -->
-    <!-- diff unzip when >=14 -->
 
     <if>
       <bool>
-	<and>
-	  <isset property="env.VisualStudioVersion"/>
-	  <islessthan arg1="${env.VisualStudioVersion}" arg2="14.0"/>
-	</and>
+		<islessthan arg1="${visualstudio.majorversion}" arg2="14"/>
       </bool>
-      <echo>Unzipping Pre VS14.0 compatible version of iconv</echo>
+      <echo>Unzipping Pre-VS14.0 compatible version of iconv</echo>
       <unzip src="${common.src.home}/indexers/packages/windows/iconv/iconv-PRE-VS14.zip"
-	     dest="${common.src.home}/indexers/packages/windows/iconv"/>
+	         dest="${common.src.home}/indexers/packages/windows/iconv"/>
       <else>
-	<echo>Unzipping VS14.0 Plus compatible version of iconv</echo>
-	<unzip src="${common.src.home}/indexers/packages/windows/iconv/iconv-VS14-PLUS.zip"
-	       dest="${common.src.home}/indexers/packages/windows/iconv"/>
+		<echo>Unzipping VS14.0-Plus compatible version of iconv</echo>
+		<unzip src="${common.src.home}/indexers/packages/windows/iconv/iconv-VS14-PLUS.zip"
+	           dest="${common.src.home}/indexers/packages/windows/iconv"/>
       </else>
     </if>
-    <!--
-    <unzip src="${common.src.home}/indexers/packages/windows/iconv/iconv.zip"
-	   dest="${common.src.home}/indexers/packages/windows/iconv"/>
-    -->
+   
   </target>
     
Index: main/trunk/gs2build/win32.mak
===================================================================
--- main/trunk/gs2build/win32.mak	(revision 35701)
+++ main/trunk/gs2build/win32.mak	(revision 35702)
@@ -54,5 +54,5 @@
 
 
-MAKECMD = $(MAKE) $(MDEFINES) GSDLHOME="$(GSDLHOME)" VISUAL_STUDIO_VERSION="$(VISUAL_STUDIO_VERSION)"
+MAKECMD = $(MAKE) $(MDEFINES) GSDLHOME="$(GSDLHOME)" VISUAL_STUDIO_MAJORVERSION="$(VISUAL_STUDIO_MAJORVERSION)"
 
 !IF $(GSDL_VC4)
