Reading values from custom Inno Setup wizard pages without using global variables

后端 未结 1 1247
谎友^
谎友^ 2020-12-07 00:15

On this support page for creating a custom CreateInputOptionPage, they suggest storing the values of the page by just assigning them to a variable. It\'s not clear however W

相关标签:
1条回答
  • 2020-12-07 00:29

    Using a global variable to store the reference to the custom page is the correct and the easiest way.

    Related question: Inno Setup: Access to custom control from OnClick event of another control.

    Though it's questionable whether you really need to store the user value to another variable. Just read the value from the custom page at the moment you need it.

    Using global variables in indeed frowned upon, in general. But that's, when you are developing a standalone code. In this case, you are just implementing event hooks for an existing application, so you have no other choice.


    The only other way is to recursively lookup the custom page in child controls of the WizardForm. It's lot of code and quite inefficient.

    See my answer to Inno Setup: OnHover event for an example of recursive component iteration.

    0 讨论(0)
提交回复
热议问题