Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How execute code before which the Inno Select language dialog is shown

Tags:

inno-setup

I need to execute a pascal code before that the Select Setup language Dialog is shown , unfortunately the InitializeSetup event is executed after.

function InitializeSetup(): Boolean; //This event occurs to late
begin
    DoSomething(); 
    Result := True;
end;

So it's possible execute a script code before of the Select Setup language Dialog is shown?

enter image description here

like image 384
RRUZ Avatar asked Feb 06 '14 20:02

RRUZ


1 Answers

I had similar problem, and I thought about different workarounds: style all setup manually, or make inner localization, but they all looked so doomed from the beginning. Select Setup language Dialog

I have forked issrc, built it locally, and looked at the main.pas of the Setup project. I see the idea behind doing as it is now : people may wanna use {Language} in InitializeSetup, so its called after the AskForLanguage method.

To just check the idea I made small changes to main.pas: call AskForLanguage after CodeRunner inited and InitializeSetup called. I got VCL'ed Select Setup Language dialog, but not all - NON Client Area wasnt VCL'ed:

enter image description here

I've tried to inherit the language form not from the TForm class but from the TSetupForm, or call it in the middle of setup or make other changes - with no result. If anybody know why it's not VCL'ed - tell me please!

Then I read the Custom Window Frame Using DWM article and just made the form border bsNone and got this:

enter image description here

So for now I'm fine with it. That form not styled before many pages of styled setup was so... annoying.

If we wanna do it a right way, I guess all that needs to be done - is moving CodeRunner init before AskForLanguage, and add a custom code function like StyleInit or so. Then all will be happy: {Language} will be available in InitializeSetup and Dialog will be VCL'ed.

like image 82
mishander Avatar answered Oct 15 '22 14:10

mishander