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

View file

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