Re: Best Way to Implement Registry?

From: Rob Kennedy (me3_at_privacy.net)
Date: 05/30/04

  • Next message: Nicholas Sherlock: "Re: jpg & avi"
    Date: Sun, 30 May 2004 00:37:16 -0500
    
    

    Winston Tuck wrote:
    > What is the best way to use the registry so that the applicaiton will work
    > on all version of Windows. I used the HKEY_LOCAL_MACHINE before but had
    > problems with Server 2000. I then started using txt files instead but still
    > prefer the registry and want to apply it again.

    Put user-specific data in HKey_Current_User. Put computer-specific data
    in HKey_Local_Machine. All 32-bit versions of Windows have both those keys.

    When opening a registry key, ask for only the minimum permissions
    required to perform your task. If all you need to do is read a setting,
    then don't request write access or delete access. (See the help on the
    TRegistry.Access property and OpenKeyReadOnly method.)

    If you want to use files, then store user-specific data somewhere in the
    user's profile directory (such as My Documents), and store
    computer-specific data in the "all users" profile directory. Do not
    count on being able to write to your program's installation directory.
    Microsoft's logo-specification document (link below) outlines where you
    should store different kinds of data and provides some examples (in C)
    for how you can do that. The advice applies to all versions of Windows,
    although the earliest versions of Windows 95 require you to include a
    separate DLL with your program.

    http://www.microsoft.com/winlogo/software/downloads.mspx

    -- 
    Rob
    

  • Next message: Nicholas Sherlock: "Re: jpg & avi"

    Relevant Pages

    • Re: Making Trial Version of my Software
      ... I have created a simple audio compositional environment which I hope ... I hide from the user were I store their installation date. ... On Windows I use the registry to hide this information. ...
      (comp.sys.mac.programmer.misc)
    • Re: Software activation codes and storage, your thoughts please
      ... This is the only thing that one could guarantee would work on windows 98. ... > I have an app that I want to have activation codes for, it has plugin dll> files each of which have an activation code as well. ... > I could create a GUID the first time I start the app, this would be stored> in the registry, when validating codes I would read this value from the> registry, check it and activate the software if all is OK. ... > BUT, I hear that the use of the registry is not a great idea any more,> Microsoft recommends XML files, I must store this value outside of the> apps directory in case the user simply copies the entire directory to a> new PC and all would work, maybe I could store it in Windows directory in> a .cfg file or something. ...
      (microsoft.public.dotnet.languages.csharp)
    • How Do You Stop An Application Creating A Folder On Startup......??
      ... I have an application loaded on my windows XP machine that does ... something that frustrates me. ... that the application will store all files that I create. ... I can see in the registry the new path I created from within ...
      (microsoft.public.windowsxp.general)
    • Re: Automating sending e-mail
      ... I understand then that the only reliable way is to ask the user and store it somewhere with the option to change. ... I thought I could use this to automate sending error data ... There are several places in the Registry where you can look for it, but no guarantees it'll be there. ... Under Win9x and WinNT and I think Win2000, you might find it in either of these 2 locations (if the user provided it during registration of Windows) ...
      (microsoft.public.vb.general.discussion)
    • NewestShareware.com Issue #89
      ... FileBoss for Windows ... Program Homepage/Download url ... In general users make a program execute at window startup by ... Adding programs to the Registry and WIN.INI file protects the program. ...
      (comp.software.shareware.announce)