Skip to content

Commit

Permalink
- added OS, and CultureInfo to log
Browse files Browse the repository at this point in the history
  • Loading branch information
cozy1 committed Oct 12, 2019
1 parent 8f37570 commit eb5fdf0
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 8 deletions.
2 changes: 2 additions & 0 deletions RocksmithTookitGUI/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
using System.Threading;
using RocksmithToolkitGUI.Config;
using NLog;
using System.Globalization;

namespace RocksmithToolkitGUI
{
Expand Down Expand Up @@ -47,6 +48,7 @@ static void Main(string[] args)
String.Format(" - RocksmithToolkitUpdater: v{0}\r\n ", updaterVersion) +
String.Format(" - Dynamic Difficulty Creator: v{0}\r\n ", FileVersionInfo.GetVersionInfo(Path.Combine(ExternalApps.TOOLKIT_ROOT, ExternalApps.APP_DDC)).ProductVersion) +
String.Format(" - OS: {0} ({1} bit)\r\n ", Environment.OSVersion, Environment.Is64BitOperatingSystem ? "64" : "32") +
String.Format(" - CultureInfo: {0}\r\n ", CultureInfo.CurrentCulture.ToString()) +
String.Format(" - .NET Framework Runtime: v{0}\r\n ", Environment.Version) +
String.Format(" - JIT: {0}\r\n ", JitVersionInfo.GetJitVersion()) +
String.Format(" - WINE_INSTALLED: {0}\r\n ", GeneralExtension.IsWine()) +
Expand Down
3 changes: 2 additions & 1 deletion RocksmithTookitGUI/ReleaseNotes.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
Rocksmith Toolkit Release Notes

- simplified custom exception messages to encourage users to reads them completely
- added OS, and CultureInfo to log
- simplified custom exception messages to encourage users to read them
- added toolkit library validation check
- improved tone name error handling
- unpacker audio naming fixes
Expand Down
4 changes: 1 addition & 3 deletions RocksmithToolkitLib/DLCPackage/RijndaelEncryptor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -287,9 +287,7 @@ private static void InitRijndael(Rijndael rij, byte[] key, CipherMode cipher)
{
if (!activated)
{
// invoke Start method outside of ASP.NET
// WebActivatorEx.ActivationManager.RunPreStartMethods(true);
Startup.Start();
Startup.Start(); // invoke Start method
activated = true;
}

Expand Down
12 changes: 8 additions & 4 deletions RocksmithToolkitLib/ToolkitVersion.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,9 @@
using System.Security.Authentication;
using RocksmithToolkitLib.Extensions;
using System.Diagnostics;
// using WebActivatorEx;
using System.Globalization;


// [assembly: PreApplicationStartMethod(typeof(RocksmithToolkitLib.Startup), "Start", RunInDesigner = true)]
namespace RocksmithToolkitLib
{
public static class ToolkitVersion
Expand Down Expand Up @@ -86,7 +85,12 @@ public static bool IsRSTKLibValid()
// return false;
var rstkLibPath = typeof(RocksmithToolkitLib.ToolkitVersion).Assembly.Location;
var libDate = File.GetCreationTime(rstkLibPath);
if (DateTime.Now > libDate.AddDays(30))
// account for user's DateTime regional differences
CultureInfo cultureInfo = new CultureInfo("en-US");
DateTime libDT = DateTime.Parse(libDate.ToString(), cultureInfo, DateTimeStyles.NoCurrentDateDefault);
DateTime nowDT = DateTime.Parse(DateTime.Now.ToString(), cultureInfo, DateTimeStyles.NoCurrentDateDefault);

if (nowDT > libDT.AddDays(30))
return false;

return true;
Expand All @@ -95,7 +99,7 @@ public static bool IsRSTKLibValid()

public static class Startup
{
// class library entry point hackery
// hackery used as class library entry point
public static void Start()
{
if (!ToolkitVersion.IsRSTKLibValid())
Expand Down

0 comments on commit eb5fdf0

Please sign in to comment.