Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Setup Project in Visual Studio .NET writing to Registry

Status
Not open for further replies.

andoryuu

MIS
Feb 16, 2005
11
US
OK. Project is all done. Want to write the install location to the registry for their HKEY_LOCAL_MACHINE. How am I supposed to do this? I've looked through documentation (no help). I've tried the environmental variable types that I know, but it always enters it as a string. . . What the heck?

I can't think of any other descriptive info to put here, so if i'm being vague, sorry. Please let me know and I'll try to elaborate.

Thanks,
Andrew

-=Andrew=-
Database Support Specialist
"Shinakya ikenai koto ga takusan aru shi . . ." -Utada Hikaru
 
Hopefully this will get you started:

Dim reg As Microsoft.Win32.Registry
Dim rk As Microsoft.Win32.RegistryKey = reg.LocalMachine.CreateSubKey("MySubKey")


Aditionally there is a fully worked example in Help under RegistryKey Class


Hope this helps.

[vampire][bat]
 
Hi earthandfire,

Thanks for the quick response. The issue isn't creating the key per se, but when the user selects the install location (Like C:\Program Files\Whatever\) how do I get that string into the Registry? I want to be able to refer to this location dynamically by reading the registry (this is for linking some information between files and since users can install stuff in varying directories, I need to be able to reference this in the registry . . .)

Thanks!
Andrew

-=Andrew=-
Database Support Specialist
"Shinakya ikenai koto ga takusan aru shi . . ." -Utada Hikaru
 
Do you mean as part of the installation process or as part of your program?

[vampire][bat]
 
Well, I want to write to the registry during the installation so that my program can reference it when the users are running it. I have source files that get installed during the installation and I want to be able to read the location of the files from the registry. The only way to know what the location is is to record what the installation directory is at time of installation . . .

I appreciate your help . . . hopefully we can get this nailed down.

Andrew

-=Andrew=-
Database Support Specialist
"Shinakya ikenai koto ga takusan aru shi . . ." -Utada Hikaru
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top