Semi-Transparent Wizard Form - inno-setup

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.

Related

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)

Full screen background image in 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;

Inno Setup uninstall progress bar change event

Is there any event/function like CurInstallProgressChanged for progressbar with CurProgress and MaxProgress values in Uninstall form in Inno Setup?
There's no native support for this.
What you can do is to setup a timer and watch for changes in the UninstallProgressForm.ProgressBar.Position.
The code may be like:
[Code]
procedure TimerProc(
h: LongWord; AMsg: LongWord; IdEvent: LongWord; dwTime: LongWord);
begin
Log(Format(
'Uninstall progress: %d/%d', [
UninstallProgressForm.ProgressBar.Position,
UninstallProgressForm.ProgressBar.Max]));
end;
function SetTimer(hWnd: LongWord; nIDEvent, uElapse: LongWord;
lpTimerFunc: LongWord): LongWord;
external 'SetTimer#user32.dll stdcall';
procedure InitializeUninstallProgressForm();
begin
SetTimer(0, 0, 100, CreateCallback(#TimerProc)); // every 100 ms
end;
For CreateCallback function, you need Inno Setup 6.
If you are stuck with Inno Setup 5, you can use WrapCallback function from InnoTools InnoCallback library (the code needs Unicode version of Inno Setup 5). But using an external DLL library from an uninstaller is tricky and has its drawbacks. See (yours) Load external DLL for uninstall process in Inno Setup. For another solution (better but more complicate to implement), see How keep uninstall files inside uninstaller?

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