@@ -2184,7 +2184,6 @@ end;
2184
2184
procedure CleanupWhenUpgrading ;
2185
2185
var
2186
2186
ErrorCode:Integer;
2187
- ProgramData:String;
2188
2187
begin
2189
2188
if UninstallAppPath<>' ' then begin
2190
2189
// Save a copy of the system config so that we can copy it back later
@@ -2195,15 +2194,6 @@ begin
2195
2194
end else if FileExists(UninstallAppPath+' \etc\gitconfig' ) and
2196
2195
(not FileCopy(UninstallAppPath+' \etc\gitconfig' ,ExpandConstant(' {tmp}\gitconfig.system' ),True)) then
2197
2196
LogError(' Could not save system config; continuing anyway' );
2198
-
2199
- ProgramData:=ExpandConstant(' {commonappdata}' );
2200
- if FileExists(UninstallAppPath+' \etc\gitconfig' ) and not FileExists(ProgramData+' \Git\config' ) then begin
2201
- if not ForceDirectories(ProgramData+' \Git' ) then
2202
- LogError(' Could not initialize Windows-wide Git config.' )
2203
- else if not FileCopy(UninstallAppPath+' \etc\gitconfig' ,ProgramData+' \Git\config' ,False) then
2204
- LogError(' Could not copy old Git config to Windows-wide location.' );
2205
- end ;
2206
-
2207
2197
end ;
2208
2198
2209
2199
if UninstallString<>' ' then begin
@@ -2371,7 +2361,7 @@ end;
2371
2361
2372
2362
procedure CurStepChanged (CurStep:TSetupStep);
2373
2363
var
2374
- ProgramData, DllPath,FileName,Cmd,Msg,Ico:String;
2364
+ DllPath,FileName,Cmd,Msg,Ico:String;
2375
2365
BuiltIns,ImageNames,EnvPath:TArrayOfString;
2376
2366
Count,i:Longint;
2377
2367
RootKey:Integer;
@@ -2398,7 +2388,6 @@ begin
2398
2388
end ;
2399
2389
2400
2390
AppDir:=ExpandConstant(' {app}' );
2401
- ProgramData:=ExpandConstant(' {commonappdata}' );
2402
2391
2403
2392
{
2404
2393
Copy dlls from "/mingw64/bin" to "/mingw64/libexec/git-core" if they are
@@ -2471,20 +2460,6 @@ begin
2471
2460
end else
2472
2461
LogError(' Line {#__LINE__}: Unable to read file "{#MINGW_BITNESS}\{#APP_BUILTINS}".' );
2473
2462
2474
- // Create default ProgramData git config file
2475
- if not FileExists(ProgramData + ' \Git\config' ) then begin
2476
- if not DirExists(ProgramData + ' \Git' ) then begin
2477
- if not CreateDir(ProgramData + ' \Git' ) then begin
2478
- Log(' Line {#__LINE__}: Creating directory "' + ProgramData + ' \Git" failed.' );
2479
- end ;
2480
- end ;
2481
- if not FileExists(ExpandConstant(' {tmp}\programdata-config.template' )) then
2482
- ExtractTemporaryFile(' programdata-config.template' );
2483
- if not FileCopy(ExpandConstant(' {tmp}\programdata-config.template' ), ProgramData + ' \Git\config' , True) then begin
2484
- Log(' Line {#__LINE__}: Creating initial "' + ProgramData + ' \Git\config" failed.' );
2485
- end ;
2486
- end ;
2487
-
2488
2463
// Copy previous system wide git config file, if any
2489
2464
if FileExists(ExpandConstant(' {tmp}\gitconfig.system' )) then begin
2490
2465
if (not ForceDirectories(AppDir+' \{#ETC_GITCONFIG_DIR}' )) then
@@ -2509,35 +2484,25 @@ begin
2509
2484
else
2510
2485
GitSystemConfigSet(' http.sslBackend' ,' openssl' );
2511
2486
2512
- if FileExists(ProgramData+' \Git\config' ) then begin
2513
- if not Exec(AppDir+' \bin\bash.exe' ,' -c "value=\"$(git config -f config pack.packsizelimit)\" && if test 2g = \"$value\"; then git config -f config --unset pack.packsizelimit; fi"' ,ProgramData+' \Git' ,SW_HIDE,ewWaitUntilTerminated,i) then
2514
- LogError(' Unable to remove packsize limit from ProgramData config' );
2515
- Cmd:=AppDir+' /' ;
2487
+ if not RdbCurlVariant[GC_WinSSL].Checked then begin
2488
+ Cmd:=AppDir+' /{#MINGW_BITNESS}/ssl/certs/ca-bundle.crt' ;
2516
2489
StringChangeEx(Cmd,' \' ,' /' ,True);
2517
- if not Exec(AppDir+' \bin\bash.exe' ,' -c "value=\"$(git config -f config http.sslcainfo)\" && case \"$value\" in \"' +Cmd+' \"/*|\"C:/Program Files/Git/\"*|\"c:/Program Files/Git/\"*) git config -f config --unset http.sslcainfo;; esac"' ,ProgramData+' \Git' ,SW_HIDE,ewWaitUntilTerminated,i) then
2518
- LogError(' Unable to delete http.sslCAInfo from ProgramData config' );
2519
- if not RdbCurlVariant[GC_WinSSL].Checked then begin
2520
- Cmd:=AppDir+' /{#MINGW_BITNESS}/ssl/certs/ca-bundle.crt' ;
2521
- StringChangeEx(Cmd,' \' ,' /' ,True);
2522
- GitSystemConfigSet(' http.sslCAInfo' ,Cmd);
2523
- end else
2524
- GitSystemConfigSet(' http.sslCAInfo' ,#0 );
2525
- end ;
2490
+ GitSystemConfigSet(' http.sslCAInfo' ,Cmd);
2491
+ end else
2492
+ GitSystemConfigSet(' http.sslCAInfo' ,#0 );
2526
2493
2527
2494
{
2528
2495
Adapt core.autocrlf
2529
2496
}
2530
2497
2531
2498
if RdbCRLF[GC_LFOnly].checked then begin
2532
- Cmd:=' core.autocrlf input' ;
2499
+ Cmd:=' input' ;
2533
2500
end else if RdbCRLF[GC_CRLFAlways].checked then begin
2534
- Cmd:=' core.autocrlf true' ;
2501
+ Cmd:=' true' ;
2535
2502
end else begin
2536
- Cmd:=' core.autocrlf false' ;
2503
+ Cmd:=' false' ;
2537
2504
end ;
2538
- if not Exec(AppDir + ' \{#MINGW_BITNESS}\bin\git.exe' , ' config -f config ' + Cmd,
2539
- ProgramData + ' \Git' , SW_HIDE, ewWaitUntilTerminated, i) then
2540
- LogError(' Unable to configure the line ending conversion: ' + Cmd);
2505
+ GitSystemConfigSet(' core.autocrlf' ,Cmd);
2541
2506
2542
2507
{
2543
2508
Configure the terminal window for Git Bash
@@ -2551,24 +2516,17 @@ begin
2551
2516
Configure extra options
2552
2517
}
2553
2518
2554
- if RdbExtraOptions[GP_FSCache].checked then begin
2555
- Cmd:=' core.fscache true' ;
2556
-
2557
- if not Exec(AppDir + ' \{#MINGW_BITNESS}\bin\git.exe' , ' config -f config ' + Cmd,
2558
- ProgramData + ' \Git' , SW_HIDE, ewWaitUntilTerminated, i) then
2559
- LogError(' Unable to enable the extra option: ' + Cmd);
2560
- end ;
2519
+ if RdbExtraOptions[GP_FSCache].checked then
2520
+ GitSystemConfigSet(' core.fscache' ,' true' );
2561
2521
2562
2522
if RdbExtraOptions[GP_GCM].checked then
2563
2523
GitSystemConfigSet(' credential.helper' ,' manager' );
2564
2524
2565
2525
if RdbExtraOptions[GP_Symlinks].checked then
2566
- Cmd:=' core.symlinks true'
2526
+ Cmd:=' true'
2567
2527
else
2568
- Cmd:=' core.symlinks false' ;
2569
- if not Exec(AppDir + ' \{#MINGW_BITNESS}\bin\git.exe' , ' config -f config ' + Cmd,
2570
- ProgramData + ' \Git' , SW_HIDE, ewWaitUntilTerminated, i) then
2571
- LogError(' Unable to enable the extra option: ' + Cmd);
2528
+ Cmd:=' false' ;
2529
+ GitSystemConfigSet(' core.symlinks' ,Cmd);
2572
2530
2573
2531
{
2574
2532
Configure experimental options
0 commit comments