I just copied from the example in the manual. I made a few changes after looking through some other examples. Here is what I have now.
ExtractFile,"%ScriptFile%","Folder","test.reg","%BaseDir%\Temp\Test"
RegHiveLoad,"WB-Software","%target_sys%\config\software"
RegWrite,"HKLM","0x1","WB-Software\Test","scripted value","test data"
RegWrite,"HKLM","0x1","WB-Software\Test\Test 2","scripted value 2","test data 2"
RegImport,"%BaseDir%\Temp\Test\test.reg"
RegImport,"C:\test.reg"
RegHiveUnload,"WB-Software"
and in my reg file:
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\WB-SOFTWARE\Test]
"imported value"="test data"
[HKEY_LOCAL_MACHINE\WB-SOFTWARE\Test\Test 2]
"imported value 2"="test data 2"
As you can see I tried a couple of RegWrites which work fine. Then I tried a couple of RegImports, both of which give me an error. The first one gives me "failed to import registry file". the second import actually gives me a syntax error for some reason.
Now, if I leave off the RegHiveUnload and then manually import the test.reg file, it is successfully entered in the right location in the registry. I don't understand why I am getting the error. It appears that the ImportReg function is not working.