diff -ur osgeo4w/grass-8.4.1/lib/gis/gisinit.c grass-8.4.1/lib/gis/gisinit.c
--- osgeo4w/grass-8.4.1/lib/gis/gisinit.c	2025-02-24 11:57:24.000000000 +0100
+++ grass-8.4.1/lib/gis/gisinit.c	2025-03-03 08:43:42.142173200 +0100
@@ -49,6 +49,7 @@
 
     G_set_program_name(pgm);
 
+#if 0
     /* verify version of GRASS headers (and anything else in include) */
     if (strcmp(version, GIS_H_VERSION) != 0) {
         char *envstr;
@@ -71,6 +72,7 @@
                 version, GIS_H_VERSION);
         }
     }
+#endif
 
     /* Make sure location and mapset are set */
     G_location_path();
@@ -100,6 +102,7 @@
     if (initialized)
         return;
 
+#if 0
     /* verify version of GRASS headers (and anything else in include) */
     if (strcmp(version, GIS_H_VERSION) != 0) {
         char *envstr;
@@ -122,6 +125,7 @@
                 version, GIS_H_VERSION);
         }
     }
+#endif
     gisinit();
 }
 
diff -ur grass-8.4.1/mswindows/osgeo4w/env.bat.tmpl ../grass-8.4.1/mswindows/osgeo4w/env.bat.tmpl
--- grass-8.4.1/mswindows/osgeo4w/env.bat.tmpl	2025-02-24 11:57:24.000000000 +0100
+++ ../grass-8.4.1/mswindows/osgeo4w/env.bat.tmpl	2025-02-28 11:21:16.640203100 +0100
@@ -8,6 +8,8 @@
 REM Note that msys package must be also installed
 REM set GRASS_SH=%OSGEO4W_ROOT%\apps\msys\bin\sh.exe
 
+set PYTHONPATH=%OSGEO4W_ROOT%\apps\grass\grass@POSTFIX@\etc\python;%PYTHONPATH%
+set GRASS_COMPATIBILITY_TEST=0
 set GRASS_PYTHON=%OSGEO4W_ROOT%\bin\python3.exe
 set GRASS_PROJSHARE=%OSGEO4W_ROOT%\share\proj
 
diff -ur grass-8.4.1/mswindows/osgeo4w/libpng-config ../grass-8.4.1/mswindows/osgeo4w/libpng-config
--- grass-8.4.1/mswindows/osgeo4w/libpng-config	2025-02-24 11:57:24.000000000 +0100
+++ ../grass-8.4.1/mswindows/osgeo4w/libpng-config	2025-02-28 11:21:16.644203000 +0100
@@ -14,7 +14,7 @@
 
 prefix="${OSGEO4W_ROOT_MSYS}"
 version="$(sed '/^#define PNG_LIBPNG_VER_STRING/!d; s/^[^"]*"\|"//g' ${prefix}/include/libpng*/png.h)"
-dll_version="$(sed '/^#define PNG_LIBPNG_VER_DLLNUM/!d; s/^[^0-9]*\|[^0-9]*$//g' ${prefix}/include/libpng*/png.h)"
+dll_version="$(sed '/^#define PNG_LIBPNG_VER_SHAREDLIB/!d; s/^[^0-9]*\|[^0-9]*$//g' ${prefix}/include/libpng*/png.h)"
 exec_prefix="${prefix}"
 libdir="${prefix}/lib"
 includedir="${prefix}/include/libpng${dll_version}"
diff -ur grass-8.4.1/mswindows/osgeo4w/package.sh ../grass-8.4.1/mswindows/osgeo4w/package.sh
--- osgeo4w/grass-8.4.1/mswindows/osgeo4w/package.sh	2025-02-24 11:57:24.000000000 +0100
+++ grass-8.4.1/mswindows/osgeo4w/package.sh	2025-02-28 13:39:09.366442500 +0100
@@ -1,8 +1,8 @@
-#!/usr/bin/bash
+#!/bin/bash
 
 set -e
 
-PWD="$(pwd)"
+export SRC=$PWD
 
 if ! [ -d mswindows ]; then
     echo Start from GRASS toplevel dir
@@ -106,35 +106,6 @@
 
 exec 3>&1 > >(tee mswindows/osgeo4w/package.log) 2>&1
 
-DLLS="
-	/mingw64/bin/zlib1.dll
-	/mingw64/bin/libbz2-1.dll
-	/mingw64/bin/libiconv-2.dll
-	/mingw64/bin/libfontconfig-1.dll
-	/mingw64/bin/libgfortran-5.dll
-	/mingw64/bin/libbrotlidec.dll
-	/mingw64/bin/libbrotlicommon.dll
-	/mingw64/bin/libintl-8.dll
-	/mingw64/bin/libsystre-0.dll
-	/mingw64/bin/libtre-5.dll
-	/mingw64/bin/libwinpthread-1.dll
-	/mingw64/bin/libcairo-2.dll
-	/mingw64/bin/libpixman-1-0.dll
-	/mingw64/bin/libpng16-16.dll
-	/mingw64/bin/libfreetype-6.dll
-	/mingw64/bin/libharfbuzz-0.dll
-	/mingw64/bin/libglib-2.0-0.dll
-	/mingw64/bin/libgomp-1.dll
-	/mingw64/bin/libgraphite2.dll
-	/mingw64/bin/libpcre-1.dll
-	/mingw64/bin/libstdc++-6.dll
-	/mingw64/bin/libgcc_s_seh-1.dll
-	/mingw64/bin/libfftw3-3.dll
-	/mingw64/bin/libblas.dll
-	/mingw64/bin/liblapack.dll
-	/mingw64/bin/libquadmath-0.dll
-"
-
 if ! [ -f mswindows/osgeo4w/configure-stamp ]; then
 	if [ -e include/Make/Platform.make ] ; then
 	    log make distclean
@@ -144,23 +115,22 @@
 	log remove old logs
 	rm -f mswindows/osgeo4w/package.log.*
 
-	mkdir -p dist.x86_64-w64-mingw32/bin
-	cp -uv $DLLS dist.x86_64-w64-mingw32/bin
-
 	mkdir -p mswindows/osgeo4w/lib
 	rm -f $OSGEO4W_ROOT_MSYS/lib/libpq.a
 	cp -uv $OSGEO4W_ROOT_MSYS/lib/libpq.lib mswindows/osgeo4w/lib/libpq.lib
 	cp -uv $OSGEO4W_ROOT_MSYS/lib/sqlite3_i.lib mswindows/osgeo4w/lib/sqlite3.lib
 
 	log configure
+	CFLAGS="$CFLAGS -pipe" \
+	CXXFLAGS="$CXXFLAGS -pipe" \
 	./configure \
 		--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 \
+		--with-libs="${OSGEO4W_ROOT_MSYS}/lib ${OSGEO4W_ROOT_MSYS}/bin" \
+		--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 \
 		--with-opengl=windows \
 		--without-x \
 		--with-cxx \
@@ -168,18 +138,18 @@
 		--enable-largefile \
 		--with-fftw \
 		--with-freetype \
-		--with-freetype-includes=/mingw64/include/freetype2 \
-		--with-proj-share=$OSGEO4W_ROOT_MSYS/share/proj \
-		--with-proj-includes=$OSGEO4W_ROOT_MSYS/include \
-		--with-proj-libs=$OSGEO4W_ROOT_MSYS/lib \
+		--with-freetype-includes=${OSGEO4W_ROOT_MSYS}/include/freetype2 \
+		--with-proj-share=${OSGEO4W_ROOT_MSYS}/share/proj \
+		--with-proj-includes=${OSGEO4W_ROOT_MSYS}/include \
+		--with-proj-libs=${OSGEO4W_ROOT_MSYS}/lib \
 		--with-postgres \
-		--with-postgres-includes=$OSGEO4W_ROOT_MSYS/include \
-		--with-postgres-libs=${PWD}/mswindows/osgeo4w/lib \
-		--with-gdal=$PWD/mswindows/osgeo4w/gdal-config \
-		--with-geos=$PWD/mswindows/osgeo4w/geos-config \
+		--with-postgres-includes=${OSGEO4W_ROOT_MSYS}/include \
+		--with-postgres-libs=${SRC}/mswindows/osgeo4w/lib \
+		--with-gdal=${SRC}/mswindows/osgeo4w/gdal-config \
+		--with-geos=${SRC}/mswindows/osgeo4w/geos-config \
 		--with-sqlite \
-		--with-sqlite-includes=$OSGEO4W_ROOT_MSYS/include \
-		--with-sqlite-libs=$PWD/mswindows/osgeo4w/lib \
+		--with-sqlite-includes=${OSGEO4W_ROOT_MSYS}/include \
+		--with-sqlite-libs=${OSGEO4W_ROOT_MSYS}/lib \
 		--with-regex \
 		--with-nls \
 		--with-zstd \
@@ -187,13 +157,14 @@
 		--with-netcdf=${OSGEO4W_ROOT_MSYS}/bin/nc-config \
 		--with-blas \
 		--with-lapack \
-		--with-lapack-includes=/mingw64/include \
 		--with-openmp \
 		--with-cairo \
-		--with-cairo-includes=$OSGEO4W_ROOT_MSYS/include \
-		--with-cairo-ldflags="-L$PWD/mswindows/osgeo4w/lib -lcairo -lfontconfig" \
+		--with-cairo-includes=${OSGEO4W_ROOT_MSYS}/include \
+		--with-cairo-ldflags="-L${SRC}/mswindows/osgeo4w/lib -lcairo" \
+		--with-cairo-libs=$OSGEO4W_ROOT_MSYS/lib \
 		--with-bzlib \
-		--with-liblas=$PWD/mswindows/osgeo4w/liblas-config \
+		--with-liblas=${SRC}/mswindows/osgeo4w/liblas-config \
+		--with-readline \
 		--without-pdal
 
 	touch mswindows/osgeo4w/configure-stamp
@@ -247,9 +218,11 @@
     unix2dos etc/postinstall/grass${PACKAGE_POSTFIX}.bat
     unix2dos etc/preremove/grass${PACKAGE_POSTFIX}.bat
 
-    # copy dependencies (TODO: to be reduced)
-    cp -uv $DLLS apps/grass/grass$POSTFIX/bin
-    cp -uv /mingw64/etc/fonts/fonts.conf apps/grass/grass$POSTFIX/etc
+    # copy dependencies
+    cp -uv $(/usr/bin/find apps/grass/grass$POSTFIX -iname "*.dll" -o -iname "*.exe" | PATH=$PWD/apps/grass/grass$POSTFIX/lib:$PWD/bin:/mingw64/bin:/usr/bin /usr/bin/xargs /usr/bin/ldd | /usr/bin/sed -ne 's#^.* => \(/mingw64/bin/.*\) (.*)$#\1#p' | /usr/bin/sort -u) apps/grass/grass$POSTFIX/bin
+
+    # copy R batch files
+    cp -uv $SRC/mswindows/external/rbatch/* apps/grass/grass$POSTFIX/bin
 
     # creating grass package
     /bin/tar -cjf $PDIR/grass$PACKAGE_POSTFIX-$VERSION-$PACKAGE_PATCH.tar.bz2 \
