Old 2nd November 2016, 06:51   #1
winman2004
Member
 
Join Date: Nov 2009
Location: Mangalore-Karnataka-India
Posts: 87
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; 2nd November 2016 at 08:49. Reason: updates
winman2004 is offline   Reply With Quote
Old 2nd November 2016, 07:37   #2
Anders
Moderator
 
Anders's Avatar
 
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 4,891
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
Anders is offline   Reply With Quote
Old 2nd November 2016, 08:42   #3
winman2004
Member
 
Join Date: Nov 2009
Location: Mangalore-Karnataka-India
Posts: 87
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
winman2004 is offline   Reply With Quote
Old 2nd November 2016, 12:06   #4
Anders
Moderator
 
Anders's Avatar
 
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 4,891
Fixing Reg2Nsis is the best solution.

You can also do:
Quote:
!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
Anders is offline   Reply With Quote
Old 2nd November 2016, 13:20   #5
winman2004
Member
 
Join Date: Nov 2009
Location: Mangalore-Karnataka-India
Posts: 87
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.
winman2004 is offline   Reply With Quote
Reply
Go Back   Winamp & SHOUTcast Forums > Developer Center > NSIS Discussion

Tags
regedit, registry, wow64

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump