lib/shortcut.rb in wixgem-0.58.0 vs lib/shortcut.rb in wixgem-0.59.0

- old
+ new

@@ -41,13 +41,21 @@ end end shortcut_element.attributes['Advertise']="yes" shortcut_element.attributes['Advertise'] = "no" if(@hash.has_key?(:advertise) && !@hash[:advertise]) + create_icon_element(shortcut_element) if(@hash.has_key?(:icon)) return shortcut_element end - + + def create_icon_element(shortcut_element) + icon_element = shortcut_element.add_element 'Icon' + icon_element.attributes['Id'] = File.basename(@hash[:icon]) + icon_element.attributes['SourceFile'] = ".\\#{@hash[:icon].gsub(/\//, '\\')}" + return icon_element + end + def create_directory(xml_doc, directory) raise 'Currently only supporting desktop shortcuts' unless(directory == :desktop) if(directory == :desktop) desktop_elements = REXML::XPath.match(xml_doc, "//DesktopFolder") if(desktop_elements.length == 0)