Reputation: 136441
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?
Upvotes: 7
Views: 1270
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
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:
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:
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
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