How to execute code before which Inno Select language selection dialog is displayed

I need to execute the pascal code until the "Choose installation language" dialog box appears, unfortunately, the InitializeSetup event is fired after.

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

So, is it possible to execute the script code before choosing the installation language? Is a dialog box displayed?

enter image description here

+6
source share
3 answers

I had a similar problem, and I thought of different workarounds: configure all the settings manually or do internal localization, but they all looked so cropped from the start. Select Language Installation Dialog

I have forked issrc, it was created locally and looked through the main.pas of the Setup project. I see that the idea is to do it the way it is now: people can use {Language} in the InitializeSetup , so it is called after the AskForLanguage method.

To just test the idea, I made minor changes to main.pas: call AskForLanguage after CodeRunner and InitializeSetup . I got the VCL installation language selection dialog, but not all - the NON Client Area was not VCL'ed:

enter image description here

I tried to inherit the language form not from the TForm class, but from TSetupForm or call it in the middle of the configuration or make other changes - without result. If anyone knows why this is not VCL'ed - tell me, please!

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

enter image description here

So now I'm fine. This form was not designed before many stylized pages were so ... annoying.

If we want to do it right, I think that all we need to do is move the CodeRunner init to AskForLanguage and add a custom code function like StyleInit or so on. Then everyone will be happy: {Language} will be available in InitializeSetup , and Dialog will be VCL'ed.

+2
source

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

Of course, you can modify Inno sources and add custom functions, but I think this is not your case.

Why do you need this? There may be a solution that can solve your situation, please tell us the details.

+1
source

Another possible solution is to use Inno setup Ultra, it has several enhancements, and the InitializeLanguageDialog function is one of them. just load the style into it. (You can also freely change the language of the dialogue, which is so good).

0
source

All Articles