Exemplo n.º 1
0
        private void Init(string name)
        {
            WiXElement.AppendAttribute(
                thisElement,
                "Name",
                Path.GetFileName(name));

            WiXElement.AppendAttribute(
                thisElement,
                "Id",
                "Remove" + Guid.NewGuid().ToString("b").Trim('{', '}').Replace("-", ""));

            WiXElement.AppendAttribute(
                thisElement,
                "On",
                "uninstall");
        }
Exemplo n.º 2
0
        public File(Component parent, string name, string source, bool numberedID)
            : base(parent.Element, "File", "REPLACE_ID")
        {
            if (string.IsNullOrEmpty(name))
            {
                name = source;
            }

            string filePart = Path.GetFileNameWithoutExtension(name);

            string ext = Path.GetExtension(name);

            if (ext.Length > 0)
            {
                ext = ext.Substring(1);
            }

            thisElement.Attributes["Id"].Value =
                numberedID
                    ? "file" + fileCount++
                    : IdFromNameAndComponent(source, parent);

            WiXElement.AppendAttribute(
                thisElement,
                "Name",
                Path.GetFileName(name));

            WiXElement.AppendAttribute(
                thisElement, "Source", source);

            WiXElement.AppendAttribute(
                thisElement, "DiskId", "1");


            /* FIX THIS TO ADD REMOVEFILE FOR EACH FILE */
            if (parent.Element.OwnerDocument != null)
            {
                new RemoveFile(parent.Element, name);
            }
        }
Exemplo n.º 3
0
 private Shortcut(WiXElement parent, string name, DirectoryRef directory)
     : base(parent.Element, "Shortcut", "shortcut" + shortcutCount++)
 {
     Directory = directory.Id;
     Name = name;
 }
Exemplo n.º 4
0
 private Shortcut(Component component, WiXElement target, string name, DirectoryRef directory)
     : this(component, name, directory)
 {
     Target = string.Format("[{0}]", target.Id);
 }
Exemplo n.º 5
0
 private Shortcut(WiXElement parent, string name, DirectoryRef directory)
     : base(parent.Element, "Shortcut", "shortcut" + shortcutCount++)
 {
     Directory = directory.Id;
     Name      = name;
 }
Exemplo n.º 6
0
 private Shortcut(Component component, WiXElement target, string name, DirectoryRef directory)
     : this(component, name, directory)
 {
     Target = string.Format("[{0}]", target.Id);
 }