Adding Alpha Skins to Inno Setup * Tutorial

InstallationWay

Новичок
This is a message from altef_4 :

Hi all, after some testing and searching and also request from Cuttlas (InstallationWay), I decide to upload a step-by-step tutorial on how to add alpha skins support into inno setup, like the title said, their present minimum of one big bug with a 5px unskinned frame on all forms used in the installer if form style, not equal bsSizeable, and I can't fix, maybe someone will do this or at least this tutorial will be useful, so let's go.

1.you must be able to compile inno setup on your PC ( inno setup source code ), follow instructions from the provided link
2.download latest alpha skins lite package from alphaskins site , and install it in your Delphi IDE, use the lite version cuz it free
3.in addition also download and install RemObjects component and install it
I don't provide step-by-step instructions for these two steps cuz all installation info is present on links I provided

3. open Setup.dpr project (. \ Issrc-the master \ the Projects \ Setup.dpr )
3.1. select build configuration to Release
3.2. optional: edit build configuration by adding postbuild event command - copy / B "$ (OutputPath)" ".. \ Files \ $ (OutputName) .e32"
this command will copy Setup.exe to FIles \ Setup.e32
The add 4. AlphaSkins_R.Pas to Setup.dpr
Open 5. AlphaSkins_R.dfm and configure sSkinManager as you wont (effects, animations etc)
5.1. in the attached archive present base AlphaSkins_R.Pas and AlphaSkins_C.Pas , use them as a start point
Open 6. ScriptClasses_R.pas and add AlphaSkins_R unit uses in section
7. search for " RegisterBidiCtrls_R (Cl); "
8. add " RegisterSkinManager_R (Cl); " after it
9. search for " ScriptClassesLibraryUpdateVars "
10.add " SetVariantToClass (ScriptInterpreter.GetVarNo (Scrip tInterpreter.GetVar ('SKINMANAGER')), DataModule1.SkinManager); " line as first call in function
11.view source of Setup.dpr and search for " Application.CreateForm (TDataModule1, DataModule1); " and remove it
12.search for " Application.HookMainWindow (TDummyClass.AntiShutdow nHook); " and add " Application.CreateForm (TDataModule1, DataModule1); " after it
13. recompile Setup.exe
The open 14. ISCmplr.dpr
14.1. select build configuration to Release
14.2. optional: edit build configuration by adding postbuild event command - copy / B "$ (OutputPath)" ".. \ Files \ $ (OUTPUTFILENAME)"
this command will copy ISCmplr.dll to FIles \ ISCmplr.dll
15.add AlphaSkins_C.pas to ISCmplr.dpr
The open 16. ScriptClasses_C.pas and the add AlphaSkins_C unit in uses clause section called
17. search for " AddImportedClassVariable (Cl, 'WizardForm', 'TWizardForm'); "
18.add " RegisterSkinManager_C (Cl); " line before " AddImportedClassVariable (Cl, 'WizardForm', 'TWizardForm'); " line
19.repile ISCmplr.dll
20.compile Compil32.dpr, ISCC, ISPP, SetupLdr projects
21.copy destination compiled project binaries into Files folder
22.create inno setup script file in FIles folder with following content:

[Setup]
AppName = My Program
AppVersion = 1.5
DefaultDirName = {pf} \ My Program
Compression = lzma2
SolidCompression = yes
DisableWelcomePage = no
OutputDir =. \
// WindowVisible = True

Code
procedure SetSkinParameters (u: Boolean);
begin
with SkinManager do begin
if not u then begin
SkinDirectory: = ExpandConstant ('{src} \ Skins_V15 \');
SkinName: = GetRandomSkin;
// SkinName: = ExpandConstant ('{src} \ Skins_V15 \ Pulsar.asz');
end;
// HUEOffset: = Random (360); // value from 0 to 360
// Saturation: = Random (200) - 100; // value from -100 to 100
// Brightness: = Random (40) - 25; // value from -25 to 15
Active: = TRUE;
end;
end;
function SetWindowLong (Wnd: HWnd; Index: Integer; NewLong: Longint): Longint; external'SetWindowLongW@user32.dll stdcall ';
function GetWindowLong (Wnd: HWnd; Index: Integer): Longint; external'GetWindowLongA@user32.dll stdcall ';
Function GetWindow (HWND: Longint; uCmd: cardinal): Longint; external'GetWindow@user32.dll stdcall ';


function InitializeSetup: Boolean;
begin
SetSkinParameters (False);
Result: = TRUE;
end;

function InitializeUninstall: Boolean;
begin
SetSkinParameters (True);
Result: = TRUE;
end;

procedure InitializeWizard;
begin
SetWindowLong (WizardForm.Handle, -8, GetWindowLong (GetWindow (WizardForm.Handle, 4), - 8));
WizardForm.BorderStyle: = BsSizeable; // work with this style, only wizardform
end;
23. NewStaticText aligment fix:
open Components / NewStaticText.pas
add FAlignment: TAlignment; into private section of TNewStaticText Class
add procedure SetAlignment (Value: TAlignment); into private section of TNewStaticText Class
add property Alignment: TAlignment read FAlignment write SetAlignment default taLeftJustify; into published section of TNewStaticText Class
press Ctrl + Shift + C and search for TNewStaticText.SetAlignment
add following code into this procedure:

if FAlignment <> Value then
begin
FAlignment: = Value;
RecreateWnd;
end;
save NewStaticText.pas and recompile Setup.dpr

the attached archive contains all these changes and inno setup 6.0.4 src version, I tried to check if it works on the latest beta source but I get some errors during the compilation of the original unchanged source and I don't have time to figure out how to fix this errors, so at least it works with this version and should work with a new one

scr1.jpg
scr2.jpg
scr4.jpg
Скачать Inno Setup with AlphaSkins v2.0 Source.7z можно по ссылке:
Main Topic
 

Вложения

Leserg

Участник
Это все очень интересно, но Alpha Skins, тем более Lite редакция, не поддерживает компоненты Inno Setup. И это видно на прилагаемых скриншотах. Смотрите у компонента TBitmapImage фон значка отличается от фона страницы:
AlphaSkins01.png
 

Leserg

Участник
maybe the Icon is not transparent
В исходном коде Inno фон значка устанавливается согласно фону страницы, на котором он находится:
IconToBitmapImage(ExtractIcon(HInstance, FileInfo.szDisplayName, FileInfo.iIcon), SelectGroupBitmapImage, SelectProgramGroupPage.Color);

После применения Alpha Skins фон страницы изменился, а фон значка нет. Это говорит о том, что Alpha Skins ничего не знает про компонент TBitmapImage, как и другие кастомные компоненты Inno Setup. :acute:
 
Сверху