Answered by:
Detecting which media type was used to install Windows

Question
-
Answers
-
To best of my knowledge, this is not possible using C#.
For other tools and ways refer: How to Tell What Media Type / License Key Was Used to Install Windows. OEM, Retail, MSDN or Volume License.
Please mark as answer or vote as helpful if my reply does
- Proposed as answer by Rachit Sikroria Saturday, August 15, 2015 6:42 PM
- Marked as answer by Kristin Xie Tuesday, August 18, 2015 1:26 AM
-
No ,
I dont think its possible . Is there any business justification for this or simply you are trying to run the setup file through C# code .
If running the setup is your requirement then You want to add a Custom Action to the Setup Project that runs the executable. This WalkThrough will take you through getting that working.
- Marked as answer by Kristin Xie Tuesday, August 18, 2015 1:26 AM
All replies
-
To best of my knowledge, this is not possible using C#.
For other tools and ways refer: How to Tell What Media Type / License Key Was Used to Install Windows. OEM, Retail, MSDN or Volume License.
Please mark as answer or vote as helpful if my reply does
- Proposed as answer by Rachit Sikroria Saturday, August 15, 2015 6:42 PM
- Marked as answer by Kristin Xie Tuesday, August 18, 2015 1:26 AM
-
No ,
I dont think its possible . Is there any business justification for this or simply you are trying to run the setup file through C# code .
If running the setup is your requirement then You want to add a Custom Action to the Setup Project that runs the executable. This WalkThrough will take you through getting that working.
- Marked as answer by Kristin Xie Tuesday, August 18, 2015 1:26 AM
-
I think in XP days it used to store where it was installed from.
As the Driveletter of the Disk Drive or the Fileshare in case of a installation via PXE (you could set up Windows XP for that).It was primarily done to have a default place to look for the installation media if it was ever needed (adding features, repairing system files).
I have no idea if it is still used under modern windows. Afaik it was stored somewhere in the System part of the registry.You might find it somewhere in this old PXE install for XP guide:
https://msdn.microsoft.com/en-us/library/ms838569.aspx -
Found a guide to these values for XP:
https://support.microsoft.com/en-us/kb/833615
Checked on my Windows 8.1 (upgrade from 8.0). I found no SourcePath under either key. But that might just be the setup I have (original installation from Dell).