RRUZ
RRUZ

Reputation: 136441

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

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

Upvotes: 7

Views: 1270

Answers (3)

mishander
mishander

Reputation: 159

Another possible solution is using Inno setup Ultra, it has several inprovements, and InitializeLanguageDialog function is one of them. just load style in it. (Also you can freely change language dialog itself that is so nice).

Upvotes: 0

mishander
mishander

Reputation: 159

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.

Upvotes: 3

Slappy
Slappy

Reputation: 5472

No, the function InitializeSetup() is called as first. All other functions are called later.

Of course you can modify Inno's sources and add custom functions but I think it is not your case.

Why do you need this? Maybe there is solution which can solve your situation, please tell us details.

Upvotes: 1

Related Questions