r/visualbasic • • Dec 21 '20

Detect Window version with VB

Hi everyone. I'm working on a project that needs to install different components on users' machines based on their Windows version. Currently, we need to adapt for a range from Windows 7 to 10, and instead of distributing different version of installer, I have to integrate them into only one MSI file only. My colleague had written VB code for the MSI file, and I think I should continue his work instead of making a new one since it's time consuming (I'll consider this later when I have more time, but it's urgent now).

I'm wondering that if there is any function that help the MSI to detect Windows version (from 7 to 10). Also, I need to identify different version of Windows 10 too (currently, there are Windows 10 version 16, 17, 18, 19). I'll be very appreciate if someone can provide some references or sample codes for this work.

Thank you very much

6 Upvotes

3 comments sorted by

2

u/Chriand VB.Net Intermediate Dec 21 '20

1

u/saklovesyao Dec 22 '20

Thanks a lot! With your links, I've found a pretty clear solution by checking the registry