Archive: How could I select which component to shown during installation


How could I select which component to shown during installation
Hi,
I would like to select different component to be installed in different verison of Windows.

I had a tried inserting marco inside a section, calling inserting section inside the function.onInit but I just couldn't figure out a way to customize a component page for each windows.

Therefore how can I customize the component selection page according to the information I have? Like maybe control the amount of section?


In .onInit, use the macros from Sections.nsh (SelectSection and UnselectSection) according to the detected version of Windows. Those will select and unselect the components according to your desire.


How do I detect which version of Windows?
I have a need for doing exactly the same thing as the original poster wrote. In my search for a solution, I found this thread. However, from kichik's answer, I couldn't understand how to detect the version of Windows?

Could you please show me how (or point me to some documentation that shows how)?

Thanks!


Read the manual: Appendic C - Useful Scripts, Get Windows version.

Use that function to select/unselect your components. (you can also declare different types of install and let the user choose the good one with InstType, but cannot be used for silent sections)

Gal'


Originally posted by galevsky
Read the manual: Appendic C - Useful Scripts, Get Windows version. Use that function to select/unselect your components. (you can also declare different types of install and let the user choose the good one with InstType, but cannot be used for silent sections)
Thank you. I now see that in the HTML Help file. I thought that there would be a built-in function in NSIS that would eliminate the need to copy and past that code (makes my script longer and probably harder to read), but if that's the only way to go, I will take it. Thanks! :)

You don't need to use that function.

You can do this:
!include WinVer.nsh
...
${If} ${AtleastWinXP}

See WinVer.nsh for full list. If you need more advanced information you can use the GetVersion plug-in which calls the GetVersion/GetVersionEx API's.

Stu


Originally posted by Afrow UK
You don't need to use that function.

You can do this:
!include WinVer.nsh
...
${If} ${AtleastWinXP}

See WinVer.nsh for full list. If you need more advanced information you can use the GetVersion plug-in which calls the GetVersion/GetVersionEx API's.
Stu, thank you so much!

In my script just need to know whether a system is Vista and if not, then not install something.

I see that WinVer.nsh has ${If} ${AtLeastWinVista}, so that is perfect for me.

Thank you!