Skip to content
Closed
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
37 changes: 37 additions & 0 deletions installer/install.iss
Original file line number Diff line number Diff line change
Expand Up @@ -1904,6 +1904,40 @@ begin
#endif
end;

procedure PreselectShellIntegrationIfMatchingInstall();
var
RootKey: Integer;
Cmd: String;
AppPath: String;
begin
AppPath := UninstallAppPath; // Set earlier in QueryUninstallValues()

if AppPath = '' then
Exit;

if IsAdminLoggedOn then
RootKey := HKEY_LOCAL_MACHINE
else
RootKey := HKEY_CURRENT_USER;

// Git Bash Here
if RegQueryStringValue(RootKey,
'SOFTWARE\Classes\Directory\shell\git_shell\command', '', Cmd) then
begin
if Pos(AppPath, Cmd) > 0 then
WizardSelectComponents('ext\shellhere');
end;

// Git GUI Here
if RegQueryStringValue(RootKey,
'SOFTWARE\Classes\Directory\shell\git_gui\command', '', Cmd) then
begin
if Pos(AppPath, Cmd) > 0 then
WizardSelectComponents('ext\guihere');
end;
Comment on lines +1923 to +1937
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

While this might address your problem, it now opens up Git for Windows to more complaints along the lines "I upgraded via winget, and the Explorer integration was kept but all my other custom configuration is gone!".

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My apologizes - I am not usually doing public code fixes like that. So I am surely not aware of every details of the process. Will try to do better next time.

That said - I believe you did get exactly my intention - to solve the issue of Windows Integration being lost as part of update - regardless of the path we elect to do it (winget is among them, but it in fact apply to any silent, automated update process at the end).

But I do agree also that my fix is - indeed - insufficient. I did focus on my own issue - but not the whole picture.

If I dig a bit, it could be linked to the missing UsePreviousSetupType directive in the [Setup] section to tell the setup to actually reuse the component. I will give it a try as soon as I can.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will give it a try as soon as I can.

That sounds great!

end;


procedure InitializeWizard;
var
PrevPageID,TabOrder,TopOfLabels,Top,Left:Integer;
Expand All @@ -1923,6 +1957,9 @@ begin
GetDefaultsFromGitConfig('ProgramData');
GetDefaultsFromGitConfig('system');

// Check if Windows Integration already exists to reapply it during update
PreselectShellIntegrationIfMatchingInstall();

ChosenOptions:='';

PrevPageID:=wpSelectProgramGroup;
Expand Down
Loading