Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/update git bash string resource editor #118

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
*.swp
edit-git-bash.dll
edit-git-bash.exe
/cached-source-packages/
/download-stats.ids
/git-extra/pkg/
Expand All @@ -7,7 +9,6 @@
/installer/ReleaseNotes.html
/installer/bindimage.txt
/installer/config.iss
/installer/edit-git-bash.exe
/installer/install.log
/installer/is-unicode.exe
/installer/file-list.iss
Expand Down
13 changes: 13 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
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 $@ $^

This comment was marked as off-topic.

This comment was marked as off-topic.


edit-git-bash.exe: edit-git-bash.c
gcc -DSTANDALONE_EXE $(CFLAGS) -o $@ $^
9 changes: 6 additions & 3 deletions installer/edit-git-bash.c → edit-git-bash.c
Original file line number Diff line number Diff line change
Expand Up @@ -49,19 +49,22 @@ int edit_git_bash(LPWSTR git_bash_path, LPWSTR new_command_line)
len = wcslen(new_command_line);
alloc = 2 * (len + 16);
buffer = calloc(alloc, 1);

if (!buffer)
return 1;

buffer[0] = (WCHAR) len;
memcpy(buffer + 1, new_command_line, 2 * len);

if (!(handle = BeginUpdateResource(git_bash_path, FALSE)))
return 2;

if (!UpdateResource(handle, RT_STRING, MAKEINTRESOURCE(1),
MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
if (!UpdateResource(handle, RT_STRING, MAKEINTRESOURCE(1),
MAKELANGID(LANG_ENGLISH, SUBLANG_ENGLISH_US),
buffer, alloc))
result = 3;
if (!EndUpdateResource(handle, FALSE))

if (!EndUpdateResource(handle, FALSE))
return 4;

return result;
Expand Down
10 changes: 0 additions & 10 deletions installer/Makefile

This file was deleted.

Binary file removed installer/edit-git-bash.dll
Binary file not shown.
2 changes: 1 addition & 1 deletion 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.dll; Flags: dontcopy

[Dirs]
Name: "{app}\tmp"
Expand Down
8 changes: 6 additions & 2 deletions installer/release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,6 @@ case "$version" in
*) die "InnoSetup requires a version that begins with a digit";;
esac

../render-release-notes.sh --css usr/share/git/

# Evaluate architecture
ARCH="$(uname -m)"

Expand All @@ -68,6 +66,12 @@ x86_64)
;;
esac

echo "Generating release notes to be included in the installer ..."
../render-release-notes.sh --css usr/share/git/

echo "Compiling edit-git-bash.dll ..."
make -C ../ edit-git-bash.dll

if test t = "$skip_files"
then
LIST=
Expand Down