Skip to content

Commit 955e82b

Browse files
committed
installer: switch to using edit-git-bash.exe
... 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 <[email protected]>
1 parent bbd737c commit 955e82b

File tree

4 files changed

+12
-18
lines changed

4 files changed

+12
-18
lines changed

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
*.swp
2-
edit-git-bash.dll
32
edit-git-bash.exe
43
/cached-source-packages/
54
/download-stats.ids

Makefile

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,6 @@
11
CFLAGS=-O2 -Wall
2-
DLLINKFLAGS=-Wl,--kill-at -static-libgcc -shared
32

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

125
edit-git-bash.exe: edit-git-bash.c
13-
gcc -DSTANDALONE_EXE $(CFLAGS) -o $@ $^
6+
gcc -DSTANDALONE_EXE $(CFLAGS) -o $@ $^

installer/install.iss

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ Filename: {app}\ReleaseNotes.html; Description: View Release Notes; Flags: shell
105105
Source: {#SourcePath}\ReleaseNotes.html; DestDir: {app}; Flags: replacesameversion; AfterInstall: DeleteFromVirtualStore
106106
Source: {#SourcePath}\..\LICENSE.txt; DestDir: {app}; Flags: replacesameversion; AfterInstall: DeleteFromVirtualStore
107107
Source: {#SourcePath}\NOTICE.txt; DestDir: {app}; Flags: replacesameversion; AfterInstall: DeleteFromVirtualStore; Check: ParamIsSet('VSNOTICE')
108-
Source: {#SourcePath}\..\edit-git-bash.dll; Flags: dontcopy
108+
Source: {#SourcePath}\..\edit-git-bash.exe; Flags: dontcopy
109109

110110
[Dirs]
111111
Name: "{app}\tmp"
@@ -257,14 +257,16 @@ external '[email protected] stdcall delayload setuponly';
257257
external '[email protected] stdcall delayload setuponly';
258258
#endif
259259
260-
function EditGitBash(ExePath:WideString;Resource:WideString):Integer;
261-
external 'edit_git_bash@files:edit-git-bash.dll stdcall delayload setuponly';
262-
263260
function OverrideGitBashCommandLine(GitBashPath:String;CommandLine:String):Integer;
264261
var
265262
Msg:String;
266263
begin
267-
Result:=EditGitBash(GitBashPath,CommandLine);
264+
if not FileExists(ExpandConstant('{tmp}\edit-git-bash.exe')) then
265+
ExtractTemporaryFile('edit-git-bash.exe');
266+
StringChangeEx(GitBashPath,'"','\"',True);
267+
StringChangeEx(CommandLine,'"','\"',True);
268+
CommandLine:='"'+GitBashPath+'" "'+CommandLine+'"';
269+
Exec(ExpandConstant('{tmp}\edit-git-bash.exe'),CommandLine,'',SW_HIDE,ewWaitUntilTerminated,Result);
268270
if Result<>0 then begin
269271
if Result=1 then begin
270272
Msg:='Unable to edit '+GitBashPath+' (out of memory).';

installer/release.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -78,9 +78,9 @@ echo "Generating release notes to be included in the installer ..."
7878
../render-release-notes.sh --css usr/share/git/ ||
7979
die "Could not generate release notes"
8080

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

8585
if test t = "$skip_files"
8686
then

0 commit comments

Comments
 (0)