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.
Related
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
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.
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
The builtin license page of Inno Setup allows to embed RTF file content into it. Is it possible to load RTF contents into TNewMemo? I am using TNewMemo inside my custom page.
No, you cannot load RTF into TNewMemo, you have to use TRichEditViewer.
See Import external RTF file for TRichEditViewer?
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.