Skip to content

Commit

Permalink
portable/installer: work around 32-bit issue with Windows 10
Browse files Browse the repository at this point in the history
At least on one machine this developer has access to, the default base
address of the 32-bit `msys-2.0.dll` is no good on Windows 10, so we need
to adjust it.

It would be best, of course, if the Batch script could run any program to
guess the best base address, or whether it needs to be adjusted to begin
with, but so far none was identified.

Therefore, let's just stay with the hard-coded base address adjustment
when running in 32-bit mode on Windows 10, until a brilliant idea comes
along to make it better.

This fixes git-for-windows/git#361

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
  • Loading branch information
dscho committed Sep 10, 2015
1 parent cc2c461 commit 7bc16f5
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 0 deletions.
9 changes: 9 additions & 0 deletions installer/install.iss.in
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,15 @@ Type: files; Name: {app}\Git Bash.lnk
Type: dirifempty; Name: {app}\home\{username}
Type: dirifempty; Name: {app}\home

#ifdef IS32
; Delete the files required for rebaseall
Type: files; Name: {app}\bin\msys-2.0.dll
Type: files; Name: {app}\bin\rebase.exe
Type: dirifempty; Name: {app}\bin
Type: files; Name: {app}\etc\rebase.db.i386
Type: dirifempty; Name: {app}\etc
#endif

[Code]
#include "helpers.inc.iss"
#include "environment.inc.iss"
Expand Down
19 changes: 19 additions & 0 deletions post-install.bat
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,25 @@
@REM We cannot use %PROCESSOR_ARCHITECTURE% for this test because it is
@REM allowed to install a 32-bit Git for Windows into a 64-bit system.
@IF EXIST mingw32\bin\git.exe @(
@REM We need to rebase just to make sure that it still works even with
@REM 32-bit Windows 10
@FOR /F "tokens=4 delims=.[XP " %%i IN ('ver') DO @SET ver=%%i
@IF 10 LEQ %ver @(
@REM We copy `rebase.exe` because it links to `msys-2.0.dll`
@REM (and @REM thus prevents modifying it). It is okay to
@REM execute `rebase.exe`, though, because the DLL base address
@REM problems only really show when other processes are
@REM `fork()`ed and `rebase.exe` does no such thing.
@IF NOT EXIST bin\rebase.exe @(
@IF NOT EXIST bin @MKDIR bin
@COPY usr\bin\rebase.exe bin\rebase.exe
)
@IF NOT EXIST bin\msys-2.0.dll @(
@COPY usr\bin\msys-2.0.dll bin\msys-2.0.dll
)
@bin\rebase.exe -b 0x64000000 usr\bin\msys-2.0.dll
)

usr\bin\dash.exe -c '/usr/bin/dash usr/bin/rebaseall -p'
)

Expand Down

0 comments on commit 7bc16f5

Please sign in to comment.