I need to install a registry item using Nant. However, no matter what I try, Nant only seems to install a 32-bit version of the item (i.e. in the Wow6432Node registry subfolder).
Here’s my most recent attempt:
<target name="InstallMyKey">
<property name="MyKey.reg" value="${BuildPath}\some\folder\MyKey.reg" />
<exec program="regedit">
<arg value="/s" />
<arg value="${MyKey.reg}" />
</exec>
</target>
I’ve tried using alternative commands, such as regedt32 and reg, and have tried setting the working folder to %WINDIR%\SysWOW64 and running regedit from there. None of these worked either.
I’ve tried taking the very latest build of Nant (as of yesterday) and got the same issue.
Perhaps the problem is that Nant is a 32 bit exe and hence because of “file system redirection” launches the 32 bit version of regedit?
Anyone solved this?
Try testing it from the command prompt before testing it from NAnt, since that is what
execwill be doing. This would rule out any NAnt issues and confirm your syntax first. You are right that folder redirection may be occurring, so try the explicit path of %WINDIR%\regedit.exe (SysWOW64 contains the 32-bit versions).