diff -ur grass-7.8.6/lib/gis/gisinit.c ../grass-7.8.6/lib/gis/gisinit.c
--- grass-7.8.6/lib/gis/gisinit.c	2021-10-10 13:38:28.000000000 +0200
+++ ../grass-7.8.6/lib/gis/gisinit.c	2021-11-09 12:43:29.210713200 +0100
@@ -49,12 +49,14 @@
 
     G_set_program_name(pgm);
 
+#ifndef WIN32
     /* verify version of GRASS headers (and anything else in include) */
     if (strcmp(version, GIS_H_VERSION) != 0)
 	G_fatal_error(_("Module built against version %s but "
 			"trying to use version %s. "
 			"You need to rebuild GRASS GIS or untangle multiple installations."),
                         version, GIS_H_VERSION);
+#endif
     
     /* Make sure location and mapset are set */
     G_location_path();
@@ -84,12 +86,14 @@
     if (initialized)
 	return;
 
+#ifndef WIN32
     /* verify version of GRASS headers (and anything else in include) */
     if (strcmp(version, GIS_H_VERSION) != 0)
 	G_fatal_error(_("Module built against version %s but "
 			"trying to use version %s. "
 			"You need to rebuild GRASS GIS or untangle multiple installations."),
                         version, GIS_H_VERSION);
+#endif
     gisinit();
 }
 
diff -ur grass-7.8.6/mswindows/osgeo4w/config.h.vc ../grass-7.8.6/mswindows/osgeo4w/config.h.vc
--- grass-7.8.6/mswindows/osgeo4w/config.h.vc	2021-10-10 13:38:28.000000000 +0200
+++ ../grass-7.8.6/mswindows/osgeo4w/config.h.vc	2021-11-01 11:25:51.110679400 +0100
@@ -295,4 +295,6 @@
 /* define if langinfo.h exists */
 /* #undef HAVE_LANGINFO_H */
 
+#define HAVE_PROJ_H 1
+
 #endif /* _config_h */
diff -ur grass-7.8.6/mswindows/osgeo4w/env.bat.tmpl ../grass-7.8.6/mswindows/osgeo4w/env.bat.tmpl
--- grass-7.8.6/mswindows/osgeo4w/env.bat.tmpl	2021-10-10 13:38:28.000000000 +0200
+++ ../grass-7.8.6/mswindows/osgeo4w/env.bat.tmpl	2021-11-01 11:25:51.111678600 +0100
@@ -12,11 +12,3 @@
 set GRASS_PROJSHARE=%OSGEO4W_ROOT%\share\proj
 
 set FONTCONFIG_FILE=%GISBASE%\etc\fonts.conf
-
-REM
-REM RStudio-related
-REM
-REM set RStudio temporarily to %PATH% if it exists
-IF EXIST "%ProgramFiles%\RStudio\bin\rstudio.exe" set PATH=%PATH%;%ProgramFiles%\RStudio\bin
-REM set R_USER if %USERPROFILE%\Documents\R\ exists to catch most common cases of private R libraries
-IF EXIST "%USERPROFILE%\Documents\R\" set R_USER=%USERPROFILE%\Documents\
diff -ur grass-7.8.6/mswindows/osgeo4w/package.sh ../grass-7.8.6/mswindows/osgeo4w/package.sh
--- grass-7.8.6/mswindows/osgeo4w/package.sh	2021-10-10 13:38:28.000000000 +0200
+++ ../grass-7.8.6/mswindows/osgeo4w/package.sh	2021-11-01 11:25:51.112679300 +0100
@@ -149,13 +149,13 @@
 
 	log configure
 	./configure \
-	    --host=x86_64-w64-mingw32 \
+		--host=x86_64-w64-mingw32 \
 		--with-libs="$OSGEO4W_ROOT_MSYS/lib" \
 		--with-includes=$OSGEO4W_ROOT_MSYS/include \
-        --libexecdir=$OSGEO4W_ROOT_MSYS/bin \
-        --prefix=$OSGEO4W_ROOT_MSYS/apps/grass \
-        --bindir=$OSGEO4W_ROOT_MSYS/bin \
-        --includedir=$OSGEO4W_ROOT_MSYS/include \
+		--libexecdir=$OSGEO4W_ROOT_MSYS/bin \
+		--prefix=$OSGEO4W_ROOT_MSYS/apps/grass \
+		--bindir=$OSGEO4W_ROOT_MSYS/bin \
+		--includedir=$OSGEO4W_ROOT_MSYS/include \
 		--without-x \
 		--with-cxx \
 		--enable-shared \
@@ -178,10 +178,10 @@
 		--with-nls \
 		--with-zstd \
 		--with-odbc \
-	    --with-cairo \
+		--with-cairo \
 		--with-cairo-includes=$OSGEO4W_ROOT_MSYS/include \
 		--with-cairo-ldflags="-L$PWD/mswindows/osgeo4w/lib -lcairo -lfontconfig" \
-	    --with-opengl=windows \
+		--with-opengl=windows \
 		--with-bzlib \
 		--with-liblas=$PWD/mswindows/osgeo4w/liblas-config
 
diff -ur grass-7.8.6/mswindows/osgeo4w/postinstall.bat ../grass-7.8.6/mswindows/osgeo4w/postinstall.bat
--- grass-7.8.6/mswindows/osgeo4w/postinstall.bat	2021-10-10 13:38:28.000000000 +0200
+++ ../grass-7.8.6/mswindows/osgeo4w/postinstall.bat	2021-11-09 10:44:28.527248000 +0100
@@ -1,29 +1,31 @@
-set ICON=%OSGEO4W_ROOT%\apps\grass\grass@POSTFIX@\gui\icons\grass_osgeo.ico
-set BATCH=%OSGEO4W_ROOT%\bin\@GRASS_EXECUTABLE@.bat
-textreplace -std -t "%BATCH%"
-textreplace -std -t "%OSGEO4W_ROOT%\apps\grass\grass@POSTFIX@\etc\fontcap"
-
-for /F "tokens=* USEBACKQ" %%F IN (`getspecialfolder Documents`) do set DOCUMENTS=%%F
-
-if not %OSGEO4W_MENU_LINKS%==0 xxmklink "%OSGEO4W_STARTMENU%\GRASS GIS @VERSION@.lnk" "%BATCH%"  "--gui" "%DOCUMENTS%" "Launch GRASS GIS @VERSION@" 1 "%ICON%" 
-if not %OSGEO4W_DESKTOP_LINKS%==0 xxmklink "%OSGEO4W_DESKTOP%\GRASS GIS @VERSION@.lnk" "%BATCH%"  "--gui" "%DOCUMENTS%" "Launch GRASS GIS @VERSION@" 1 "%ICON%" 
-
-rem run g.mkfontcap outside a GRASS session during
-rem an OSGeo4W installation for updating paths to fonts
-
-rem set gisbase
-set GISBASE=%OSGEO4W_ROOT%\apps\grass\grass@POSTFIX@
-
-rem set path to freetype dll and its dependencies
-set FREETYPEBASE=%OSGEO4W_ROOT%\bin;%OSGEO4W_ROOT%\apps\msys\bin;%GISBASE%\lib
-
-rem set dependencies to path
-set PATH=%FREETYPEBASE%;%PATH%
-
-rem GISRC must be set
-set GISRC=dummy
-
-rem run g.mkfontcap outside a GRASS session
-"%GISBASE%\bin\g.mkfontcap.exe" -o
-
-del "%BATCH%.tmpl
+set ICON=%OSGEO4W_ROOT%\apps\grass\grass@POSTFIX@\gui\icons\grass_osgeo.ico
+set BATCH=%OSGEO4W_ROOT%\bin\@GRASS_EXECUTABLE@.bat
+textreplace -std -t "%BATCH%"
+textreplace -std -t "%OSGEO4W_ROOT%\apps\grass\grass@POSTFIX@\etc\fontcap"
+
+for /F "tokens=* USEBACKQ" %%F IN (`getspecialfolder Documents`) do set DOCUMENTS=%%F
+
+if not %OSGEO4W_MENU_LINKS%==0 xxmklink "%OSGEO4W_STARTMENU%\GRASS GIS @VERSION@.lnk" "%BATCH%"  "--gui" "%DOCUMENTS%" "Launch GRASS GIS @VERSION@" 1 "%ICON%" 
+if not %OSGEO4W_DESKTOP_LINKS%==0 xxmklink "%OSGEO4W_DESKTOP%\GRASS GIS @VERSION@.lnk" "%BATCH%"  "--gui" "%DOCUMENTS%" "Launch GRASS GIS @VERSION@" 1 "%ICON%" 
+
+rem run g.mkfontcap outside a GRASS session during
+rem an OSGeo4W installation for updating paths to fonts
+
+rem set gisbase
+set GISBASE=%OSGEO4W_ROOT%\apps\grass\grass@POSTFIX@
+
+rem set path to freetype dll and its dependencies
+set FREETYPEBASE=%OSGEO4W_ROOT%\bin;%OSGEO4W_ROOT%\apps\msys\bin;%GISBASE%\lib
+
+rem set dependencies to path
+set PATH=%FREETYPEBASE%;%PATH%
+
+rem GISRC must be set
+set GISRC=dummy
+
+rem run g.mkfontcap outside a GRASS session
+"%GISBASE%\bin\g.mkfontcap.exe" -o
+
+del "%BATCH%.tmpl"
+
+exit /b 0
diff -ur grass-7.8.7/lib/raster/gdal.c ../grass-7.8.7/lib/raster/gdal.c
--- grass-7.8.7/lib/raster/gdal.c	2022-02-23 17:43:59.000000000 +0100
+++ ../grass-7.8.7/lib/raster/gdal.c	2022-05-04 12:20:49.767316400 +0200
@@ -116,6 +116,7 @@
 	"libgdal1.7.0.so",
 # endif
 # ifdef _WIN32
+	"gdal304.dll",
 	"gdal303.dll",
 	"gdal302.dll",
 	"gdal301.dll",
