Directory confirmation dialog window in Inno Setup - 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

Related

What is the default size of a custom page canvas area in Inno Setup?

What is the default size of a custom page canvas area (surface)?
This is so that I can accurately position the controls.
I assume you want to refer to TWizardPage.Surface.Width and TWizardPage.Surface.Height.
For an example, see the uses of CustomSelectTasksPage.Surface in:
Inno Setup - Create a dynamic list of components/types from external source (file or folder contents)

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.

Inno Setup - InfoBeforeFile page before License page

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.

Orchard CMS parameterized snippet manifest file

When I add this snippet manifest JumbotronSnippet.txt for my JumbotronSnippet.cshtml
DisplayName: Jumbotron
ToolboxIcon: \uf10c
Description: A configurable jumbotron
Category: Bootstrap
Fields:
- Name: Caption
DisplayName: Caption
Description: The caption to display
Type: Text
- Name: Body
DisplayName: Body
Description: The body text to display
Type: Text
Orchard Layout Part does not appear in dashboard.
My JumbotronSnippet.cshtml has this code:
<div class="jumbotron">
<h2>#Model.Caption</h2>
#Html.Raw(Model.Body)
</div>
Am I doing something wrong?
Check snippets feature is enabled
Have you enabled the Layouts Snippets feature in the Modules menu?
It's caught me out a few times because there is a Snippets category for the Shape element but that doesn't mean that Snippets is enabled.
Check you are running the right version
Which version of Orchard are you running? Sipke implemented the first version of the manifest file in 1.10.1 release (current).
I came along and added code to support all the extra fields that you are using but it looks like they haven't graduated to a released version yet, they are in the 1.10.x and dev branches though.
If you're already running 1.10.1 and want these features then you can just drop this file into your project - the only changes made to it are all contained in that file and they will just expand the number of fields supported in the manifest file parser.
Check your manifest formatting
Here is an example one that I'm using in a client project
DisplayName: Facebook Panel
ToolboxIcon: \uf230
Category: Social
Description: Configurable element to display a link to a Facebook page
Fields:
- Name: SocialUrl
Type: Text
DisplayName: Facebook URL
Description: The URL to your Facebook page.
Straight off I am seeing its space space dash space but you have more indentation. I don't recall if the exact number of spaces will break things but the indentation is important.

Resources