Skip to content
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
28 changes: 28 additions & 0 deletions installer/environment.inc.iss
Original file line number Diff line number Diff line change
Expand Up @@ -113,3 +113,31 @@ begin
// Also update the environment of the current process.
SetEnvironmentVariable(VarName,Path);
end;

// Sets the contents of the specified environment variable for the current process.
function SetEnvironmentVariable2(lpName:String;lpValue:LongInt):Boolean;
#ifdef UNICODE
external '[email protected] stdcall delayload';
#else
external '[email protected] stdcall delayload';
#endif

function SanitizeGitEnvironmentVariables:Boolean;
begin
Result:=True;
if not SetEnvironmentVariable2('GIT_INDEX_FILE',0) then Result:=False;
if not SetEnvironmentVariable2('GIT_INDEX_VERSION',0) then Result:=False;
if not SetEnvironmentVariable2('GIT_OBJECT_DIRECTORY',0) then Result:=False;
if not SetEnvironmentVariable2('GIT_ALTERNATE_OBJECT_DIRECTORIES',0) then Result:=False;
if not SetEnvironmentVariable2('GIT_DIR',0) then Result:=False;
if not SetEnvironmentVariable2('GIT_WORK_TREE',0) then Result:=False;
if not SetEnvironmentVariable2('GIT_NAMESPACE',0) then Result:=False;
if not SetEnvironmentVariable2('GIT_CEILING_DIRECTORIES',0) then Result:=False;
if not SetEnvironmentVariable2('GIT_DISCOVERY_ACROSS_FILESYSTEM',0) then Result:=False;
if not SetEnvironmentVariable2('GIT_COMMON_DIR',0) then Result:=False;
if not SetEnvironmentVariable2('GIT_DEFAULT_HASH',0) then Result:=False;
if not SetEnvironmentVariable2('GIT_CONFIG',0) then Result:=False;
if not SetEnvironmentVariable2('GIT_CONFIG_GLOBAL',0) then Result:=False;
if not SetEnvironmentVariable2('GIT_CONFIG_SYSTEM',0) then Result:=False;
if not SetEnvironmentVariable2('GIT_CONFIG_NOSYSTEM',0) then Result:=False;
end;
2 changes: 2 additions & 0 deletions installer/install.iss
Original file line number Diff line number Diff line change
Expand Up @@ -1798,6 +1798,8 @@ var
Data:String;
LblInfo:TLabel;
begin
SanitizeGitEnvironmentVariables();

InferredDefaultKeys:=TStringList.Create;
InferredDefaultValues:=TStringList.Create;
QueryUninstallValues();
Expand Down