vb.net - Check if Visual C++ 2010 is installed - No Work -


for program, want check if visual c++ installed , little bit of googling, can check if installed checking registry key stated here: http://blogs.msdn.com/b/astebner/archive/2010/05/05/10008146.aspx

the thing is, when run program, nothing happens. tried running admin, nothing still happens. here code:

imports microsoft.win32  public class form1     public sub form1_load()         dim regkey registrykey         regkey = registry.currentuser.opensubkey("software\microsoft\visualstudio\10.0\vc\vcredist\x64", true)         if not regkey nothing             msgbox("found")         else             msgbox("not found")         end if     end sub end class 

im not sure if either im typing right or problem.

according msdn link should reading local machine key, not current user key:

[hkey_local_machine\software\microsoft\visualstudio\10.0\vc\vcredist\x64]  

you should try changing regkey line in code follows:

regkey = registry.localmachine.opensubkey("software... ' change --> ^^^^^^^^^^^^ 

edit - regarding form not doing anything: form1_load function never being called because doesn't have right signature. change form1_load function signature this:

protected overrides sub onload(e eventargs)     dim regkey registrykey     ... 

you might have run visual studio admin able read registry local machine key.


Comments

Popular posts from this blog

SPSS keyboard combination alters encoding -

Add new record to the table by click on the button in Microsoft Access -

CSS3 Transition to highlight new elements created in JQuery -