Computer Hope

Software => Computer programming => Topic started by: youngbucks on June 17, 2008, 04:52:42 PM

Title: Problem with app showing up in Add/Remove.
Post by: youngbucks on June 17, 2008, 04:52:42 PM
Im having a problem with my registry entries. Ok so i made a game and i made an installer in vb.net 2008 and i set it to write the game to the registry so that it shows up when you go to Add/Remove programs. The keys get created but it doesnt show up in Add/Remove, what am i missing?

I didnt create an uninstaller is that the problem?

Code: [Select]
        InstallLog("Currently installing Pointblanc, please wait.")
        '////////////////////////////////////////////////
        'WRITING APP TO THE REGISTRY
        '////////////////////////////////////////////////
        'Opens the HKEY_LOCAL_MACHINE\SOFTWARE subkey and adds 'Pointblanc' subkey
        InstallLog("Writing Game to Registry.")
        Dim regKey As RegistryKey
        regKey = Registry.LocalMachine.OpenSubKey("SOFTWARE", True)
        regKey.CreateSubKey("Pointblanc")
        regKey = Registry.LocalMachine.OpenSubKey("SOFTWARE\Pointblanc", True)
        regKey.CreateSubKey("Pointblanc")
        regKey.Close()
        Dim execToWrite As String = "c:\Pointblanc\Pointblanc.exe"
        Dim iconToWrite As String = "c:\Pointblanc\Pointblanc.exe,0"
        Dim icondestToWrite As String = "c:\ProgramData\Microsoft\Windows\Start Menu\Programs\Pointblanc.exe"
        Dim icondestpToWrite As String = "c:\users\Public\Desktop\Pointblanc"
        Dim ROOTToWrite As String = "c:\Pointblanc"
        'WRITE VALUE
        My.Computer.Registry.SetValue("HKEY_LOCAL_MACHINE\Software\Pointblanc\Pointblanc", "Icon", iconToWrite)
        My.Computer.Registry.SetValue("HKEY_LOCAL_MACHINE\Software\Pointblanc\Pointblanc", "IconDestPath0", icondestToWrite)
        My.Computer.Registry.SetValue("HKEY_LOCAL_MACHINE\Software\Pointblanc\Pointblanc", "IconDestPath1", icondestpToWrite)
        My.Computer.Registry.SetValue("HKEY_LOCAL_MACHINE\Software\Pointblanc\Pointblanc", "Executable", execToWrite)
        My.Computer.Registry.SetValue("HKEY_LOCAL_MACHINE\Software\Pointblanc\Pointblanc", "RootPath", ROOTToWrite)
        'Checks for the existence of the key before proceeding
        If My.Computer.Registry.GetValue("HKEY_LOCAL_MACHINE\Software\Pointblanc\Pointblanc", _
"Rootpath", Nothing) Is Nothing Then
            InstallLog("Error Adding Game to the Registry.")
            GoTo installfailed
        Else
            'InstallLog("Writing to registry successfull.")
            Dim myValue As String = My.Computer.Registry.GetValue("HKEY_LOCAL_MACHINE\Software\Pointblanc", "install path", String.Empty).ToString
            InstallLog("Successfully added to the registry.")
        End If
Title: Re: Problem with app showing up in Add/Remove.
Post by: Sidewinder on June 17, 2008, 06:15:47 PM
Quote
I didnt create an uninstaller is that the problem?

Probably. This link (http://support.microsoft.com/kb/314481) states "The Currently installed programs list in the Add or Remove Programs tool lists all of the Windows-compatible programs that have an uninstall program or feature"

Hope this helps. 8)