Select Setup language Dialog - inno-setup

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

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;

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.

How to register a .NET DLL using Inno Setup

I have written a class library using Visual Studio 2010 C# to read hardware information of a Computer (e.g. HDD/SSD). I will use this dll to create an installer using InnoSetup to read the hardware info of the target computer. Now my problems is .NET dll cannot be used directly unless it is registered already. I am trying to find a way to register the dll during InitializeSetup in InnoSetup so I can use the functions in the dll. Here is the script I wrote for installer.
function InitializeSetup(): Boolean;
var
obj: Variant;
diskPartitions: Integer;
va: String;
ErrorCode: Integer;
b: Boolean;
begin
ExtractTemporaryFile('SSHardwareChecker.dll');
RegisterServer(False, ExpandConstant('{tmp}\SSHardwareChecker.dll'), False);
obj := CreateOleObject('SSHardwareChecker.SSClass');
va := obj.GetDiskDriveInformation;
MsgBox(va, mbInformation, mb_Ok);
b:=UnregisterServer(False, ExpandConstant('{tmp}\SSHardwareChecker.dll'), False);
end;
The function RegisterServer doesn't seem to work.It throws an error which says RegSvr32 failed with exit code 0x4. I read a lot of articles in the net that says .net dll shoud be registered using regasm. I dont really know how to do this, especially in Inno Setup.
Please help guys.
Though its more than a year, I recently had the same problem and was able to rectify using the below script.
[Run]
Filename: "{dotnet20}\RegAsm.exe"; Parameters: /codebase YourDLL.dll; WorkingDir: {app}; StatusMsg: "Registering Controls..."; Flags: runminimized
If the file has be registered at initialize step, we can use one of the Inno setup's support functions.
function Exec(const Filename, Params, WorkingDir: String; const ShowCmd: Integer; const Wait: TExecWait; var ResultCode: Integer): Boolean;
More Info can be found in:
Inno Setup Help
To do this, you MUST..
1) make sure that .net 4.0 is installed (not by default on most machines yet)
2) extract and register the DLL (you need to call regasm.exe on the extracted DLL)
This is a lot to do just to "GetDiskDriveInformation" as the very first step of the install.
It is far better to get the information natively in Inno or call a native DLL that doesn't have the prerequisites.

Resources