Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Visual Basic
  4. setup wizard and registry handling

setup wizard and registry handling

Scheduled Pinned Locked Moved Visual Basic
visual-studiocsharpwindows-adminquestionworkspace
5 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    Asim N
    wrote on last edited by
    #1

    I want to know how can i check whether certain key value exist in registry while using Visual Studio 2003 IDE for a Setup Wizard. I want to do this programmatically. Regards, Asim

    L C 2 Replies Last reply
    0
    • A Asim N

      I want to know how can i check whether certain key value exist in registry while using Visual Studio 2003 IDE for a Setup Wizard. I want to do this programmatically. Regards, Asim

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #2

      Imports Microsoft.Win32 Public Function ReadRegKeyValue(ByVal KeyName As String, _ ByVal ValueName As String) As String ' Read the value of an existing registry key ' Pass: KeyName Name or path of the registry key for which the ' value is being read ' Return: String The sub key value (zero length string if the ' sub key does not exist) ' Create an instance of the RegistryKey class from the Microsoft.Win32 namespace Dim RegObject As RegistryKey Dim RegKeyValue As String ' Retrieve the sub key value Try RegObject = Registry.LocalMachine.OpenSubKey(KeyName, False) RegKeyValue = CType(RegObject.GetValue(ValueName, ""), String) RegObject.Close() Catch RegKeyValue = "" End Try Return RegKeyValue End Function Do or not do. There is no try.

      1 Reply Last reply
      0
      • A Asim N

        I want to know how can i check whether certain key value exist in registry while using Visual Studio 2003 IDE for a Setup Wizard. I want to do this programmatically. Regards, Asim

        C Offline
        C Offline
        Curtis Schlak
        wrote on last edited by
        #3

        If you are doing this in a custom action, then I recommend the previous poster's answer. If you are doing this to check for the existence of a key and want to know its value, then perform the following steps:

        1. Right click on your setup project in the Solution Explorer
        2. Choose View > Launch Conditions from the context menu
        3. Right click on "Search Target Machine" in the Launch Conditions window
        4. Choose "Add Registry Search"
        5. Name the new item and fill out its properties in the Properties viewer

        Now that property that you've created for the value of the registry key will hold the value that you sought. "we must lose precision to make significant statements about complex systems." -deKorvin on uncertainty

        A 1 Reply Last reply
        0
        • C Curtis Schlak

          If you are doing this in a custom action, then I recommend the previous poster's answer. If you are doing this to check for the existence of a key and want to know its value, then perform the following steps:

          1. Right click on your setup project in the Solution Explorer
          2. Choose View > Launch Conditions from the context menu
          3. Right click on "Search Target Machine" in the Launch Conditions window
          4. Choose "Add Registry Search"
          5. Name the new item and fill out its properties in the Properties viewer

          Now that property that you've created for the value of the registry key will hold the value that you sought. "we must lose precision to make significant statements about complex systems." -deKorvin on uncertainty

          A Offline
          A Offline
          Asim N
          wrote on last edited by
          #4

          Thank you Curtis. Yes, this is what i was interested in. The other post was just about registry action using vb.net and not about what i asked! Regards, Asim

          C 1 Reply Last reply
          0
          • A Asim N

            Thank you Curtis. Yes, this is what i was interested in. The other post was just about registry action using vb.net and not about what i asked! Regards, Asim

            C Offline
            C Offline
            Curtis Schlak
            wrote on last edited by
            #5

            Asim, Glad to help. Happy coding! "we must lose precision to make significant statements about complex systems." -deKorvin on uncertainty

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups