diff --git a/LOG b/LOG
index d2725616fd..64c1cf99a3 100644
--- a/LOG
+++ b/LOG
@@ -566,4 +566,13 @@
mats/Mf-a6nt, mats/Mf-ta6nt, mats/ftype.ms
- added support for building Windows installs with Bash/WSL
wininstall/Makefile, candle.bat, light.bat
-- added support for building with Visual Studio 2017's BuildTools in c/vs.bat
+- added support for building with Visual Studio 2017's BuildTools
+ c/vs.bat
+- check for git before using to get submodules
+ configure
+- fixed windows installer failure when vcredist is not preinstalled by
+ using the vcredist merge module, split the 32 and 64 bit MSIs and
+ added a wix bundle to combine the MSIs into a single exe installer,
+ added a batch script for locating Visual Studio's vcredist merge
+ modules, updated installer paths and names.
+ wininstall/*
diff --git a/configure b/configure
index 4c3c6b8dd5..4f035e38bc 100755
--- a/configure
+++ b/configure
@@ -310,7 +310,7 @@ if [ "$m" = "" -o ! -f boot/$m/scheme.boot ] ; then
exit 1
fi
-if [ -d '.git' ] ; then
+if [ -d '.git' ] && command -v git >/dev/null 2>&1 ; then
git submodule init && git submodule update || exit 1
else
if [ ! -f 'nanopass/nanopass.ss' ] ; then
diff --git a/wininstall/.gitignore b/wininstall/.gitignore
index 9ba04d12ee..50d9052780 100755
--- a/wininstall/.gitignore
+++ b/wininstall/.gitignore
@@ -1,3 +1,5 @@
-/*.wixobj
-/*.wixpdb
-/Chez Scheme.msi
+*.exe
+*.msi
+*.wixobj
+*.wixpdb
+/vcredist.wxs
diff --git a/wininstall/Makefile b/wininstall/Makefile
index 42c6dd9111..834a35c88a 100755
--- a/wininstall/Makefile
+++ b/wininstall/Makefile
@@ -1,11 +1,23 @@
VERSION := 9.4.1
-WIXEXTENSIONS := -ext WixUIExtension
+WIXEXTENSIONS := -ext WixUIExtension -ext WixBalExtension
-Chez\ Scheme.msi: product.wixobj a6nt.wixobj examples.wixobj i3nt.wixobj ta6nt.wixobj ti3nt.wixobj
- cmd.exe /c light.bat -nologo $(WIXEXTENSIONS) product.wixobj a6nt.wixobj examples.wixobj i3nt.wixobj ta6nt.wixobj ti3nt.wixobj -sice:ICE64 -out "$@"
+ChezScheme.exe: x86/bundle.wixobj ChezScheme32.msi ChezScheme64.msi
+ cmd.exe /c light.bat -nologo $(WIXEXTENSIONS) $< -out $@
-%.wixobj: %.wxs
- cmd.exe /c candle.bat -nologo -dVersion=$(VERSION) $(WIXEXTENSIONS) $<
+ChezScheme32.msi: x86/product.wixobj x86/examples.wixobj x86/i3nt.wixobj x86/ti3nt.wixobj x86/vcredist.wixobj x86/ui.wixobj
+ cmd.exe /c light.bat -nologo $(WIXEXTENSIONS) $^ -sice:ICE64 -sice:ICE03 -sice:ICE82 -sice:ICE61 -out "$@"
+
+ChezScheme64.msi: x64/product.wixobj x64/a6nt.wixobj x64/examples.wixobj x64/ta6nt.wixobj x64/vcredist.wixobj x64/ui.wixobj
+ cmd.exe /c light.bat -nologo $(WIXEXTENSIONS) $^ -sice:ICE64 -sice:ICE03 -sice:ICE82 -sice:ICE61 -out "$@"
+
+x86/%.wixobj: %.wxs
+ cmd.exe /c candle.bat -nologo -dVersion=$(VERSION) $(WIXEXTENSIONS) $< -out $@
+
+x64/%.wixobj: %.wxs
+ cmd.exe /c candle.bat -arch x64 -nologo -dVersion=$(VERSION) $(WIXEXTENSIONS) $< -out $@
+
+vcredist.wxs: locate-vcredist.bat
+ cmd.exe /c locate-vcredist.bat
.PHONY: workareas
workareas:
@@ -16,4 +28,4 @@ workareas:
.PHONY: clean
clean:
- -rm -f Chez\ Scheme.msi *.wixobj *.wixpdb
+ -rm -rf *.msi *.wixpdb x86/ x64/ vcredist.wxs *.wixobj *.exe
diff --git a/wininstall/bundle.wxs b/wininstall/bundle.wxs
new file mode 100755
index 0000000000..57c16f4d98
--- /dev/null
+++ b/wininstall/bundle.wxs
@@ -0,0 +1,26 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/wininstall/locate-vcredist.bat b/wininstall/locate-vcredist.bat
new file mode 100755
index 0000000000..3dabab8b6d
--- /dev/null
+++ b/wininstall/locate-vcredist.bat
@@ -0,0 +1,73 @@
+@call "../c/vs.bat" x86
+
+@IF "%VisualStudioVersion%"=="" ( GOTO error-undefined-vs )
+
+@IF "%VisualStudioVersion%"=="14.0" (
+ SET "Path32=%CommonProgramFiles(x86)%\Merge Modules\Microsoft_VC140_CRT_x86.msm"
+ SET "Path64=%CommonProgramFiles(x86)%\Merge Modules\Microsoft_VC140_CRT_x64.msm"
+)
+
+@IF "%VisualStudioVersion%"=="15.0" (
+ @IF EXIST "%VCINSTALLDIR%Redist\MSVC\14.10.25008" (
+ @SET "Path32=%VCINSTALLDIR%Redist\MSVC\14.10.25008\MergeModules\Microsoft_VC150_CRT_x86.msm"
+ @SET "Path64=%VCINSTALLDIR%Redist\MSVC\14.10.25008\MergeModules\Microsoft_VC150_CRT_x64.msm"
+ )
+
+ @IF EXIST "%VCINSTALLDIR%Redist\MSVC\14.11.25325" (
+ @SET "Path32=%VCINSTALLDIR%Redist\MSVC\14.11.25325\MergeModules\Microsoft_VC141_CRT_x86.msm"
+ @SET "Path64=%VCINSTALLDIR%Redist\MSVC\14.11.25325\MergeModules\Microsoft_VC141_CRT_x64.msm"
+ )
+)
+
+@DEL vcredist.wxs >nul 2>&1
+
+IF "%Path32%"=="" ( GOTO error-unknown-vs )
+IF NOT EXIST "%Path32%" ( GOTO error-32-doesnt-exist )
+IF NOT EXIST "%Path64%" ( GOTO error-64-doesnt-exist )
+
+@(
+ @ECHO ^
+ @ECHO ^
+ @ECHO ^
+ @ECHO ^
+ @ECHO ^
+ @ECHO ^
+ @ECHO ^
+ @ECHO ^
+ @ECHO ^
+ @ECHO ^
+ @ECHO ^
+ @ECHO ^
+ @ECHO ^
+ @ECHO ^
+ @ECHO ^
+ @ECHO ^
+ @ECHO ^
+ @ECHO ^
+ @ECHO ^
+ @ECHO ^
+ @ECHO ^
+ @ECHO ^
+ @ECHO ^
+) > vcredist.wxs
+
+@ECHO Built vcredist.wxs
+@EXIT /b 0
+
+:error-undefined-vs
+@ECHO Error building vcredist.wxs: Visual Studio version not defined.
+@EXIT /b 1
+
+:error-unknown-vs
+@ECHO Error building vcredist.wxs: Unexpected Visual Studio version.
+@EXIT /b 1
+
+:error-32-doesnt-exist
+@ECHO Error building vcredist.wxs: Merge Module couldn't be found:
+@ECHO %Path32%
+@EXIT /b 1
+
+:error-64-doesnt-exist
+@ECHO Error building vcredist.wxs: Merge Module couldn't be found:
+@ECHO %Path64%
+@EXIT /b 1
diff --git a/wininstall/product.wxs b/wininstall/product.wxs
index cad6550ffc..d3d4ab7ed0 100755
--- a/wininstall/product.wxs
+++ b/wininstall/product.wxs
@@ -1,16 +1,29 @@
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
+
+
+
+
+
-
-
-
-
-
-
-
-
- NOT VersionNT64
-
-
-
- NOT VersionNT64
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
- NOT VCRUNTIME_X86_DLL
-
-
- NOT VCRUNTIME_X64_DLL AND VersionNT64
-
-
-
-
-
-
+
+
diff --git a/wininstall/ui.wxs b/wininstall/ui.wxs
new file mode 100755
index 0000000000..7dafb9d152
--- /dev/null
+++ b/wininstall/ui.wxs
@@ -0,0 +1,59 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ NOT Installed OR PATCH
+
+
+ 1
+ 1
+ 1
+ 1
+ 1
+ 1
+ 1
+
+
+
+
+
+
+
diff --git a/wininstall/vc_redist.x64.exe b/wininstall/vc_redist.x64.exe
deleted file mode 100755
index 048fda2fa1..0000000000
Binary files a/wininstall/vc_redist.x64.exe and /dev/null differ
diff --git a/wininstall/vc_redist.x86.exe b/wininstall/vc_redist.x86.exe
deleted file mode 100755
index caea04acb3..0000000000
Binary files a/wininstall/vc_redist.x86.exe and /dev/null differ