Skip to content

Commit

Permalink
installer: allow disabling Git LFS
Browse files Browse the repository at this point in the history
If the checkbox is unchecked, we will simply delete `git-lfs.exe` and
remove the corresponding section in the system-wide config.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
  • Loading branch information
dscho committed Apr 4, 2017
1 parent 5f7d447 commit 16975a7
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions installer/install.iss
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ Name: icons\desktop; Description: On the Desktop
Name: ext; Description: Windows Explorer integration; Types: default
Name: ext\shellhere; Description: Git Bash Here; Types: default
Name: ext\guihere; Description: Git GUI Here; Types: default
Name: gitlfs; Description: Git LFS (Large File Support); Types: default; Flags: disablenouninstallwarning
Name: assoc; Description: Associate .git* configuration files with the default text editor; Types: default
Name: assoc_sh; Description: Associate .sh files to be run with Bash; Types: default
Name: consolefont; Description: Use a TrueType font in all console windows
Expand Down Expand Up @@ -2045,6 +2046,17 @@ begin
LogError('Line {#__LINE__}: Unable to create "Git GUI Here" shell extension.');
end;
{
Optionally disable Git LFS completely
}
if not IsComponentSelected('gitlfs') then begin
if not Exec(AppDir + '\{#MINGW_BITNESS}\bin\git.exe','config --system --remove-section filter.lfs','',SW_HIDE,ewWaitUntilTerminated, i) then
LogError('Could not disable Git LFS in the gitconfig.');
if not DeleteFile(AppDir+'\{#MINGW_BITNESS}\libexec\git-core\git-lfs.exe') and not DeleteFile(AppDir+'\{#MINGW_BITNESS}\bin\git-lfs.exe') then
LogError('Line {#__LINE__}: Unable to delete "git-lfs.exe".');
end;
{
Run post-install scripts to set up system environment
}
Expand Down

0 comments on commit 16975a7

Please sign in to comment.