Inno Setup - InfoBeforeFile page before License page - inno-setup

By default, the page showing InfoBeforeFile file is shown after the license page. From reading the documentation I should be able to re-arrange when these pages are displayed but I don't see how the ordered is structured in Inno setup scripts or the default.isl. This is all under the [Setup] section.
I am simply trying to move the InfoBeforeFile page to be displayed before displaying the license page.
Any help or direction would be appreciated.

After review of the two setup help and documentation, I've found the solution.
Summary: Basically, what this does is clone the page of Information Page and uses the language variables from that page (WizardInfoBefore) and when the page is created with CreateOutputMsgMemoPage it is set as a 'Welcome Page' with the first parameter of wpWelcome.
You must a define, a welcome page text
#define WelcomeFile 'welcome.rtf'
Define your normal license file under the [Setup] section:
LicenseFile=gnu.rtf
Include the following line in [Files] section:
Source: "{#WelcomeFile}"; Flags: dontcopy
Include the following lines in the [Code] section:
[Code]
var
WelcomePage: TOutputMsgMemoWizardPage;
procedure InitializeWizard();
var
WelcomeFileName: string;
WelcomeFilePath: string;
begin
{ Create welcome page, with the same labels as the information page }
WelcomePage :=
CreateOutputMsgMemoPage(
wpWelcome, SetupMessage(msgWizardInfoBefore), SetupMessage(msgInfoBeforeLabel),
SetupMessage(msgInfoBeforeClickLabel), '');
{ Load welcome page }
WelcomeFileName := '{#WelcomeFile}';
ExtractTemporaryFile(WelcomeFileName);
WelcomeFilePath := ExpandConstant('{tmp}\' + WelcomeFileName);
WelcomePage.RichEditViewer.Lines.LoadFromFile(WelcomeFilePath);
DeleteFile(WelcomeFilePath);
end;
Output:

You cannot reorder the standard pages.
Your might be able to code a different order by cleverly implementing NextButtonClick, BackButtonClick, CurPageChanged and ShouldSkipPage event functions. But that would be too complicated. You would have to re-implement lot of built in functionality of Inno Setup.
A way easier is to insert a custom license page or info page in the order you want.
This example adds a custom license page:
How to create two LicenseFile pages in Inno Setup.
Actually adding a custom info page is
a lot easier, as it does not have the radio buttons. All you need is to load a file to a page created with CreateOutputMsgMemoPage function.

Related

Directory confirmation dialog window in Inno Setup

I wanna know how to add that directory confirmation dialog window, where it's showing the main path but the user can still change it and apply it to this code:
[Setup]
AppName=Test
AppVersion=1.0.0
DefaultGroupName=Test
OutputBaseFilename=Test
DisableWelcomePage=no
[Components]
Name: "Format1"; Description: "Format1";
Name: "Format2"; Description: "Format2";
[Files]
Source: "I:\Format1.dll"; DestDir: "{app}\Test\Format1"; Flags:; Components: Format1
Source: "I:\Format2.dll"; DestDir: "{app}\Test\Format2"; Flags:; Components: Format2
By directory confirmation dialog window you mean the Inno's standard Directory page? Use:
[Setup]
DisableDirPage=no
Default value is auto so force this value to no to always show the page, see the doc:
[Setup]: DisableDirPage Valid values: auto, yes, or no Default
value: auto
Description:
If this is set to yes, Setup will not show the Select Destination Location wizard page.
If this is set to auto, at startup Setup will look in the registry to see if the same application is already installed, and if so, it will not show the Select Destination Location wizard page.
Also see AlwaysShowDirOnReadyPage.
More details in online Inno help

Hide URL from Inno Setup download page

I would like to hide the URL from which the files are being downloaded.
I can't find this information.
Any hints of doing this?
Move the Msg2Label label from the page's client area:
DownloadPage.Msg2Label.Top := ScaleY(-100);
(thanks to #MDenis for correction)
Note that this won't prevent people from finding the URL from where you are downloading the files.

Inno Setup: Do not (re)create a shortcut if it already exist

I want to add a shortcut only if it doesn't exist yet.
Similarlu to onlyifdoesntexist flag from Files section, which does not exist in Icons section.
Is there a way to do this without adding code in Code section?
I tried
[Icons]
Name:"{userdesktop}\HotKey\link-to-program";Filename:"{app}\program.exe";HotKey:"Ctrl+Shift+f"
Name:"{userdesktop}\link-to-program"; Filename:"{app}\program.exe"
But that fails in this section.
Here you go
[Icons]
Name: "{userdesktop}\HotKey\link-to-program"; Filename:"{app}\program.exe"; \
Check: Not FileExists(ExpandConstant('{userdesktop}\HotKey\link-to-program.lnk'))
(FileExists is built in, so you don't need to declare it).
I also marked that folder as hidden to achieve my goal to have an extra shortcut that is not accessible by the user (as commented in the question), but this is not necessary for the solution itself`.
[Dirs]
Name: "{userdesktop}\HotKey"; Attribs: hidden system

Inno Setup: How to change LicenseFile text?

I have a single license.txt file. I use it for all of my applications.
[Setup]
LicenseFile=license.txt
I want my user to see a title "{#MyAppName} License Agreement" at the beginning of the license agreement text. But I don't want to change license.txt file content.
Is there any Inno Setup code way to achieve this? Thanks in advance.
For example, to change the fist line of license, you can do:
[Code]
procedure InitializeWizard();
begin
WizardForm.LicenseMemo.Lines[0] := '{#MyAppName} License Agreement';
WizardForm.LicenseMemo.SelStart := 0;
end;
Another way is to use Inno Setup preprocessor to generate a modified license file out of your template file.

Displaying vertical images with Inno Setup [duplicate]

This question already has answers here:
WizardImageFile does not work in Inno Setup 5.5.8
(2 answers)
Closed 4 years ago.
If you look here it shows a vertical image on the left. Example:
Now, I have the entries in my [Setup] section:
WizardImageFile=compiler:wizmodernimage-is.bmp
WizardSmallImageFile=compiler:wizmodernsmallimage-is.bmp
Yet for me, I never get images showing on the left:
Has the vertical image been dropped? I verify the files are in the compiler folder.
I found this answer. It states:
The WizardImageFile is shown on the Welcome and Finish pages. However, the Welcome page is skipped by default now (see DisableWelcomePage), so it will normally only be visible on the Finished page. (This is enabled by default, but it is possible that you disabled that too -- see DisableFinishedPage.)
The WizardSmallImageFile is shown on all other pages.
That explains why I can’t see the images. Wonder by the Welcome Page is off by default?
I found this which states:
Don't use Welcome pages—make the first page functional whenever possible. Use an optional Getting Started page only when:
The wizard has prerequisites that are necessary to complete the wizard successfully.
Users may not understand the purpose of the wizard based on its first Choice page, and there isn't room for further explanation.
The main instruction for Getting Started pages is "Before you begin:".

Resources