build/windows: Add Repair mode to our Installer

Closes: #1382

We do not allow multiple installs under the same GIMP_MUTEX_VERSION.
That is a good thing but depends on the partition of the install dir.
Otherwise, if the partition is lost, this become a registry nightmare.

That nightmare is a more 5 years old issue that tormented even one of
our past maintainers, Michael Natterer.

So, let's make possible to fix GIMP installation when the previous
install dir can't be accessed.
This commit is contained in:
Bruno Lopes 2025-03-24 17:10:44 -03:00
parent cbe2f6bec2
commit eab5e0615d
No known key found for this signature in database
2 changed files with 25 additions and 9 deletions

View file

@ -204,7 +204,7 @@ PrivilegesRequiredOverridesAllowed=dialog
ShowLanguageDialog=auto
DisableWelcomePage=no
InfoBeforeFile=gpl+python.rtf
DisableDirPage=auto
DisableDirPage=no
FlatComponentsList=yes
DisableProgramGroupPage=yes
AllowNoIcons=no
@ -755,9 +755,11 @@ begin
begin
WizardForm.NextButton.Visible := False;
if not (InstallType = 'itRepair') then begin
btnInstall.Visible := True;
end;
btnInstall.TabOrder := 1;
if InstallType = 'itInstall' then begin
if (InstallType = 'itRepair') or (InstallType = 'itInstall') then begin
btnCustomize.Visible := True;
end;
@ -772,8 +774,10 @@ end;
procedure CleanUpCustomWelcome();
begin
WizardForm.NextButton.Visible := True;
if not (InstallType = 'itRepair') then begin
btnInstall.Visible := False;
if InstallType = 'itInstall' then begin
end;
if (InstallType = 'itRepair') or (InstallType = 'itInstall') then begin
btnCustomize.Visible := False;
end;
@ -809,6 +813,8 @@ var i,ButtonWidth: Integer;
begin
DebugMsg('InitCustomPages','wpLicense');
CheckInstallType;
btnInstall := TNewButton.Create(WizardForm);
with btnInstall do
begin
@ -817,7 +823,6 @@ begin
Height := WizardForm.NextButton.Height;
Left := WizardForm.NextButton.Left;
Top := WizardForm.NextButton.Top;
CheckInstallType;
if InstallType = 'itInstall' then begin
Caption := CustomMessage('Install');
end else if InstallType = 'itReinstall' then begin
@ -839,8 +844,12 @@ begin
Left := 0;
Top := 0;
AutoSize := True;
if InstallType = 'itRepair' then begin
Caption := CustomMessage('Repair');
end else if InstallType = 'itInstall' then begin
Caption := CustomMessage('Customize');
end;
end;
btnCustomize := TNewButton.Create(WizardForm);
with btnCustomize do
@ -857,7 +866,11 @@ begin
Top := WizardForm.NextButton.Top;
Visible := False;
if InstallType = 'itRepair' then begin
Caption := CustomMessage('Repair');
end else if InstallType = 'itInstall' then begin
Caption := CustomMessage('Customize');
end;
OnClick := @CustomizeOnClick;
end;

View file

@ -47,6 +47,9 @@
<value>E&amp;xit</value>
</config>
<config name="Repair">
<value>&amp;Repair</value>
</config>
<config name="Install">
<value>&amp;Install</value>
</config>