Moshe Stone
Moshe Stone

Reputation: 135

Inno Setup - Give only 'Cancel' option on "Preparing to Install" page, if application is running

Is it possible to edit this window and give the user only 'Cancel' option? When the setup finds that the application is running and using one of the files in the setup, I want to give the user only 'Cancel' option to exit the setup.

I'm using Inno Setup 5.5.9

enter image description here

Upvotes: 3

Views: 605

Answers (1)

Martin Prikryl
Martin Prikryl

Reputation: 202271

On the "Preparing to Install" page:

  • Hide the two radio buttons
  • Disable the Next button
  • Reword the ApplicationsFound2 message
[Messages]
ApplicationsFound2=The following applications are using files that need to be updated by Setup. Please close them.
[Code]

procedure CurPageChanged(CurPageID: Integer);
begin
  if CurPageID = wpPreparing then
  begin
    WizardForm.PreparingYesRadio.Visible := False;
    WizardForm.PreparingNoRadio.Visible := False;
    WizardForm.NextButton.Enabled := False;
  end;
end;

Preparing to Install


Though, if your need to prevent the installer from running, when the application is running, a more appropriate solution is to use the AppMutex directive.

Upvotes: 4

Related Questions