Skip to content

Commit

Permalink
- Fixing behaviour of RenewalDelay and HTTPPort options
Browse files Browse the repository at this point in the history
- Changing the Evertrust logo
- Updating version number
  • Loading branch information
aloopkin committed Dec 28, 2019
1 parent 12e8826 commit 9be5cda
Show file tree
Hide file tree
Showing 7 changed files with 31 additions and 8 deletions.
4 changes: 2 additions & 2 deletions MSIPackaging/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,5 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.1.6.0")]
[assembly: AssemblyFileVersion("1.1.6.0")]
[assembly: AssemblyVersion("1.1.7.0")]
[assembly: AssemblyFileVersion("1.1.7.0")]
Binary file modified MSIPackaging/Resources/background.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion MSIPackaging/Script.cs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ static public void Main(string[] args)
}
);
project.GUID = new Guid("bb0a8e11-24a8-4d7e-a7d6-6fc5bd8166d2");
project.Version = Version.Parse("1.1.6");
project.Version = Version.Parse("1.1.7");
project.LicenceFile = path + @"\MSIPackaging\Resources\gpl-3.0.rtf";
project.BannerImage = path + @"\MSIPackaging\Resources\banner.png";
project.BackgroundImage = path + @"\MSIPackaging\Resources\background.png";
Expand Down
9 changes: 9 additions & 0 deletions WinCertes/Config/IConfig.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,15 @@ interface IConfig
/// <returns>the value of the configuration parameter</returns>
int ReadOrWriteIntParameter(string parameter, int value);

/// <summary>
/// For the given parameter, writes its value into configuration, if value != defaultValue. In any case, reads it from configuration.
/// </summary>
/// <param name="parameter">the configuration parameter to manage</param>
/// <param name="value">the value of the configuration parameter</param>
/// <param name="defaultValue">the default value of the configuration parameter</param>
/// <returns>the value of the configuration parameter, defaultValue if none</returns>
int WriteAndReadIntParameter(string parameter, int value, int defaultValue);

/// <summary>
/// Tries to read parameter value from configuration. If it does not exist, uses provided value instead, and writes it to configuration
/// </summary>
Expand Down
14 changes: 14 additions & 0 deletions WinCertes/Config/RegistryConfig.cs
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,20 @@ public string WriteAndReadStringParameter(string parameter, string value)
return ReadStringParameter(parameter);
}

/// <summary>
/// For the given parameter, writes its value into configuration, if value != defaultValue. In any case, reads it from configuration.
/// </summary>
/// <param name="parameter">the configuration parameter to manage</param>
/// <param name="value">the value of the configuration parameter</param>
/// <param name="defaultValue">the default value of the configuration parameter</param>
/// <returns>the value of the configuration parameter, defaultValue if none</returns>
public int WriteAndReadIntParameter(string parameter, int value, int defaultValue)
{
if (value != defaultValue)
WriteIntParameter(parameter, value);
return ReadIntParameter(parameter, defaultValue);
}

/// <summary>
/// Tries to read parameter value from configuration. If it does not exist, uses provided value instead, and writes it to configuration
/// </summary>
Expand Down
6 changes: 3 additions & 3 deletions WinCertes/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,9 @@ public void WriteOptionsIntoConfiguration(IConfig config)
// Should we execute some PowerShell ? If yes, let's do some config
ScriptFile = config.WriteAndReadStringParameter("scriptFile", ScriptFile);
// Writing renewal delay to conf
config.WriteIntParameter("renewalDays", RenewalDelay);
RenewalDelay = config.WriteAndReadIntParameter("renewalDays", RenewalDelay, 30);
// Writing HTTP listening Port in conf
HttpPort = config.ReadOrWriteIntParameter("httpPort", HttpPort);
HttpPort = config.WriteAndReadIntParameter("httpPort", HttpPort, 80);
} catch (Exception e) {
_logger.Error($"Could not Read/Write command line parameters to configuration: {e.Message}");
}
Expand Down Expand Up @@ -107,7 +107,7 @@ private static bool HandleOptions(string[] args)
{ "a|standalone", "should WinCertes create its own WebServer for validation. Activates HTTP validation mode. WARNING: it will use port 80 unless -l is specified.", v => _winCertesOptions.Standalone = (v != null) },
{ "r|revoke:", "should WinCertes revoke the certificate identified by its domains (to be used only with -d). {REASON} is an optional integer between 0 and 5.", (int v) => _winCertesOptions.Revoke = v },
{ "k|csp=", "import the certificate into specified csp. By default WinCertes imports in the default CSP.", v => _winCertesOptions.Csp = v },
{ "t|renewal=", "trigger certificate renewal {N} days before expiration", (int v) => _winCertesOptions.RenewalDelay = v },
{ "t|renewal=", "trigger certificate renewal {N} days before expiration, default 30", (int v) => _winCertesOptions.RenewalDelay = v },
{ "l|listenport=", "listen on port {N} in standalone mode (for use with -a switch, default 80)", (int v) => _winCertesOptions.HttpPort = v }
};

Expand Down
4 changes: 2 additions & 2 deletions WinCertes/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,5 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.1.6.0")]
[assembly: AssemblyFileVersion("1.1.6.0")]
[assembly: AssemblyVersion("1.1.7.0")]
[assembly: AssemblyFileVersion("1.1.7.0")]

0 comments on commit 9be5cda

Please sign in to comment.