Orangevolt ANT Tasks » Tasks » Win32 related tasks » win32.registry » Element import
Element importElement set

2.12.2.5.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">
          
        <!-- import using a file -->
      <win32.registry root="HKEY_LOCAL_MACHINE" key="SOFTWARE">  
        <import file="Orangevolt.xml" subKey="Orangevolt"/>
      </win32.registry>
        
        <!-- import using embedded body content -->
      <win32.registry root="HKEY_LOCAL_MACHINE" key="SOFTWARE">  
        <import subKey="Orangevolt">
          &lt;![CDATA[
          <registry key="SOFTWARE\Orangevolt" 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>
          ]]&gt;
        </import>
      </win32.registry>
    </target>
  </project>