Skinned innosetup showing text instead of scrollbar - inno-setup

I am trying to create a new installer using InnoSetup 5.5.8 (u) and skinned using CodeJock's ISSkin v3.0.0. I am using one of the provided example skins (Office 2007 Black) applied by copying the code example from their website (http://isskin.codejock.com/gettingstarted.asp).
I am having some issues on our license agreement page. We currently show this using an RTF file in the default wizard screen. The problem is that on some machines we're getting text ('bef') showing instead of the skinned scrollbar:
The text (which is probably part of an error message) is also unreliable, as sometimes I see an unskinned, disabled scrollbar instead.
I reliably see the expected skin version on my main dev VM (Windows 8 Pro, Delphi and InnoSetup/ISSkin installed) and it's intermittent on my host machine (Win 10, no development software installed)
Has anyone encountered anything like this and got a decent fix/workaround? I have confirmed that removing the skinning code provides a working scrollbar, so that provides a workable solution for now.

This looks like a bug in skinning mechanism but the 'bef' is really weird I have never seen that. What official support says?
Maybe you could try to update/invalidate the component so the scrollbar is redrawn correctly.
Also you can try the Graphical Installer (http://www.graphical-installer.com) which is different skinning mechanism and check for this behavior there (sorry for little self promo :)

My solution for plaintext format:
procedure InitializeWizard();
var
NewLicenseMemo: TMemo;
begin
WizardForm.LicenseMemo.Visible := false;
NewLicenseMemo := TMemo.Create(WizardForm);
with NewLicenseMemo do
begin
Parent := WizardForm.LicenseMemo.Parent;
Left := WizardForm.LicenseMemo.Left;
Top := WizardForm.LicenseMemo.Top;
Width := WizardForm.LicenseMemo.Width;
Height := WizardForm.LicenseMemo.Height;
Text := WizardForm.LicenseMemo.Text;
ReadOnly := True;
ScrollBars := ssVertical;
end;
end;

Related

Can not create label on Inno Setup Welcome page

I'm trying to create a label (or a bitmap) on the welcome page using this code:
LabelTarget := TLabel.Create(WizardForm);
with LabelTarget do
begin
Parent := WizardForm.WelcomePage;
Left := ScaleX(198);
Top := ScaleY(105);
Caption := 'Target';
end;
It won't work, but if I change the parent for example to WizardForm.InstallingPage it will create that label on Installing page. Where is the problem?
It's because almost whole area of the WelcomePage is covered by an opaque WelcomeLabel2.
The TLabel is not a real Windows control. It is a virtual one, drawn by the form itself. So it gets hidden by any other real Windows control, even if the TLabel is technically on top of it (what it is, as your LabelTarget is created later than the WelcomeLabel2). The WelcomeLabel2 is TStaticText, what is a real control. So it hides your LabelTarget.
To solve this either:
Shrink the WelcomeLabel2 height, or
Change your LabelTarget to TStaticText.

Inno Setup - aligning custom button with the Cancel button

I ve got problems to set a button on the same topsize as the Cancel button when im using WizardSizePercent = 150 in the Setup section.
Here is my code:
AboutButton := TNewButton.Create(WizardForm);
AboutButton.Parent := WizardForm;
AboutButton.Left := WizardForm.CancelButton.Left;
AboutButton.Top := WizardForm.CancelButton.Top;
AboutButton.Width := WizardForm.CancelButton.Width;
AboutButton.Height := WizardForm.CancelButton.Height;
I think Inno Setup doesn't notice the WizardSizePercent, because it only uses the regular WizardForm size.
I assume your code is in InitializeWizard. That event function occurs before WizardSizePercent is applied. If you want your button to correctly align when the wizard window changes size, either due to WizardSizePercent or WizardResizable, you need follow their documentation:
Use Anchors and KeepSizeY properties to add full support for WizardResizable and WizardSizePercent to all your custom controls, custom wizard pages and TSetupForm forms if you have any. See the CodeClasses.iss example script for an example.
So particularly:
AboutButton.Anchors := WizardForm.CancelButton.Anchors;
CancelButton.Anchors is [akRight, akBottom]. If your "About" button should be left-aligned, use:
AboutButton.Anchors := [akLeft, akBottom];
Related question:
Adding a Print button to the License page in Inno Setup (revisited for Inno Setup 6)

Inno Setup: WizardForm from an external form

I was trying to create an installer for my new project and used an external DLL to call a function to create a custom form. Instead of using the WizardForm, can I create the WizardForm from that custom form?
Here's the code I use to create that form:
procedure NewFormCreate;
var
rt: TTimer;
begin
NewForm:= TForm.Create(nil);
NewForm.BorderStyle := bsNone;
CreateFormFromImage(NewForm.Handle, 'form.png');
rt:= TTimer.create(nil);
rt.OnTimer:= #WFProc;
rt.Interval:= 1;
rt.Enabled:= true;
NewForm.Show;
NewForm.Enabled:= False;
end;
If I understand your question correctly, you want to use your own implementation of the WizardForm.
You cannot. You can only modify the existing WizardForm. Maybe like this:
CreateFormFromImage(WizardForm.Handle, 'form.png');
You can of course create and display your own form, and prevent the WizardForm from even displaying.
But it does not make sense. The Inno Setup is all about the WizardForm. If you do not want to use it, you do not need the Inno Setup at all. Build your custom installer in Delphi (if that's your preferred IDE).
Maybe you should explain us what do you really want to achieve. It's quite probable that you have an XY problem.
Is your X problem creating an installer with irregular shape?
Instead of scripting everything manually you can use Graphical Installer for Inno Setup (http://graphical-installer.com/) and achieve something like this in few minutes:
If you use Delphi you can use RAD & Installer (http://rad-installer.com/) to create the Inno Setup installers directly from RAD Studio IDE.
Sorry for little self promo :)

How to stretch small wizard image over whole area in Inno Setup?

I need to stretch small wizard image in Inno Setup over the whole bitmap area and hide the labels like "select installation folder"... etc. What would be the corresponding code for this?
Set bounds of the WizardSmallBitmapImage to that of its parent
Hide the labels (PageDescriptionLabel and PageNameLabel)
procedure InitializeWizard();
begin
with WizardForm.WizardSmallBitmapImage do
SetBounds(Parent.Left, Parent.Top, Parent.Width, Parent.Height);
WizardForm.PageDescriptionLabel.Visible := False;
WizardForm.PageNameLabel.Visible := False;
end;

Custom Welcome and Finished page with stretched image in Inno Setup

I have created an image that I want to appear over whole Welcome and Finished pages of the installer, with only the bottom buttons showing.
The Welcome wizard page should be like:
The Finished page like:
I'm getting
Please help!
Thanks in advance😊
First, note that the Welcome page is disabled by default since Inno Setup 5.5.7. If you really want it, you have to enable it using DisableWelcomePage=no.
To display images only on the pages, you need to do:
Stretch WizardBitmapImage (Welcome) and WizardBitmapImage2 (Finished) over their respective parent pages.
Hide the other components, mainly the labels.
Make sure that the installer never needs to restart the machine, otherwise you get a restart prompt over the image.
Make sure you do not have any postinstall entries in the [Run] section, for the same reason.
The code is designed for WizardStyle=classic. For modern style it needs to be adjusted.
[Setup]
DisableWelcomePage=no
WizardImageFile=godfather.bmp
[Code]
procedure InitializeWizard();
begin
{ Welcome page }
{ Hide the labels }
WizardForm.WelcomeLabel1.Visible := False;
WizardForm.WelcomeLabel2.Visible := False;
{ Stretch image over whole page }
WizardForm.WizardBitmapImage.Width :=
WizardForm.WizardBitmapImage.Parent.Width;
{ Finished page }
{ Hide the labels }
WizardForm.FinishedLabel.Visible := False;
WizardForm.FinishedHeadingLabel.Visible := False;
{ Stretch image over whole page }
WizardForm.WizardBitmapImage2.Width :=
WizardForm.WizardBitmapImage2.Parent.Width;
end;

Resources