From 955e82b25a825f005946e7e4951e29404370aa94 Mon Sep 17 00:00:00 2001 From: Johannes Schindelin Date: Wed, 31 Aug 2016 13:52:36 +0200 Subject: [PATCH] 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 --- .gitignore | 1 - Makefile | 11 ++--------- installer/install.iss | 12 +++++++----- installer/release.sh | 6 +++--- 4 files changed, 12 insertions(+), 18 deletions(-) diff --git a/.gitignore b/.gitignore index 6e1c6db403..81d4f28ada 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,4 @@ *.swp -edit-git-bash.dll edit-git-bash.exe /cached-source-packages/ /download-stats.ids diff --git a/Makefile b/Makefile index 819fd041b4..fc9b7780b3 100644 --- a/Makefile +++ b/Makefile @@ -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 $@ $^ \ No newline at end of file + gcc -DSTANDALONE_EXE $(CFLAGS) -o $@ $^ diff --git a/installer/install.iss b/installer/install.iss index 9640c6d7e0..9316622b90 100644 --- a/installer/install.iss +++ b/installer/install.iss @@ -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" @@ -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).'; diff --git a/installer/release.sh b/installer/release.sh index 23c6d9d219..90f52f024f 100755 --- a/installer/release.sh +++ b/installer/release.sh @@ -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