Skip to content

Commit

Permalink
V1.7.0 (#5)
Browse files Browse the repository at this point in the history
* Retarget to .NET Framework v4.5 and bump version

- Retarget on .NET Framework v4.5
- Update copyright notices
- Update obsolete references to CodePlex
- Minor updates to docs
- Upgrade 7-Zip exe
- Bump version to 1.7.0

* Add support for 2nd input file

Add support for 2nd input file (thanks @twinpiloot!)
  • Loading branch information
tfabraham authored Jul 9, 2020
1 parent 3d5759d commit 441bf27
Show file tree
Hide file tree
Showing 17 changed files with 82 additions and 75 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
## Version 1.7 (7/8/2020)

Changes in this release:

* CHANGE: Require .NET Framework 4.5 or newer
* CHANGE: Add support for optional 2nd input file (thanks @twinpiloot!)
* CHANGE: Minor doc updates

## Version 1.6.1 (7/5/2011)

Changes in this release:
Expand Down
2 changes: 1 addition & 1 deletion EnvironmentSettingsManager.targets
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8" ?>
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003" DefaultTargets="BuildExporter;PackageMain">
<PropertyGroup>
<Version>1_6_1</Version>
<Version>1_7_0</Version>
</PropertyGroup>

<ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion LICENSE.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2008-Present Thomas F. Abraham. All Rights Reserved.
Copyright (c) 2007-Present Thomas F. Abraham. All Rights Reserved.

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
Binary file modified docs/EnvironmentSettingsManagerGuide.docx
Binary file not shown.
Binary file modified docs/EnvironmentSettingsManagerGuide.pdf
Binary file not shown.
6 changes: 2 additions & 4 deletions src/Exporter/DataTableToAppSettingsXmlExporter.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
// (c) Copyright 2007-10 Thomas F. Abraham.
// This source is subject to the Microsoft Public License (Ms-PL).
// See http://www.opensource.org/licenses/ms-pl.html
// All other rights reserved.
// Copyright 2007 Thomas F. Abraham. All Rights Reserved.
// See LICENSE.txt for licensing information.

using System.Xml;

Expand Down
6 changes: 2 additions & 4 deletions src/Exporter/DataTableToWixCustomTableXmlExporter.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
// (c) Copyright 2007-10 Thomas F. Abraham.
// This source is subject to the Microsoft Public License (Ms-PL).
// See http://www.opensource.org/licenses/ms-pl.html
// All other rights reserved.
// Copyright 2007 Thomas F. Abraham. All Rights Reserved.
// See LICENSE.txt for licensing information.

using System.Xml;

Expand Down
8 changes: 3 additions & 5 deletions src/Exporter/DataTableToXmlExporter.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
// (c) Copyright 2007-10 Thomas F. Abraham.
// This source is subject to the Microsoft Public License (Ms-PL).
// See http://www.opensource.org/licenses/ms-pl.html
// All other rights reserved.
// Copyright 2007 Thomas F. Abraham. All Rights Reserved.
// See LICENSE.txt for licensing information.

using System;
using System.Data;
Expand Down Expand Up @@ -120,7 +118,7 @@ private static void WriteHeaderComment(string inputFilename, XmlWriter xmlw)
{
xmlw.WriteComment(
Environment.NewLine +
" This file was auto-generated by the Environment Settings Spreadsheet to XML Exporter (http://envsettingsmanager.codeplex.com)."
" This file was generated by the Environment Settings Spreadsheet to XML Exporter (https://github.com/tfabraham/EnvironmentSettingsManager)."
+ Environment.NewLine
+ Environment.NewLine
+ " Input File: " + inputFilename
Expand Down
6 changes: 2 additions & 4 deletions src/Exporter/DataTableToXmlPreprocessXmlExporter.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
// (c) Copyright 2007-10 Thomas F. Abraham.
// This source is subject to the Microsoft Public License (Ms-PL).
// See http://www.opensource.org/licenses/ms-pl.html
// All other rights reserved.
// Copyright 2007 Thomas F. Abraham. All Rights Reserved.
// See LICENSE.txt for licensing information.

using System.Xml;

Expand Down
20 changes: 6 additions & 14 deletions src/Exporter/EnvironmentSettingsExporter.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -10,20 +10,7 @@
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>EnvironmentSettingsExporter</RootNamespace>
<AssemblyName>EnvironmentSettingsExporter</AssemblyName>
<SccProjectName>
</SccProjectName>
<SccLocalPath>
</SccLocalPath>
<SccAuxPath>
</SccAuxPath>
<SccProvider>
</SccProvider>
<FileUpgradeFlags>
</FileUpgradeFlags>
<OldToolsVersion>3.5</OldToolsVersion>
<UpgradeBackupLocation>
</UpgradeBackupLocation>
<TargetFrameworkVersion>v2.0</TargetFrameworkVersion>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
Expand All @@ -36,6 +23,7 @@
<UseVSHostingProcess>false</UseVSHostingProcess>
<PlatformTarget>x86</PlatformTarget>
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
Expand All @@ -46,6 +34,7 @@
<WarningLevel>4</WarningLevel>
<UseVSHostingProcess>false</UseVSHostingProcess>
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
Expand All @@ -64,6 +53,9 @@
<Compile Include="SettingsFileReader.cs" />
<Compile Include="SpreadsheetMlSettingsFileReader.cs" />
</ItemGroup>
<ItemGroup>
<None Include="app.config" />
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
Expand Down
6 changes: 2 additions & 4 deletions src/Exporter/ExcelBinarySettingsFileReader.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
// (c) Copyright 2007-10 Thomas F. Abraham.
// This source is subject to the Microsoft Public License (Ms-PL).
// See http://www.opensource.org/licenses/ms-pl.html
// All other rights reserved.
// Copyright 2007 Thomas F. Abraham. All Rights Reserved.
// See LICENSE.txt for licensing information.

using System;
using System.Collections.Generic;
Expand Down
38 changes: 25 additions & 13 deletions src/Exporter/Program.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
// (c) Copyright 2007-10 Thomas F. Abraham.
// This source is subject to the Microsoft Public License (Ms-PL).
// See http://www.opensource.org/licenses/ms-pl.html
// All other rights reserved.
// Copyright 2007 Thomas F. Abraham. All Rights Reserved.
// See LICENSE.txt for licensing information.

using System;
using System.Data;
Expand Down Expand Up @@ -45,31 +43,37 @@ static int Main(string[] args)
Console.WriteLine(
"Environment Settings Spreadsheet to XML Exporter "
+ assemblyVersion.Major + "." + assemblyVersion.Minor + "." + assemblyVersion.Build);
Console.WriteLine("[http://EnvSettingsManager.codeplex.com]");
Console.WriteLine("Copyright (C) 2007-11 Thomas F. Abraham. All Rights Reserved.");
Console.WriteLine("[https://github.com/tfabraham/EnvironmentSettingsManager]");
Console.WriteLine("Copyright (C) 2007 Thomas F. Abraham. All Rights Reserved.");
Console.WriteLine();
Console.ForegroundColor = defaultConsoleColor;

if (args.Length < 2 || args.Length > 3)
if (args.Length < 2 || args.Length > 4)
{
PrintCommandLineHelp();
return -1;
}

string inputFile = args[0];
string inputFile2 = null;
string outputPath = args[1];

FormatType activeFormat = FormatType.XmlPreprocess;

// Handle any additional command-line parameters
if (args.Length > 2)
{
// Still assuming a fixed location for the Format parameter
string formatParam = args[2]; // Any more and we'll need a command line parser
if (args.Length == 4 || (args.Length == 3 && !args[2].StartsWith("/F", StringComparison.InvariantCultureIgnoreCase)))
{
inputFile2 = args[2];
}

// Still assuming the Format parameter is last
string formatParam = args[args.Length - 1]; // Any more and we'll need a command line parser

string[] formatParamSplit = formatParam.Split(':');
if (string.Compare(formatParamSplit[0], "/F", StringComparison.InvariantCultureIgnoreCase) == 0)
if (formatParam.StartsWith("/F:", StringComparison.InvariantCultureIgnoreCase))
{
string[] formatParamSplit = formatParam.Split(':');
try
{
activeFormat = (FormatType)Enum.Parse(typeof(FormatType), formatParamSplit[1], true);
Expand All @@ -90,6 +94,14 @@ static int Main(string[] args)
// Open the source file and read the settings into a DataTable.
DataTable settingsTable = SettingsFileReader.ReadSettingsFromExcelFile(inputFile);

if (inputFile2 != null)
{
Console.WriteLine("Importing from " + Path.GetFileName(inputFile2) + "...");
Console.WriteLine();

settingsTable.Merge(SettingsFileReader.ReadSettingsFromExcelFile(inputFile2));
}

if (!Directory.Exists(outputPath))
{
Directory.CreateDirectory(outputPath);
Expand Down Expand Up @@ -144,13 +156,13 @@ static int Main(string[] args)

Console.WriteLine();
Console.WriteLine("Finished.");

return 0;
}

private static void PrintCommandLineHelp()
{
Console.WriteLine("Usage: EnvironmentSettingsExporter.exe <ExcelFile.xls/x or ExcelFile.xml> <OutputPath> [/F:<XmlPreprocess/AppSettings/WixCustomTable>]");
Console.WriteLine("Usage: EnvironmentSettingsExporter.exe <ExcelFile.xls/x or ExcelFile.xml> <OutputPath> [ExcelFile2.xls/x or ExcelFile2.xml] [/F:<XmlPreprocess/AppSettings/WixCustomTable>]");
}
}
}
11 changes: 7 additions & 4 deletions src/Exporter/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
using System.Reflection;
// Copyright 2007 Thomas F. Abraham. All Rights Reserved.
// See LICENSE.txt for licensing information.

using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;

Expand All @@ -10,7 +13,7 @@
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("EnvironmentSettingsExporter")]
[assembly: AssemblyCopyright("Copyright © 2007-11 Thomas F. Abraham")]
[assembly: AssemblyCopyright("Copyright © 2007 Thomas F. Abraham")]
[assembly: AssemblyTrademark("All Rights Reserved")]
[assembly: AssemblyCulture("")]

Expand All @@ -26,5 +29,5 @@
// Build Number
// Revision
//
[assembly: AssemblyVersion("1.6.1.0")]
[assembly: AssemblyFileVersion("1.6.1.0")]
[assembly: AssemblyVersion("1.7.0.0")]
[assembly: AssemblyFileVersion("1.7.0.0")]
6 changes: 2 additions & 4 deletions src/Exporter/SettingsFileReader.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
// (c) Copyright 2007-10 Thomas F. Abraham.
// This source is subject to the Microsoft Public License (Ms-PL).
// See http://www.opensource.org/licenses/ms-pl.html
// All other rights reserved.
// Copyright 2007 Thomas F. Abraham. All Rights Reserved.
// See LICENSE.txt for licensing information.

using System;
using System.Collections.Generic;
Expand Down
32 changes: 15 additions & 17 deletions src/Exporter/SpreadsheetMlSettingsFileReader.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
// (c) Copyright 2007-10 Thomas F. Abraham.
// This source is subject to the Microsoft Public License (Ms-PL).
// See http://www.opensource.org/licenses/ms-pl.html
// All other rights reserved.
// Copyright 2007 Thomas F. Abraham. All Rights Reserved.
// See LICENSE.txt for licensing information.

using System;
using System.Collections.Generic;
Expand Down Expand Up @@ -82,18 +80,18 @@ internal static DataTable ReadSettingsFromSpreadsheetMl(string inputFile)
newRow["Comment"] = commentNav.Value.Replace("\n", string.Empty);
}
}
// Check for Index attribute on Cell
if (cellsIterator.Current.HasAttributes)
{
XPathNavigator indexAttribute = cellsIterator.Current.SelectSingleNode("@ss:Index", nm);

if (indexAttribute != null)
{
// SpreadsheetML stores Index as 1 based, not zero based.
columnIndex = int.Parse(indexAttribute.Value) - 1;
}
}

// Check for Index attribute on Cell
if (cellsIterator.Current.HasAttributes)
{
XPathNavigator indexAttribute = cellsIterator.Current.SelectSingleNode("@ss:Index", nm);

if (indexAttribute != null)
{
// SpreadsheetML stores Index as 1 based, not zero based.
columnIndex = int.Parse(indexAttribute.Value) - 1;
}
}

// Select the data value in the cell, if present
XPathNavigator dataNav = cellsIterator.Current.SelectSingleNode("ss:Data", nm);
Expand Down Expand Up @@ -144,7 +142,7 @@ private static DataTable InitializeDataTable(XPathNavigator worksheetNav, XmlNam
}

dt.Columns.Add("Comment", typeof(string));

return dt;
}

Expand Down
6 changes: 6 additions & 0 deletions src/Exporter/app.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5"/>
</startup>
</configuration>
Binary file modified tools/7za.exe
Binary file not shown.

0 comments on commit 441bf27

Please sign in to comment.