Orangevolt ANT Tasks » Tasks » Win32 related tasks » win32.registry » Element export
Element exportElement get

2.12.2.3.1.  Example

build.xml
<?xml version="1.0"?>  
      
  <project basedir="." name="myapp" default="main">
    <taskdef classpath="orangevolt-ant-tasks-1.3.2.jar" resource="com/orangevolt/tools/ant/taskdefs.properties"/>
      
    <target name="main">
          
      <win32.registry root="HKEY_LOCAL_MACHINE" key="SOFTWARE\Orangevolt\ant-test">  
        <export file="ant-test.xml"/>
      </win32.registry>
    </target>
  </project>

example output
<?xml version="1.0" encoding="UTF-8"?>
  <registry key="SOFTWARE\Orangevolt\ant-test" root="HKEY_LOCAL_MACHINE">
    <entry name="test" type="REG_SZ" value="huhu"/>
    <entry name="int" type="REG_DWORD" value="2147483647"/>
    <entry name="long" type="REG_DWORD" value="2000"/>
    <entry name="short" type="REG_DWORD" value="32767"/>
    <entry name="true" type="REG_DWORD" value="1"/>
    <entry name="false" type="REG_DWORD" value="0"/>
    <entry name="bigdecimal" type="REG_SZ" value="333"/>
    <entry name="bigint" type="REG_SZ" value="300"/>
    <entry name="byte" type="REG_DWORD" value="127"/>
    <entry name="bytearray" type="REG_BINARY" value="[B@17725c4"/>
    <entry name="test1" type="REG_SZ" value="huuhu"/>
    <entry name="test2" type="REG_SZ" value="i'm here again"/>
    <subkey name="prima">
      <entry name="dummy" type="REG_SZ" value="sadasdas"/>
      <subkey name="besser">
        <entry name="komma" type="REG_SZ" value="sadadas"/>
        <entry name="inthu" type="REG_DWORD" value="18"/>
        <entry name="" type="REG_SZ" value="sadad"/>
      </subkey>
    </subkey>
  </registry>

The exported file contains all subkeys and entries of the selected registry part including the entry data type.