Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Visual Studio.NET / General / October 2004

Tip: Looking for answers? Try searching our database.

Using variables for Registry Values in a Setup Project

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
BLH - 07 Oct 2004 14:19 GMT
Hi,

I have a VS.NET Setup Project.  Using the Registry Editor I have added a
Registry Entry named "Installation Path".

Of course I do NOT want to hard code a value to this registry entry, because
a user could install my app into any folder they wish.

I want to use a variable for the Value Property of this registry entry so
that the value written to the registry during setup is the Application Path
that they chose.

How can I do this?  

Ex:  My registry entry will be:
HKLM\Software\CompanyABC\ProductName\Installation Path

I want to specify a variable for the value, like [Application Path]

During the installation of the app, I want the path where the user installed
it to be substituted for [Application Path] so it is written to the registry.

This should be very common and simple, but I don't find it in the docs.

Thanks,
BLH
Girish Kumar - 07 Oct 2004 15:58 GMT
hope this will help u
Dim key As RegistryKey = Registry.LocalMachine.OpenSubKey("Software", True)

'// Add one more sub key

Dim newkey As RegistryKey = key.CreateSubKey("LoginTest")

newkey.SetValue("UserId", value variable)

u can use set value for insertng values in sepcified location in registry

> Hi,
>
[quoted text clipped - 22 lines]
> Thanks,
> BLH
BLH - 07 Oct 2004 16:53 GMT
Hi Girish,

Thanks for your reply, but I don't want to know how to programmatically add
a registry key / value.

In a .NET Setup Package, I have a registry Key named "Installation Path".  I
don't want to hard code a value like:  "C:\MyApp", because the user might
install my application into any folder.

So my question is, during the installation I want the value of my
Installation Path key to be set to the directory where the user installed the
application.  How do I do that?  In my .NET Setup Package, how can I specify
a dynamic variable for a key, that gives me the application installation path
that the user has chosen?

Thanks,
BLH

> hope this will help u
> Dim key As RegistryKey = Registry.LocalMachine.OpenSubKey("Software", True)
[quoted text clipped - 37 lines]
> > Thanks,
> > BLH

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.