Archive: Disable Sections for some OS


Disable Sections for some OS
  I want to disable (set read-only flag) and unselect a section for some operating systems. If I do it it in .onInit it will not work. Here is the code:

Call IsWindowsAboveNT4And98FE

StrCmp$0 ${TRUE} Done
Push$0
SectionGetFlags${Sec25} $0
IntOp$0 $0 & ${SECTION_OFF}
>IntOp $0 $0 | ${SF_R0}
>SectionSetFlags ${Sec25} $0
Pop$0
Done:
The function IsWindowsAboveNT4And98FE definitely work. But even if it sets $0 not to true it doesn't work.
Can I use the variables Sec25 which are set by the Section command. What else do I have to consider?

It's O (the letter) not 0 (the number) in RO.
You have to put this code after the section is defined so the compiler will recognize ${sec25}.


Setting the read-only flag works. But I want to clear the selection, too. It seems that the InstType overrides the selection changes in .onInit. Is that right? When do I have to call SectionSetFlags?


If it's in an InstType too then get it out if it using SectionSetInstTypes.


How I can set another InstType than index 0 to be the standard. I would like to delete or hide one inst-type in the combo box, because it is not valid for some operating systems.
Is that possible?
Thanks!


No, you can't hide installation types. You can only change which sections belong to them.


Actually, I think that there should be some mayor changes to the InstType and Section part of the installer. Since that's the most important part for the end-user, I suggest that there should be more instructions available to work with them. For example: It should be possible to make (sub)sections invisible (by putting a '-' in front of it?) and to make installation types invisible.