Show the download progress by default and no hide button - inno-setup

When starting to download files from my setup, it only appears total progress and the button details to show what appears in the next image:
What I want to do is to have that step by default without hitting details button and not showing the hide button.

I assume, that we are talking about this Inno Download Plugin. On its source code page I found the idp.iss script file which seems to be an interface to the library. It contains the idpShowDetails function which if you call with the show parameter set to True will show the detail components, that you can see by clicking the details button. What remains then is hiding that details button, which in the script is accessible through the IDPForm record variable's DetailsButton member. Through this member you can set the Visible property to False to hide that button.
To realize this without modifying the original scripts you can include the following piece of code into your existing script:
procedure CurPageChanged(CurPageID: Integer);
begin
// if the downloader page was just shown, then...
if CurPageID = IDPForm.Page.ID then
begin
// show the detail components
idpShowDetails(True);
// and hide the details button
IDPForm.DetailsButton.Visible := False;
end;
end;
And a screenshot:

Related

Inno Setup Disable Next Button if user does not replace 'Enter' with anything else [duplicate]

This question already has answers here:
Inno Setup Disable Next button when input is not valid
(1 answer)
How to disable NextButton when file is not selected on InputFilePage (CreateInputFilePage)?
(1 answer)
Closed 4 years ago.
How do I prevent user from moving on if 'Enter' is not overwritten with anything else. Instead of 'Enter', I can also just make it blank. Regardless, the user must put something in there in order to enable the Next button. This is the second window after the welcome page that I need to do this with.
[Code]
var
SettingEnv: TInputQueryWizardPage;
procedure InitializeWizard;
begin
SettingEnv := CreateInputQueryPage(wpWelcome,
'User Input', '', 'Enter SettingEnv, then click Next.');
SettingEnv.Add('', False);
SettingEnv.Values[0] := 'Enter';
end;
I suggest you use:
function NextButtonClick(CurPageID: Integer): Boolean;
From the documentation:
Called when the user clicks the Next button. If you return True,
the wizard will move to the next page; if you return False, it will
remain on the current page (specified by CurPageID).
Note that this function is called on silent installs as well, even
though there is no Next button that the user can click. Setup instead
simulates "clicks" on the Next button. On a silent install, if your
NextButtonClick function returns False prior to installation starting,
Setup will exit automatically.
There is a related answer to a similar question which has code. This will help.

Inno Setup: How to display license page before custom page shows from procedure InitializeWizard();

I am using LicenseFile=D:\authorized\Builds\Integration\License.rtf to display license page and procedure InitializeWizard();.
The Problem is that the license page is displayed after the procedure InitializeWizard();. Is there any way we can display it before?
procedure InitializeWizard;
begin
{ Create the pages }
UsagePage := CreateInputOptionPage(wpWelcome,
'App setup information', 'How would you like to install App?',
'Would you like to install App as a service?.',
True, False);
UsagePage.Add('Yes');
UsagePage.Add('No');
UsagePage.Values[0] := true;
end;
It's a misunderstanding. The InitializeWizard function does not display anything. It just creates the custom page(s), it does not display them.
Try adding a MsgBox call at the end of the function. You will see that the message displays before the wizard form even pops up.
The order of the custom pages is determined by the AfterID parameter (the first one) of the Create*Page functions.
If you want the custom page to show after the license page, use wpLicense, instead of wpWelcome.
UsagePage := CreateInputOptionPage(wpLicense, ...);

Inno Setup Change Caption of an existing radio button on custom options page

I'm new to Inno Setup. I'm using the Wizard pages to create an installer.
I've created an option page an some input pages.
On these input pages I get some values. Depending on such values I want to change the caption of an radio button already created in the initialize procedure of the wizard.
So, if a user entered 100-701 on an input page, I want to change the radio buttons caption on a later page to something like this:
(*) 100-701
( ) Standard
Can someone hint me, if there is a way to modify the caption or do i have to create a custom page from scratch?
Thanks,
Klaus
The CreateInputOptionPage function returns an instance of TInputOptionWizardPage class.
The class has CheckListBox property of type TNewCheckListBox, which it turn has ItemCaption property.
var
Page: TInputOptionWizardPage;
{ ... }
Page := CreateInputOptionPage(...);
Page.Add('Option 1');
Page.Add('Option 2');
{ ... }
Page.CheckListBox.ItemCaption[0] := 'Alternative caption for Option 1';
Page.CheckListBox.ItemCaption[1] := 'Alternative caption for Option 2';

Inno Setup: Display desktop shortcut on Finish Page

We are showing restart options on finish page as restart is required after our product installation. If we show restart options on finish page we are unable to display checkbox on finish page. Is there a way to show both restart options and checkbox on finish page.
Not directly. You have to basically implement your own set of checkboxes, and handle them on your own.
I'm doing the same in my installer. See my .iss. The Numbers in the list below point to respective lines in my code.
In InitializeWizard create a set of checkboxes on WizardForm.FinishedPage. #1144
Implement event handler for WizardForm.YesRadio.OnClick and WizardForm.NoRadio.OnClick to disable (enable) the checkboxes when user opts to restart (or not restart). As #TLama pointed out, it does not make sense to execute something, if user is going to restart the machine. #621 #1212
In CurPageChanged for CurPageID = wpFinished, place the checkboxes below WizardForm.FinishedLabel, if restarting is not needed; or below WizardForm.NoRadio.Top, if restarting is needed (if restarting is needed always, you do not need this dynamic placement). #1295
In CurStepChanged for CurPageID = wpDone, process the actions according to checkboxes, if user opted not to restart. #1443
you can do this using NeedRestart() method, as describe in following code. just set flag boolean flag ResultForRestart to true if restart required or make it false as follows
ResultForRestart: Boolean; // globel in code section
function NeedRestart(): Boolean;
begin
Result := ResultForRestart;
end;
set flag ResultForRestart true/false as you requirement it will add two radio button restart now or latter

Is it appropriate to create controls in the CurPageChanged procedure?

I have code in CurPageChanged that adds a button to the license window. My CurPageChanged starts like this:
procedure CurPageChanged(CurPageID: Integer);
var Button123 TButton;
begin
if CurPageID = wpLicense then begin
Button123 := TButton.Create(WizardForm.LicenseMemo.Parent);
My question is wouldn't that create a button each time the page is changed to the wpLicense page? So if a user clicks past the license dialog, then goes back to it, wouldn't that create another button? How can I ensure that only one button is created? What I'm looking for is the most appropriate procedure from which to add a control --once-- to an existing wp. Thanks
My question is wouldn't that create a button each time the page is changed to the wpLicense page? So if a user clicks past the license dialog, then goes back to it, wouldn't that create another button?
Yes, it would create multiple buttons each time. Because the pages do not get destroyed, the controls on them do not get destroyed. But you can actually take advantage of that fact to create a single control and then show/hide it when necessary.
To start, modify the InitializeWizard method, which is called only once before the wizard is displayed. Create the button in here, like so:
procedure InitializeWizard();
var
MyButton: TButton;
begin
MyButton := TButton.Create(WizardForm.LicenseMemo.Parent);
MyButton.Parent := WizardForm.LicenseMemo.Parent;
MyButton.Top := 0;
MyButton.Left := 0;
MyButton.Caption := 'My Custom Button';
...
end;

Resources