Conditionally unconditional



  • From Microsoft's documentation of the .inf file format:

    Unconditional hooks are hooks that always get executed. These hooks are mentioned in the [Setup Hooks] section of the Internet Component Download INF file.....When the Code Downloader pulls down example.cab, it trust verifies the cabinet and then processes the INF. After Windows Internet Explorer finds that there is no [Add.Code] section, it processes the [Setup Hooks] section.

    So, unconditional hooks are only executed if a certain section of the .inf file is not present. Doesn't seem unconditional to me.



  • I cbf reading the whole documentation, so I could end up sounding stupid here, but I don't think that's too weird. I mean it could be worded a tad better, but it's clearly meaning it's unconditional at the current level of the hierarchy. If the parent of it is conditionally not included it makes sense for it not to be. It's like trying to say that means that such a hook should always be executed even if the inf file isn't being used at the time because they didn't explicitly say it had to be run for it to execute it just always executes.



  • @Carnildo said:

    So, unconditional hooks are only executed if a certain section of the .inf file is not present. Doesn't seem unconditional to me.

    Good thing, too, because what's described above isn't unconditional. I'd guess that it probably was unconditional for a while, until some bug was reported with the [Add.Code] section and unconditional hooks. To get around that, they made the unconditional hooks conditional - but, by that point in time, they had them documented as being called 'unconditional hooks' all over the place. Worse, they didn't have a snazzy new name to call them, so rather than doing a search and replace to change them to 'hooks which were previously unconditional', they just kept the name the same.

    It's a WTF, but I could see myself getting caught in the same trap.



  • @fyjham said:

    I cbf reading the whole documentation,
    Well, I could be f***ed reading the whole documentation.

    Executive summary:

    1. INF files, in the context of Internet Explorer "Install-from-Web" CAB files, have two mutually exclusive modes. Conditional and Unconditional.
    2. Conditional mode runs hooks if and only if keyed-on files are missing from the system. It's used to install components, as indicated by "Add.Code". Each hook can have a different condition and fire independantly of the others.
    3. Unconditional mode runs hooks regardless of the state of the system. It's used for other, unspecified kinds of setup. All hooks always fire.
    4. Conditional mode is checked before unconditional mode.

     

    Now, was that really that hard? And next time, Carnildo, cite your source.


Log in to reply
 

Looks like your connection to What the Daily WTF? was lost, please wait while we try to reconnect.