Skip to content

Commit

Permalink
sdk: work around problems with Windows 10 32-bit
Browse files Browse the repository at this point in the history
The symptom is that the *SDK installer* already fails to run (to be
precise, the first `pacman` call), suggesting to run `rebaseall` because
the DLL address ranges conflict already with msys-2.0.dll.

This does not really happen with all Windows 10 setups, but at least with
this developer's and with the box of the reporter of this ticket:

	http://sourceforge.net/p/msys2/tickets/190/

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
  • Loading branch information
dscho committed Sep 10, 2015
1 parent b78b618 commit 918a119
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions sdk-installer/setup-git-sdk.bat
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,28 @@
@REM set MSYSTEM so that MSys2 starts up in the correct mode
@set MSYSTEM=MINGW@@BITNESS@@

@REM need to rebase just to make sure that it still works even with 32-bit
@REM Windows 10
@SET initialrebase=false
@IF MINGW32 == %MSYSTEM% @(
@FOR /F "tokens=4 delims=.[XP " %%i IN ('ver') DO @SET ver=%%i
@IF 10 LEQ %ver @(
@SET initialrebase=false
)
)

@IF %initialrebase% == true @(
@REM we copy `rebase.exe` because it links to `msys-2.0.dll`.
@IF NOT EXIST "%cwd%"\bin\rebase.exe @(
@IF NOT EXIST "%cwd%"\bin @MKDIR "%cwd%"\bin
@COPY "%cwd%"\usr\bin\rebase.exe "%cwd%"\bin\rebase.exe
)
@IF NOT EXIST bin\msys-2.0.dll @(
@COPY usr\bin\msys-2.0.dll bin\msys-2.0.dll
)
@"%cwd%"\bin\rebase.exe -b 0x63000000 "%cwd%"\usr\bin\msys-2.0.dll
)

@SET /A counter=0
:INSTALL_RUNTIME
@SET /A counter+=1
Expand Down Expand Up @@ -45,6 +67,12 @@
@REM pacman's post-install scripts run without complaining about heap problems
@"%cwd%"\usr\bin\pacman -Sy --needed --force --noconfirm msys2-runtime

@REM need to rebase just to make sure that it still works even with 32-bit
@REM Windows 10
@IF %initialrebase% == true @(
@"%cwd%"\bin\rebase.exe -b 0x63000000 "%cwd%"\usr\bin\msys-2.0.dll
)

@IF ERRORLEVEL 1 GOTO INSTALL_RUNTIME

@SET /A counter=0
Expand Down

0 comments on commit 918a119

Please sign in to comment.