InnoSetup: Getting AppName in [Code] section

前端 未结 2 1975
我在风中等你
我在风中等你 2020-12-24 13:30

I\'m creating an installer using InnoSetup, and writing some custom handlers in a [Code] section. In one of the handlers, I would like to be able to retrieve th

2条回答
  •  难免孤独
    2020-12-24 14:14

    Inspired by Craig's answer, I was looking at the Inno Setup Preprocessor documentation (in ISTool, not available online as far as I've found), and came across the SetupSetting function in the preprocessor.

    It can be used as so:

    MyString := '{#SetupSetting("AppName")}';
    

    And as long as the [Setup] section appears before the place where this is used (ISPP seems to be only one pass), and includes a definition for AppName, this will give the results I want, without having to define an extra macro for each setting we want to extract.

提交回复
热议问题