urgent help with Windows Registry


Hi all! Install the new version 1.13.20 English in win7 64 bits but does not work when reading the following key in windows, only returns nil, someone can help solve this problem, logically and verify that the key already exists and has permissions for read. thanks

(vl-registry-read "HKEY_LOCAL_MACHINE\\Software\\test\\test1" "test2") nil

Comments

  •  Hi Warner,

    Looks like you maybe mixing vl-registry-read, with vl-registry-write. Example below shows vl-registry-read in use to return BricsCAD version at time of install.

    [code](vl-registry-read (strcat "HKCU\\" (vlax-product-key)) "FullVersion")[/code]

    If your using vl-registry-write you are generally limited to writing to HKEY_CURRENT_USER. You cannot use vl-registry-write for HKEY_USERS or KEY_LOCAL_MACHINE.

    You should find the following will work:

    Write to a value to a key
    [code](vl-registry-write "HKCU\\Software\\test\\test1" "test2" "Test2Value")[/code]

    Read a value
    [code](vl-registry-read "HKCU\\Software\\test\\test1" "test2")[/code]

    delete a key
    [code](vl-registry-delete "HKCU\\Software\\test\\")[/code]

    Suggest you head over to http://www.afralisp.net , which has good tutorials on this sort of thing.
    regards,

    Jason Bourhill

    CAD Concepts

  • Dear Warner,

    the problem is easy to explain ...

    As BricsCAD is a 32 bit program, and as Windows 64 bit versions redirect any read/write access to HKLM to ./Wow6432Node/ subkeys,
    the call by
    (vl-registry-read "HKEY_LOCAL_MACHINE\\Software\\test\\test1" "test2")
    is effectively a call to
    (vl-registry-read "HKEY_LOCAL_MACHINE\\Software\\Wow6432Node\\test\\test1" "test2")

    For HKCU there is no redirection.
    For a 64 bit program, this redirection is also not applied by Windows (BricsCAD x64 will come).

    So if you manually create such an entry as mentioned in your post, that entry is at that place (your login-process is 64 bit, of course);
    therefore, BricsCAD can not read it, as Windows automatically redirects that access, unfortunately.

    Also, if you have a 64-bit-installer application to install i.e. a BricsCAD plugin application, then those entries are
    written without redirection, as installer application is 64 bit;
    you must then use a 32 bit installer package.

    I hope this explains the dilemma, created by Mircosoft ?

    Many greetings !

  • I thank both the solution, that's the problem, I'll see how I solve it, since I use Inno Setup Compiler for installation and creation of the keys. if you have help on how to create the keys with Inno Setup Compiler thank you.
  •  Hi Warner,

    Believe Inno allows you to suffix either 32 or 64 to root key values to force it to use one or the other e.g. HKLM64, HKLM32. If you don't declare then inno defaults to 32 (HKLM = HKLM32) unless you configure otherwise. more info here, which maybe of help.

    regards,

    Jason Bourhill

    CAD Concepts

  • Thanks, I will try to understand the help of Inno Setup
  • ok, is this the correct way to Inno Setup???
    Root: HKLM64; Subkey: Software \ Wow6432Node \ TopoWAR \
    I appreciate your help
  • As far as I understood the help (as linked by Jason), and Jason's comments, using "HKLM" and defining your project as 32 bit will always create the entries under HKLM \ Software \ Wow6432Node \ TopoWAR \ automatically ...
    run your installer, and have a look at it with regedit.exe :-)

    Many greetings !
This discussion has been closed.