Skip to content

Commit

Permalink
Merge branch 'dev'
Browse files Browse the repository at this point in the history
  • Loading branch information
chrpai committed May 9, 2023
2 parents 152f36c + a71235e commit 7e69dc3
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 5 deletions.
31 changes: 27 additions & 4 deletions Application/Designers/CustomTablesDesigner/CustomTables.cs
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,14 @@ where myitem.Attribute("Id").Value == item.Text
foreach (var data in row.Elements(ns + "Data"))
{
string columnName = data.Attribute("Column").Value;
dr[columnName] = data.Value;
if (_documentManager.Document.GetWiXVersion() == WiXVersion.v4)
{
dr[columnName] = data.GetOptionalAttribute("Value");
}
else
{
dr[columnName] = data.Value;
}
}
_customTable.Rows.Add(dr);

Expand Down Expand Up @@ -369,7 +376,14 @@ private void SaveTable()
{
var xcolumn = new XElement(ns + "Data");
xcolumn.Add(new XAttribute("Column", column.ColumnName));
xcolumn.Value = row[column.ColumnName].ToString();
if (_documentManager.Document.GetWiXVersion() == WiXVersion.v4)
{
xcolumn.SetAttributeValue("Value", row[column.ColumnName].ToString());
}
else
{
xcolumn.Value = row[column.ColumnName].ToString();
}
xrow.Add(xcolumn);

}
Expand Down Expand Up @@ -530,12 +544,17 @@ private void toolStripMenuItemTableCreate_Click(object sender, EventArgs e)
var dialog = new FormTableName(string.Empty, tables);

if (dialog.ShowDialog() == DialogResult.OK)
{
{
string identifier = "Identifier";
if(_documentManager.Document.GetWiXVersion() == WiXVersion.v4)
{
identifier = identifier.ToLower();
}
XElement previousElement = _documentManager.Document.GetElementToAddAfterSelf("CustomTable");
XElement newElement = new XElement(ns + "CustomTable", new XAttribute("Id", dialog.TableName),
new XElement( ns + "Column",
new XAttribute( "Id", "Id" ),
new XAttribute( "Category", "Identifier" ),
new XAttribute( "Category", identifier ),
new XAttribute( "PrimaryKey", "yes" ),
new XAttribute( "Nullable", "no" ),
new XAttribute( "Type", "string" ),
Expand All @@ -549,6 +568,10 @@ private void toolStripMenuItemTableCreate_Click(object sender, EventArgs e)
{
previousElement.AddAfterSelf(newElement);
}
if (_documentManager.Document.GetWiXVersion() == WiXVersion.v4)
{
newElement.AddAfterSelf(new XElement(ns + "EnsureTable", new XAttribute("Id", dialog.TableName)));
}
LoadData();
}
}
Expand Down
2 changes: 1 addition & 1 deletion Application/IsWiX/Properties/launchSettings.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"profiles": {
"IsWiX": {
"commandName": "Project",
"commandLineArgs": "C:\\GitHub\\TestApp\\Installer\\TestAppLib\\TestAppLib.wxs"
"commandLineArgs": "\"C:\\GitHub\\TestApp\\Installer\\TestAppSetup\\TestAppFiles.wxs\""
}
}
}

0 comments on commit 7e69dc3

Please sign in to comment.