Skip to content

Commit 1300f00

Browse files
committed
Remove support for <remove> and <compatFile> with removeTargets enabled
1 parent c9316f4 commit 1300f00

2 files changed

Lines changed: 7 additions & 35 deletions

File tree

‎Spore ModAPI Easy Installer/XmlInstallerWindow.xaml.cs‎

Lines changed: 7 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -484,27 +484,15 @@ private void GetComponents()
484484
else if (node.Name.ToLower() == "compatfile")
485485
{
486486
Debug.WriteLine("compatFile");
487-
CompatFiles.Add(GetComponentFromXmlNode(node, true));
488-
}
489-
else if (node.Name.ToLower() == "remove")
490-
{
491-
List<string> inner = node.InnerText.Split('?').ToList();
492-
493-
List<string> game = new List<string>();
494-
if (node.Attributes["game"] != null)
495-
game = node.Attributes["game"].Value.Split('?').ToList();
496-
else
497-
foreach (string s in inner)
498-
game.Add(string.Empty);
487+
var component = GetComponentFromXmlNode(node, true);
499488

500-
501-
502-
Debug.WriteLine("remove");
503-
Removals.Add(new RemovalInfo()
489+
// we don't support compatFile with removeTargets set
490+
// anymore due to the fact it's dangerous for mods
491+
// to be able to remove files that aren't theirs
492+
if (!component.removeTargets)
504493
{
505-
RemovalFileNames = inner,
506-
RemovalGames = game
507-
});
494+
CompatFiles.Add(component);
495+
}
508496
}
509497
}
510498

‎docs/_developers/modinfo.md‎

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,6 @@ This page contains documentation regarding creating an XML Mod Identity for your
4343
game="GalacticAdventures" defaultChecked="true">ToggleComponent.package</component>
4444
<prerequisite game="GalacticAdventures">Component.package</prerequisite>
4545
<prerequisite game="GalacticAdventures">PrerequisiteFile.package</prerequisite>
46-
<remove game="GalacticAdventures">NothingActuallyStartsWithThis*</remove>
47-
<remove game="Spore">*NothingActuallyEndsWithThis.package</remove>
4846
</mod>
4947
```
5048

@@ -120,17 +118,6 @@ The prerequisite tag identifies a mandatory part of your mod. Content specifies
120118

121119
---
122120

123-
## \<remove\> tag
124-
125-
The remove tag seeks and removes existing files. Content specifies the names of the files which are to be removed if they exist (separated by question marks).
126-
127-
* **game**
128-
* Controls where the remove's file(s) are expected to be. Unspecified or invalid values are treated as referring to the ModAPI Launcher Kit folder,
129-
e.g. for ModAPI DLLs. Alternative values are "GalacticAdventures" for Spore Galactic Adventures Data folder,
130-
"Spore" for Core Spore Data folder. Value should have the same number of entries as the filenames, again separated by question marks.
131-
132-
---
133-
134121
## \<compatFile\> tag
135122

136123
The compatFile tag adds files only if certain other files are already installed. Content specifies the names of the files in your mod which are to be installed if the target files are found (separated by question marks).
@@ -148,9 +135,6 @@ The compatFile tag adds files only if certain other files are already installed.
148135
e.g. for ModAPI DLLs. Alternative values are "GalacticAdventures" for Spore Galactic Adventures Data folder,
149136
"Spore" for Core Spore Data folder. Value should have the same number of entries as the filenames, again separated by question marks.
150137

151-
* **removeTargets**
152-
* Boolean value, controls whether or not the compatFile's source file(s) are removed if the target file is installed. Unspecified or invalid values are treated as false.
153-
154138
---
155139

156140
## \<component\> tag

0 commit comments

Comments
 (0)