diff --git a/CSharp/Plugins/UniversalEditor.Essential/DataFormats/PropertyList/ExtensibleConfiguration/ExtensibleConfigurationDataFormat.cs b/CSharp/Plugins/UniversalEditor.Essential/DataFormats/PropertyList/ExtensibleConfiguration/ExtensibleConfigurationDataFormat.cs
index 34ce5aa5..78a525c8 100644
--- a/CSharp/Plugins/UniversalEditor.Essential/DataFormats/PropertyList/ExtensibleConfiguration/ExtensibleConfigurationDataFormat.cs
+++ b/CSharp/Plugins/UniversalEditor.Essential/DataFormats/PropertyList/ExtensibleConfiguration/ExtensibleConfigurationDataFormat.cs
@@ -157,25 +157,37 @@ namespace UniversalEditor.DataFormats.PropertyList.ExtensibleConfiguration
private void WriteGroup(Writer tw, Group group, int indent)
{
string indents = new string(' ', indent * this.mvarIndentLength);
- tw.WriteLine(indents + group.Name);
- tw.WriteLine(indents + "{");
+ tw.Write(indents + group.Name);
+ if (mvarSettings.InlineGroupStart)
+ {
+ tw.Write(' ');
+ tw.Write(mvarSettings.GroupStart);
+ tw.WriteLine();
+ }
+ else
+ {
+ tw.WriteLine();
+ tw.WriteLine(indents + mvarSettings.GroupStart);
+ }
foreach (Property p in group.Properties)
{
tw.WriteLine(string.Concat(new object[]
{
indents,
new string(' ', this.mvarIndentLength),
- p.Name,
- "=\"",
+ p.Name,
+ mvarSettings.PropertyNameValueSeparator,
+ mvarSettings.PropertyValuePrefix,
p.Value,
- "\";"
+ mvarSettings.PropertyValueSuffix,
+ mvarSettings.PropertySeparator
}));
}
foreach (Group g in group.Groups)
{
this.WriteGroup(tw, g, indent + 1);
}
- tw.WriteLine(indents + "}");
+ tw.WriteLine(indents + mvarSettings.GroupEnd);
}
}
}
diff --git a/CSharp/Plugins/UniversalEditor.Essential/DataFormats/PropertyList/ExtensibleConfiguration/ExtensibleConfigurationSettings.cs b/CSharp/Plugins/UniversalEditor.Essential/DataFormats/PropertyList/ExtensibleConfiguration/ExtensibleConfigurationSettings.cs
index 9a031c9b..5a9b4116 100644
--- a/CSharp/Plugins/UniversalEditor.Essential/DataFormats/PropertyList/ExtensibleConfiguration/ExtensibleConfigurationSettings.cs
+++ b/CSharp/Plugins/UniversalEditor.Essential/DataFormats/PropertyList/ExtensibleConfiguration/ExtensibleConfigurationSettings.cs
@@ -39,5 +39,12 @@ namespace UniversalEditor.DataFormats.PropertyList.ExtensibleConfiguration
private string mvarGroupEnd = "}";
public string GroupEnd { get { return mvarGroupEnd; } set { mvarGroupEnd = value; } }
+
+ private bool mvarInlineGroupStart = true;
+ ///
+ /// Determines whether the group start character (default '{') should be placed on the same line as the group name.
+ ///
+ public bool InlineGroupStart { get { return mvarInlineGroupStart; } set { mvarInlineGroupStart = value; } }
+
}
}
diff --git a/CSharp/Plugins/UniversalEditor.Plugins.RebelSoftware/DataFormats/RebelSoftware/InstallationScript/IAPDataFormat.cs b/CSharp/Plugins/UniversalEditor.Plugins.RebelSoftware/DataFormats/RebelSoftware/InstallationScript/IAPDataFormat.cs
new file mode 100644
index 00000000..8a558817
--- /dev/null
+++ b/CSharp/Plugins/UniversalEditor.Plugins.RebelSoftware/DataFormats/RebelSoftware/InstallationScript/IAPDataFormat.cs
@@ -0,0 +1,125 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+using UniversalEditor.ObjectModels.PropertyList;
+using UniversalEditor.DataFormats.PropertyList.ExtensibleConfiguration;
+
+using UniversalEditor.ObjectModels.RebelSoftware.InstallationScript;
+using UniversalEditor.ObjectModels.RebelSoftware.InstallationScript.Dialogs;
+using UniversalEditor.ObjectModels.RebelSoftware.InstallationScript.Actions;
+
+namespace UniversalEditor.DataFormats.RebelSoftware.InstallationScript
+{
+ public class IAPDataFormat : ExtensibleConfigurationDataFormat
+ {
+ public IAPDataFormat()
+ {
+ // quote characters are literally part of the property value
+ this.Settings.PropertyValuePrefix = String.Empty;
+ this.Settings.PropertyValueSuffix = String.Empty;
+
+ // IAP setup PUKES if the open brace is on the next line :(
+ this.Settings.InlineGroupStart = true;
+
+ // No separator except space between name and value
+ this.Settings.PropertyNameValueSeparator = " ";
+ }
+
+ protected override void BeforeLoadInternal(Stack objectModels)
+ {
+ base.BeforeLoadInternal(objectModels);
+ }
+ protected override void AfterLoadInternal(Stack objectModels)
+ {
+ base.AfterLoadInternal(objectModels);
+ }
+ protected override void BeforeSaveInternal(Stack objectModels)
+ {
+ InstallationScriptObjectModel script = (objectModels.Pop() as InstallationScriptObjectModel);
+
+ PropertyListObjectModel plom = new PropertyListObjectModel();
+
+ Group IA_Globals = new Group("IA_Globals");
+ IA_Globals.Properties.Add("name", script.ProductName);
+ IA_Globals.Properties.Add("version", script.ProductVersion.ToString());
+ IA_Globals.Properties.Add("diskspace", "60"); // not sure what this is
+ if (!String.IsNullOrEmpty(script.BackgroundImageFileName))
+ {
+ IA_Globals.Properties.Add("bgbitmap", script.BackgroundImageFileName);
+ }
+ plom.Groups.Add(IA_Globals);
+
+ foreach (Dialog dialog in script.Dialogs)
+ {
+ // TODO: you can actually specify multiple IA_*Dialog definitions for the same dialog, but
+ // the program will only use the properties of the last-defined one
+
+ Group IA_Dialog = new Group();
+
+ if (dialog is WelcomeDialog)
+ {
+ IA_Dialog.Name = "IA_WelcomeDialog";
+ }
+ else if (dialog is LicenseDialog)
+ {
+ LicenseDialog dlg = (dialog as LicenseDialog);
+ IA_Dialog.Name = "IA_LicenseDialog";
+ IA_Dialog.Properties.Add("file", dlg.LicenseFileName);
+ }
+ else if (dialog is DestinationDialog)
+ {
+ DestinationDialog dlg = (dialog as DestinationDialog);
+ IA_Dialog.Name = "IA_DestinationDialog";
+ IA_Dialog.Properties.Add("defaultdir", dlg.DefaultDirectory);
+ }
+ else if (dialog is StartCopyingDialog)
+ {
+ IA_Dialog.Name = "IA_StartCopyingDialog";
+ }
+ else if (dialog is CopyFilesDialog)
+ {
+ CopyFilesDialog dlg = (dialog as CopyFilesDialog);
+ IA_Dialog.Name = "IA_CopyFilesDialog";
+ foreach (var action in dlg.Actions)
+ {
+ if (action is UnzipAction)
+ {
+ UnzipAction act = (action as UnzipAction);
+ IA_Dialog.Properties.Add("unzip", act.FileName);
+ }
+ }
+ }
+ else if (dialog is FinishDialog)
+ {
+ FinishDialog dlg = (dialog as FinishDialog);
+ IA_Dialog.Name = "IA_FinishDialog";
+ if (!String.IsNullOrEmpty(dlg.ReadmeFileName))
+ {
+ IA_Dialog.Properties.Add("readme", dlg.ReadmeFileName);
+ }
+ if (dlg.RequireReboot)
+ {
+ IA_Dialog.Properties.Add("reboot", "yes");
+ }
+ if (!String.IsNullOrEmpty(dlg.ExecutableFileName))
+ {
+ IA_Dialog.Properties.Add("exe", dlg.ExecutableFileName);
+ }
+ if (!String.IsNullOrEmpty(dlg.ExecutableWorkingDirectory))
+ {
+ IA_Dialog.Properties.Add("exeworkdir", dlg.ExecutableWorkingDirectory);
+ }
+ }
+
+ plom.Groups.Add(IA_Dialog);
+ }
+
+ Group IA_StartMenu = new Group("IA_StartMenu");
+ IA_StartMenu.Properties.Add("name", script.StartMenuDirectoryName);
+ plom.Groups.Add(IA_StartMenu);
+
+ objectModels.Push(plom);
+ }
+ }
+}
diff --git a/CSharp/Plugins/UniversalEditor.Plugins.RebelSoftware/ObjectModels/RebelSoftware/InstallationScript/Action.cs b/CSharp/Plugins/UniversalEditor.Plugins.RebelSoftware/ObjectModels/RebelSoftware/InstallationScript/Action.cs
new file mode 100644
index 00000000..ba14a4e2
--- /dev/null
+++ b/CSharp/Plugins/UniversalEditor.Plugins.RebelSoftware/ObjectModels/RebelSoftware/InstallationScript/Action.cs
@@ -0,0 +1,18 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+
+namespace UniversalEditor.Plugins.RebelSoftware.ObjectModels.InstallationScript
+{
+ public abstract class Action : ICloneable
+ {
+ public class ActionCollection
+ : System.Collections.ObjectModel.Collection
+ {
+
+ }
+
+ public abstract object Clone();
+ }
+}
diff --git a/CSharp/Plugins/UniversalEditor.Plugins.RebelSoftware/ObjectModels/RebelSoftware/InstallationScript/Actions/UnzipAction.cs b/CSharp/Plugins/UniversalEditor.Plugins.RebelSoftware/ObjectModels/RebelSoftware/InstallationScript/Actions/UnzipAction.cs
new file mode 100644
index 00000000..58f6004a
--- /dev/null
+++ b/CSharp/Plugins/UniversalEditor.Plugins.RebelSoftware/ObjectModels/RebelSoftware/InstallationScript/Actions/UnzipAction.cs
@@ -0,0 +1,23 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+
+namespace UniversalEditor.ObjectModels.RebelSoftware.InstallationScript.Actions
+{
+ public class UnzipAction : Action
+ {
+ private string mvarFileName = String.Empty;
+ ///
+ /// The name of the archive file to unzip using ZAP format.
+ ///
+ public string FileName { get { return mvarFileName; } set { mvarFileName = value; } }
+
+ public override object Clone()
+ {
+ UnzipAction clone = new UnzipAction();
+ clone.FileName = (mvarFileName.Clone() as string);
+ return clone;
+ }
+ }
+}
diff --git a/CSharp/Plugins/UniversalEditor.Plugins.RebelSoftware/ObjectModels/RebelSoftware/InstallationScript/Dialog.cs b/CSharp/Plugins/UniversalEditor.Plugins.RebelSoftware/ObjectModels/RebelSoftware/InstallationScript/Dialog.cs
new file mode 100644
index 00000000..1597a892
--- /dev/null
+++ b/CSharp/Plugins/UniversalEditor.Plugins.RebelSoftware/ObjectModels/RebelSoftware/InstallationScript/Dialog.cs
@@ -0,0 +1,18 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+
+namespace UniversalEditor.Plugins.RebelSoftware.ObjectModels.InstallationScript
+{
+ public abstract class Dialog : ICloneable
+ {
+ public class DialogCollection
+ : System.Collections.ObjectModel.Collection