Skip to content

Commit

Permalink
installer: switch to using edit-git-bash.exe
Browse files Browse the repository at this point in the history
... instead of edit-git-bash.dll.

Previously, we required the .dll and let InnoSetup open it directly.
This required the .dll to be 32-bit because InnoSetup is 32-bit.

Cross-compiling was a hassle, though, and it would probably eventually
be a good idea anyway to ship mingw-w64-git with the utility that lets
you edit the command-line to launch for git-bash.exe.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
  • Loading branch information
dscho committed Sep 1, 2016
1 parent bbd737c commit 955e82b
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 18 deletions.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
*.swp
edit-git-bash.dll
edit-git-bash.exe
/cached-source-packages/
/download-stats.ids
Expand Down
11 changes: 2 additions & 9 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,13 +1,6 @@
CFLAGS=-O2 -Wall
DLLINKFLAGS=-Wl,--kill-at -static-libgcc -shared

all: edit-git-bash.dll

# InnoSetup always uses the DLL target, and it must always be 32-bit
# because InnoSetup is only 32-bit aware.
edit-git-bash.dll: edit-git-bash.c
PATH=/mingw32/bin:$$PATH \
i686-w64-mingw32-gcc -march=i686 $(CFLAGS) $(DLLINKFLAGS) -o $@ $^
all: edit-git-bash.exe

edit-git-bash.exe: edit-git-bash.c
gcc -DSTANDALONE_EXE $(CFLAGS) -o $@ $^
gcc -DSTANDALONE_EXE $(CFLAGS) -o $@ $^
12 changes: 7 additions & 5 deletions installer/install.iss
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ Filename: {app}\ReleaseNotes.html; Description: View Release Notes; Flags: shell
Source: {#SourcePath}\ReleaseNotes.html; DestDir: {app}; Flags: replacesameversion; AfterInstall: DeleteFromVirtualStore
Source: {#SourcePath}\..\LICENSE.txt; DestDir: {app}; Flags: replacesameversion; AfterInstall: DeleteFromVirtualStore
Source: {#SourcePath}\NOTICE.txt; DestDir: {app}; Flags: replacesameversion; AfterInstall: DeleteFromVirtualStore; Check: ParamIsSet('VSNOTICE')
Source: {#SourcePath}\..\edit-git-bash.dll; Flags: dontcopy
Source: {#SourcePath}\..\edit-git-bash.exe; Flags: dontcopy

[Dirs]
Name: "{app}\tmp"
Expand Down Expand Up @@ -257,14 +257,16 @@ external 'CreateHardLinkW@Kernel32.dll stdcall delayload setuponly';
external 'CreateHardLinkA@Kernel32.dll stdcall delayload setuponly';
#endif
function EditGitBash(ExePath:WideString;Resource:WideString):Integer;
external 'edit_git_bash@files:edit-git-bash.dll stdcall delayload setuponly';
function OverrideGitBashCommandLine(GitBashPath:String;CommandLine:String):Integer;
var
Msg:String;
begin
Result:=EditGitBash(GitBashPath,CommandLine);
if not FileExists(ExpandConstant('{tmp}\edit-git-bash.exe')) then
ExtractTemporaryFile('edit-git-bash.exe');
StringChangeEx(GitBashPath,'"','\"',True);
StringChangeEx(CommandLine,'"','\"',True);
CommandLine:='"'+GitBashPath+'" "'+CommandLine+'"';
Exec(ExpandConstant('{tmp}\edit-git-bash.exe'),CommandLine,'',SW_HIDE,ewWaitUntilTerminated,Result);
if Result<>0 then begin
if Result=1 then begin
Msg:='Unable to edit '+GitBashPath+' (out of memory).';
Expand Down
6 changes: 3 additions & 3 deletions installer/release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,9 @@ echo "Generating release notes to be included in the installer ..."
../render-release-notes.sh --css usr/share/git/ ||
die "Could not generate release notes"

echo "Compiling edit-git-bash.dll ..."
make -C ../ edit-git-bash.dll ||
die "Could not build edit-git-bash.dll; try: pacman -S mingw-w64-i686-toolchain"
echo "Compiling edit-git-bash.exe ..."
make -C ../ edit-git-bash.exe ||
die "Could not build edit-git-bash.exe"

if test t = "$skip_files"
then
Expand Down

0 comments on commit 955e82b

Please sign in to comment.