Announcement

Collapse
No announcement yet.

Error while importing registry entries in NSIS

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Error while importing registry entries in NSIS

    I am making the wrapper for my application through NSIS setup. In the wrapper I need to do some registry entries for my application. The entries will be in the registry path “HKLM\SOFTWARE\Wow6432Node\Microsoft” and “HKLM\SOFTWARE\ Microsoft”.

    The problem is when I am importing the registry through the [ExecWait ”regedit.exe /s registry.reg”] command in the NSIS, the registry entry will not be added to the path “HKLM\SOFTWARE\ Microsoft”, only in other entry it will be added. And along with this in NSIS setup there will be a new entry in the path “HKLM\SOFTWARE\Wow6432Node\Wow6432Node \Microsoft” which is come from nowhere, because I did not include any registry entry mentioned like that in the registry file.

    I checked the registry file and there was no problem in it. I tried by directly running the registry file and also tried the same command directly in a bat file as well as CMD (regedit.exe /s registry.reg ). All are working fine. Only in NSIS it is not working. Any help would be great...

    Edit:
    Operating system: windows 7, 64 Bit
    NSIS version: 2.46
    Last edited by winman2004; 2 November 2016, 09:49. Reason: updates

  • #2
    You failed to mention that this is on a 64-bit OS! You failed to provide any version information at all in fact. Instead you wasted time by changing the font size of your post for no reason, forcing me to edit it.

    Executing Regedit.exe from a 32-bit application like NSIS will run the 32-bit version of Regedit.

    Why can't you just use WriteRegStr and SetRegView?
    IntOp $PostCount $PostCount + 1

    Comment


    • #3
      Updated the Operating system and nsis version details.

      I am trying to create an application of x86, and i am not able identify the whether installed nsis is 32 or 64 bit.

      "Why can't you just use WriteRegStr and SetRegView?" --> i already have the reg file which contains more than 500 lines. I tried converting the registry for nsis format 'WriteRegStr' with the 'Reg2Nsis' converter but this converter is not working correctly for all the reg entries, it fails when the value of the key is as follows.

      reg file:
      code:
      [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\USBSTOR\Enum]
      "Count"=dword:00000000

      [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\USBSTOR\Enum]
      "NextInstance"=dword:00000000

      Converted:
      code:
      WriteRegDWORD HKEY_LOCAL_MACHINE "SYSTEM\CurrentControlSet\services\USBSTOR\Enum" "NextInstance" 0x0
      WriteRegDWORD HKEY_LOCAL_MACHINE "SYSTEM\CurrentControlSet\services\USBSTOR\Enum" "NextInstance" 0x0

      For this error i droped the option of using WriteRegStr and SetRegView

      Comment


      • #4
        Fixing Reg2Nsis is the best solution.

        You can also do:
        !include x64.nsh
        ${DisableX64FSRedirection}
        ExecWait '"$WinDir\Regedit.exe" /whatever'
        ${EnableX64FSRedirection}
        to run the 64-bit Regedit but that is a huge hack and really should be avoided.

        Stackoverflow dupe
        IntOp $PostCount $PostCount + 1

        Comment


        • #5
          I don't know why "DisableX64FSRedirection" is not working as well as "RunningX64" also not working which is of x64.nsh.

          Now the problem solved when i manually redirecting wherever required.

          Comment

          Working...
          X
          😀
          🥰
          🤢
          😎
          😡
          👍
          👎