def initialize_registry_doc(fs)
      regHnd = RemoteRegistry.new(fs, true)
      #     reg_doc = regHnd.loadHive("software", ["Microsoft"])
      reg_doc = regHnd.loadHive('software',
                                [{:key => 'Microsoft/Windows NT/CurrentVersion/Hotfix', :value => ['fix description', 'comments', 'installed', 'service pack', 'valid']},
                                 {:key => 'Microsoft/Windows/CurrentVersion/Installer/UserData', :value => ['DisplayName', 'Publisher', 'DisplayVersion', 'Comments', 'InstallLocation']},
                                 {:key => 'Microsoft/Windows/CurrentVersion/Uninstall', :value => ['DisplayName', 'Publisher', 'DisplayVersion', 'FileDescription', 'ReleaseType', 'InstallDate']},
                                 {:key => 'Wow6432Node/Microsoft/Windows/CurrentVersion/Uninstall', :value => ['DisplayName', 'Publisher', 'DisplayVersion', 'FileDescription', 'ReleaseType', 'InstallDate']},
                                 {:key => 'Microsoft/Windows/CurrentVersion/App Paths', :value => ['(Default)', 'FileDescription', 'CompanyName', 'ProductVersion', 'FileDescription', 'ProductName', 'lang', 'path']},
                                 {:key => 'Wow6432Node/Microsoft/Windows/CurrentVersion/App Paths', :value => ['(Default)', 'FileDescription', 'CompanyName', 'ProductVersion', 'FileDescription', 'ProductName', 'lang', 'path']},
                                 # These locations are used to check for Product keys
                                 {:key => 'Microsoft/Internet Explorer/Registration', :value => ['digitalproductid']},
                                 {:key => 'Microsoft/Windows/CurrentVersion/Component Based Servicing/Packages', :value => ['CurrentState', 'Visibility', 'InstallTimeHigh', 'InstallTimeLow']},
                                 {:key => 'Microsoft/Office', :value => ['digitalproductid']}])
      @digital_product_keys = regHnd.digitalProductKeys
      regHnd.close

      @product_keys = collectProductKeys(@digital_product_keys)
      reg_doc
    end
def initialize_registry_doc(fs)
      regHnd = RemoteRegistry.new(fs, true)
      #     reg_doc = regHnd.loadHive("software", ["Microsoft"])
      reg_doc = regHnd.loadHive('software',
                                [{:key => 'Microsoft/Windows NT/CurrentVersion/Hotfix', :value => ['fix description', 'comments', 'installed', 'service pack', 'valid']},
                                 {:key => 'Microsoft/Windows/CurrentVersion/Installer/UserData', :value => ['DisplayName', 'Publisher', 'DisplayVersion', 'Comments', 'InstallLocation']},
                                 {:key => 'Microsoft/Windows/CurrentVersion/Uninstall', :value => ['DisplayName', 'Publisher', 'DisplayVersion', 'FileDescription', 'ReleaseType', 'InstallDate']},
                                 {:key => 'Wow6432Node/Microsoft/Windows/CurrentVersion/Uninstall', :value => ['DisplayName', 'Publisher', 'DisplayVersion', 'FileDescription', 'ReleaseType', 'InstallDate']},
                                 {:key => 'Microsoft/Windows/CurrentVersion/App Paths', :value => ['(Default)', 'FileDescription', 'CompanyName', 'ProductVersion', 'FileDescription', 'ProductName', 'lang', 'path']},
                                 {:key => 'Wow6432Node/Microsoft/Windows/CurrentVersion/App Paths', :value => ['(Default)', 'FileDescription', 'CompanyName', 'ProductVersion', 'FileDescription', 'ProductName', 'lang', 'path']},
                                 # These locations are used to check for Product keys
                                 {:key => 'Microsoft/Internet Explorer/Registration', :value => ['digitalproductid']},
                                 {:key => 'Microsoft/Windows/CurrentVersion/Component Based Servicing/Packages', :value => ['CurrentState', 'Visibility', 'InstallTimeHigh', 'InstallTimeLow']},
                                 {:key => 'Microsoft/Office', :value => ['digitalproductid']}])
      @digital_product_keys = regHnd.digitalProductKeys
      regHnd.close

      @product_keys = collectProductKeys(@digital_product_keys)
      reg_doc
    end
# Process application images
     e.find_each("./descendant::image") { |i| nh[:image_md5] = i.attributes['md5']; validate_image(i, nh)}

     def self.validate_image(imageNode, nh)
       #logger.warn("MIQ(applications-add_elements): Checking application image [#{nh.inspect}] -- [#{imageNode.to_s}]")
       x = ApplicationImage.find_by_md5(imageNode.attributes['md5'])
       if x
         #logger.warn("MIQ(applications-add_elements): Application image     found [#{imageNode.attributes['md5']}]")
       else
         #logger.warn("MIQ(applications-add_elements): Application image NOT found [#{imageNode.attributes['md5']}]")
         ApplicationImage.create({:md5=>imageNode.attributes['md5'], :name=>nh['name'], :vendor=>nh['vendor'], :version=>nh['version']})
       end
     end