Full screen background image in Inno Setup - inno-setup

How to give our setup a background full screen image in Inno Setup compiler.
Like this picture below.

Do not do that. It's against Windows design guidelines.
Anyway, if you have to, enable legacy full screen installer mode using the WindowVisible=yes directive and then modify the (now visible) background window via MainForm global variable of type TMainForm.
[Setup]
WindowVisible=yes
[Files]
Source: "back.bmp"; Flags: dontcopy
[Code]
procedure InitializeWizard();
var
BackgroundImage: TBitmapImage;
begin
BackgroundImage := TBitmapImage.Create(MainForm);
BackgroundImage.Parent := MainForm;
BackgroundImage.SetBounds(0, 0, MainForm.ClientWidth, MainForm.ClientHeight);
BackgroundImage.Stretch := True;
ExtractTemporaryFile('back.bmp');
BackgroundImage.Bitmap.LoadFromFile(ExpandConstant('{tmp}\back.bmp'));
end;

Related

Inno Setup customize FinishedLabel with Pascal Script

My goal with Inno Setup 6.x is to customize the FinishedLabel text in code, i.e., Pascal Script. The reason why I'm using Pascal Script is that I want to only customize/change the label if IsAdminMode() is true. How can I do that?
The following two approaches do not work:
Use a scripted constant:
[Messages]
FinishedLabel={code:GetFinishedLabel}
[Code]
function GetFinishedLabel(Param: String): String;
begin
Result := 'BLA';
end;
This shows "{code:GetFinishedLabel}" rather than "BLA".
Customize the wizard in InitializeWizard.
Complete (failing) example:
[Code]
procedure InitializeWizard();
begin
WizardForm.FinishedLabel.Caption := 'BLA';
end;
The FinishLabel still shows the original text from Default.isl
Any ideas?
The FinishedLabel is updated at the end of the installation according to various factors. So your value set in InitializeWizard is overridden. You have to set your custom message later, such as in CurPageChanged(wpFinished):
procedure CurPageChanged(CurPageID: Integer);
begin
if CurPageID = wpFinished then
begin
WizardForm.FinishedLabel.Caption := 'BLA';
end;
end;
You might consider to improve the code to do what Inno Setup would do, like:
Taking into account, if restart is needed (FinishedRestartLabel);
Taking into account, if icons were created (FinishedLabel vs. FinishedLabelNoIcons);
Adjusting the label height to fit the message;
Shifting RunList position according to the message height.

Getting ISSkin to work with latest Inno Setup Unicode

I am trying for the first time ISSkin with Inno Setup. I wanted to try the black style. So I tried their sample:
[Setup]
AppName=ISSkin Example
AppVersion=1.0.0.2
DefaultDirName={pf}\ISSkin
[Files]
; Add the ISSkin DLL used for skinning Inno Setup installations.
Source: ISSkin.dll; DestDir: {app}; Flags: dontcopy
; Add the Visual Style resource contains resources used for skinning,
; you can also use Microsoft Visual Styles (*.msstyles) resources.
Source: Styles\Office2007.cjstyles; DestDir: {tmp}; Flags: dontcopy
[Icons]
Name: {group}\Uninstall =ISSkin; Filename: {app}\unins000.exe
[Code]
// The following code block is used to load the ISS, pass in
// NormalBlack.ini as the second parameter to LoadSkin to use
// the Black color scheme instead of the default Blue color
// scheme.
// Importing LoadSkin API from ISSkin.DLL
procedure LoadSkin(lpszPath: String; lpszIniFileName: String);
external 'LoadSkin#files:isskin.dll stdcall';
// Importing UnloadSkin API from ISSkin.DLL
procedure UnloadSkin();
external 'UnloadSkin#files:isskin.dll stdcall';
// Importing ShowWindow Windows API from User32.DLL
function ShowWindow(hWnd: Integer; uType: Integer): Integer;
external 'ShowWindow#user32.dll stdcall';
function InitializeSetup(): Boolean;
begin
ExtractTemporaryFile('Office2007.cjstyles');
LoadSkin(ExpandConstant('{tmp}\Office2007.cjstyles'), 'NormalBlack.ini');
Result := True;
end;
procedure DeinitializeSetup();
begin
// Hide Window before unloading skin so user does not get
// a glimse of an unskinned window before it is closed.
ShowWindow(StrToInt(ExpandConstant('{wizardhwnd}')), 0);
UnloadSkin();
end;
I could not get it to work. The program looked normal.
I notice the software they provide is dated 2010. I am using latest Unicode Inno Setup.
How to do this skinning with it?
With Unicode version of Inno Setup you should use Unicode version of the plugin: ISSkinU.dll.
[Files]
Source: ISSkinU.dll; DestDir: {app}; Flags: dontcopy
[Code]
procedure LoadSkin(lpszPath: String; lpszIniFileName: String);
external 'LoadSkin#files:isskinU.dll stdcall';
procedure UnloadSkin();
external 'UnloadSkin#files:isskinU.dll stdcall';
(rest of the code is the same as in your question)

Semi-Transparent Wizard Form

I was working on an Inno Setup design when I faced this mighty question in front of me...How to make the Wizard form semi-transparent?
I know Delphi too so I'm thinking if there is any way we can use FMX's Fill.Color and transparency=true with Inno Setup?
I'm currently using this function for Wizard creation:
procedure CreateWizardForm;
begin
with WizardForm do begin
BorderStyle:=bsNone;
ClientWidth:=900;
ClientHeight:=540;
InnerNotebook.Hide;
OuterNotebook.Hide;
Center;
Bevel.Hide;
NextButton.Width:=0;
CancelButton.Width:=0;
end;
Form:=ImgLoad(WizardForm.Handle,ExpandConstant('{tmp}')+'\form.png',0,0,900,540,True,True);
end;
Regards
Ramiro
There is Inno Setup plug-in as for NSIS called IsWin7 or MegaFileUpload.
It works for Windows Vista and Windows 7 - both systems support Aero effects.
Keep in mind that iswin7.dll is non-official.
Sample:
[Files]
Source: ".\ISWin7.dll"; DestDir: "{tmp}"; Flags: dontcopy nocompression
[Code]
procedure iswin7_add_glass(Handle:HWND; Left, Top, Right, Bottom : Integer; GDIPLoadMode: boolean);
external 'iswin7_add_glass#files:iswin7.dll stdcall';
procedure iswin7_add_button(Handle:HWND);
external 'iswin7_add_button#files:iswin7.dll stdcall';
procedure iswin7_free;
external 'iswin7_free#files:iswin7.dll stdcall';
procedure InitializeWizard();
begin
iswin7_add_button(WizardForm.BackButton.Handle);
iswin7_add_button(WizardForm.NextButton.Handle);
iswin7_add_button(WizardForm.CancelButton.Handle);
iswin7_add_glass(WizardForm.Handle, 0, 0, 0, ScaleY(47), True);
end;
procedure DeinitializeSetup();
begin
iswin7_free;
end;
Is the feature you are trying to achieve called Aero (from Windows Vista)?
I think this is not possible to do in pure Inno Setup.
Check this NSIS plug-in: http://nsis.sourceforge.net/Aero_plug-in.
It is open source and uses some Windows API functions -- for inspiration.

How to make the bottom part of Inno Setup pages transparent? (screenshot given)

How can I make an Inno Setup installer like this:
I mean, I want to make the bottom part of Inno Setup pages like the above image.
What Pascal coding should I use?
Thanks. :)
The simplest way is to obtain iswin7.dll library from the internet and use it with following code:
[Files]
Source: ".\ISWin7.dll"; DestDir: "{tmp}"; Flags: dontcopy nocompression
[Code]
procedure iswin7_add_glass(Handle:HWND; Left, Top, Right, Bottom : Integer; GDIPLoadMode: boolean);
external 'iswin7_add_glass#files:iswin7.dll stdcall';
procedure iswin7_add_button(Handle:HWND);
external 'iswin7_add_button#files:iswin7.dll stdcall';
procedure iswin7_free;
external 'iswin7_free#files:iswin7.dll stdcall';
procedure InitializeWizard();
begin
iswin7_add_button(WizardForm.BackButton.Handle);
iswin7_add_button(WizardForm.NextButton.Handle);
iswin7_add_button(WizardForm.CancelButton.Handle);
iswin7_add_glass(WizardForm.Handle, 0, 0, 0, ScaleY(47), True);
end;
procedure DeinitializeSetup();
begin
iswin7_free;
end;
Keep in mind that iswin7.dll is non-official.

Select Setup language Dialog

I wanna style my inno-setup installer using vcl-styles or isskin. I tried both, and it looks amazing. The only problem is that unfortunately the Select Setup language Dialog is showen before the execution of the InitializeSetup event (where is the skins loaded).
[Files]
Source: ..\VclStylesinno.dll; DestDir: {app}; Flags: dontcopy
Source: ..\Styles\Amakrits.vsf; DestDir: {app}; Flags: dontcopy
[Code]
// Import the LoadVCLStyle function from VclStylesInno.DLL
procedure LoadVCLStyle(VClStyleFile: String); external 'LoadVCLStyleW#files:VclStylesInno.dll stdcall';
// Import the UnLoadVCLStyles function from VclStylesInno.DLL
procedure UnLoadVCLStyles; external 'UnLoadVCLStyles#files:VclStylesInno.dll stdcall';
function InitializeSetup(): Boolean;
begin
ExtractTemporaryFile('Amakrits.vsf');
LoadVCLStyle(ExpandConstant('{tmp}\Amakrits.vsf'));
Result := True;
end;
procedure DeinitializeSetup();
begin
UnLoadVCLStyles;
end;
So for the moment is not possible apply the style to that dialog. Assuming there is no way to set active language (as far as I know, If there is I will create custom Select language form) i dont see any solution. I like the ability to style my setup a lot, so now looking for any possible workaround. Is anybody have any ideas except forking issrc and rebuild it for my needs?
From the help and my setup script:
[setup] section:
; When set to auto, the dialog will only be displayed if Setup does not find a language identifier match
ShowlanguageDialog=yes
If set to No no language dialog will show

Resources