MjrStryker
Gawd
- Joined
- Dec 9, 2005
- Messages
- 981
I'm trying to find out how to use a .bat file to check the version of the dot net framework currently installed on a user's computer.
I want to be able to distribute my programs on CD without requiring that they be installed to the hard drive, however I'm using Visual Studio.NET 2005 to write my programs, so I need to check that at least version 2.0 of the dot net framework is installed when the CD is inserted. If it's not installed, I want the batch file to execute the framework redistributable to install it so that my program can run.
From my research I've found that the dot net framework adds the following registry key for version 2.0:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\.NETFramework\Policy\v2.0
However, the only value in this subkey is variable depending on the build. All I want to check for is whether that particular subkey exists or not and then run another action accordingly.
I've tried using REG QUERY but I can't seem to get the syntax right. It's my first time attempting to write a complex batch file such as this.
I want to be able to distribute my programs on CD without requiring that they be installed to the hard drive, however I'm using Visual Studio.NET 2005 to write my programs, so I need to check that at least version 2.0 of the dot net framework is installed when the CD is inserted. If it's not installed, I want the batch file to execute the framework redistributable to install it so that my program can run.
From my research I've found that the dot net framework adds the following registry key for version 2.0:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\.NETFramework\Policy\v2.0
However, the only value in this subkey is variable depending on the build. All I want to check for is whether that particular subkey exists or not and then run another action accordingly.
I've tried using REG QUERY but I can't seem to get the syntax right. It's my first time attempting to write a complex batch file such as this.