Skip to content
Permalink
Browse files

- simplified custom exception messages to encourage users to reads th…

…em completely

- added toolkit library validation check
  • Loading branch information
cozy1 committed Oct 11, 2019
1 parent 1926e1b commit 8f37570a0c139e8ef65e280ed15d80c96a352a79
@@ -1777,7 +1777,7 @@ public DLCPackageData PackageGenerate()
}

// showlights cause in game hanging for some RS1-RS2 conversions
// and/or can be defaulted to a minimum set by devs if required
// can be defaulted to a minimum working set by user/dev
packageData.DefaultShowlights = chkShowlights.Checked;

//Generate metronome arrangements
@@ -262,13 +262,17 @@ private void MainForm_Shown(object sender, EventArgs e)
if (Convert.ToBoolean(ConfigurationSettings.AppSettings["key"]))
appConfigStatus = "Load Successful";

ConfigGlobals.Log.Info(" - App.config Status (" + appConfigStatus + ")");

// validate and log runtime display setting
ConfigGlobals.Log.Info(" - System Display DPI Setting (" + GeneralExtension.GetDisplayDpi(this) + ")");
ConfigGlobals.Log.Info(" - System Display Screen Scale Factor (" + GeneralExtension.GetDisplayScalingFactor(this) * 100 + "%)");
var displaySettings = String.Empty;
if (!GeneralExtension.ValidateDisplaySettings(this, this, false, firstRun))
ConfigGlobals.Log.Info(" - Adjusted AutoScaleDimensions, AutoScaleMode, and AutoSize ...");
displaySettings = "\r\n - Adjusted AutoScaleDimensions, AutoScaleMode, and AutoSize";

ConfigGlobals.Log.Info(
String.Format(" - App.config Status ({0})\r\n ", appConfigStatus) +
String.Format(" - System Display DPI Setting ({0})\r\n ", GeneralExtension.GetDisplayDpi(this)) + // validate and log runtime display setting
String.Format(" - System Display Screen Scale Factor ({0}%) ", GeneralExtension.GetDisplayScalingFactor(this) * 100) +
String.Format(displaySettings)
);

// don't bug the Developers when in design mode ;)
bool showRevNote = ConfigRepository.Instance().GetBoolean("general_showrevnote");
@@ -42,15 +42,15 @@ static void Main(string[] args)
}

ConfigGlobals.Log.Info(//OSVersion on unix will return it's Kernel version, urgh.
String.Format("RocksmithToolkitGUI: v{0}\r\n ", ToolkitVersion.RSTKGuiVersion) +
String.Format("RocksmithToolkitLib: v{0}\r\n ", ToolkitVersion.RSTKLibVersion()) +
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(".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()) +
String.Format("MacOSX: {0}\r\n ", Environment.OSVersion.Platform == PlatformID.MacOSX)
String.Format(" - RocksmithToolkitGUI: v{0}\r\n ", ToolkitVersion.RSTKGuiVersion) +
String.Format(" - RocksmithToolkitLib: v{0}\r\n ", ToolkitVersion.RSTKLibVersion()) +
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(" - .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()) +
String.Format(" - MacOSX: {0} ", Environment.OSVersion.Platform == PlatformID.MacOSX)
);

if (!Environment.Version.ToString().Contains("4.0.30319") &&
@@ -77,33 +77,45 @@ static void Main(string[] args)
AppDomain.CurrentDomain.UnhandledException += (s, e) =>
{
var exception = e.ExceptionObject as Exception;
ConfigGlobals.Log.Error(exception, "\n{0}\n{1}\nException cached:\n{2}\n\n", exception.Source, exception.TargetSite, exception.InnerException);
//Log.Error("Application Stdout:\n\n{0}", new StreamReader(_stdout.ToString()).ReadToEnd());
ConfigGlobals.Log.Error(" - Unhandled.Exception:\nSource: {0}\nTarget: {1}\n{2}", exception.Source, exception.TargetSite, exception.ToString());

if (MessageBox.Show(String.Format("Application.ThreadException met.\n\n\"{0}\"\n\n{1}\n\nPlease send us \"{2}\", open log file now?",
exception.ToString(), exception.Message.ToString(), Path.GetFileName(logPath)), "Unhandled Exception", MessageBoxButtons.YesNo) == DialogResult.Yes)
if (MessageBox.Show(String.Format("Unhandled.Exception:\n\n{0}\nPlease send us the {1} file if you need help. Open log file now?",
exception.Message.ToString(), Path.GetFileName(logPath)), "Please Read This Important Message Completely ...", MessageBoxButtons.YesNo, MessageBoxIcon.Warning) == DialogResult.Yes)
{
//figure out how to call it single time
//Process.Start("explorer.exe", string.Format("/select,\"{0}\"", logPath));
Process.Start(logPath);
}
//Console.SetOut(new StreamWriter(Console.OpenStandardOutput()) { AutoFlush = true }); //write back to Stdout in console could use custom streamwriter so you could write to console from there

GlobalExtension.HideProgress();
};

// UI thread exceptions handling.
Application.ThreadException += (s, e) =>
{
var exception = e.Exception;
ConfigGlobals.Log.Error(exception, "\n{0}\n{1}\nException cached:\n{2}\n\n", exception.Source, exception.TargetSite, exception.InnerException);
//Log.Error("Application Stdout:\n\n{0}", new StreamReader(_stdout.ToString()).ReadToEnd());

if (MessageBox.Show(String.Format("Application.ThreadException met.\n\n\"{0}\"\n\n{1}\n\nPlease send us \"{2}\", open log file now?",
exception.ToString(), exception.Message.ToString(), Path.GetFileName(logPath)), "Thread Exception", MessageBoxButtons.YesNo) == DialogResult.Yes)
{
//Process.Start("explorer.exe", string.Format("/select,\"{0}\"", logPath));
Process.Start(logPath);
}
};
var exception = e.Exception;
var packerErrMsg = RocksmithToolkitLib.DLCPackage.Packer.ErrMsg.ToString();

if (String.IsNullOrEmpty(packerErrMsg))
ConfigGlobals.Log.Error(" - Application.ThreadException\n\nSource: {0}\nTarget: {1}\n{2}", exception.Source, exception.TargetSite, exception.ToString());
else
ConfigGlobals.Log.Error(" - Application.ThreadException\n\nSource: {0}\nTarget: {1}\n{2}\n\nPacker.ThreadException (Corrupt CDLC): {3}", exception.Source, exception.TargetSite, exception.ToString(), packerErrMsg.Trim());

if (exception.Message != null && exception.Message.Contains("expired"))
{
MessageBox.Show(String.Format("Activation.ThreadException:\n\n{0}", exception.Message), "Please Read This Important Message Completely ...", MessageBoxButtons.OK, MessageBoxIcon.Warning);
Application.Exit();
}
else
{
var exMessage = String.IsNullOrEmpty(packerErrMsg) ? exception.Message : String.Format("{0}\nPacker.ThreadException (Corrupt CDLC):\n{1}\n", exception.Message, packerErrMsg.Trim());
if (MessageBox.Show(String.Format("Application.ThreadException:\n{0}\nPlease send us the {1} file if you need help. Open log file now?",
exMessage, Path.GetFileName(logPath)), "Please Read This Important Message Completely ...", MessageBoxButtons.YesNo, MessageBoxIcon.Warning) == DialogResult.Yes)
{
Process.Start(logPath);
}
}

GlobalExtension.HideProgress();
};

Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
@@ -1,5 +1,7 @@
Rocksmith Toolkit Release Notes

- simplified custom exception messages to encourage users to reads them completely
- added toolkit library validation check
- improved tone name error handling
- unpacker audio naming fixes
- restored missing toolkit CLI executables
@@ -578,11 +578,10 @@ public static DLCPackageData LoadFromFolder(string unpackedDir, Platform targetP
if (callerName.Equals("PackageImport") && ConfigRepository.Instance().GetBoolean("creator_structured"))
artifactsDir = Path.Combine(unpackedDir, "EOF");

throw new DataException(Environment.NewLine + Environment.NewLine + "*** READ ME *** READ ME *** READ ME ***" + Environment.NewLine + Environment.NewLine +
"<WARNING> CDLC artifact file naming is corrupt ..." + Environment.NewLine +
throw new DataException("Corrupt CDLC artifact file naming." + Environment.NewLine + Environment.NewLine +
"1) Open the artifacts folder: " + artifactsDir + " " + Environment.NewLine +
"2) Look for and rename any artifact file names that contain the '~' tilde character" + Environment.NewLine +
"3) (re)Author the CDLC like from an EOF project using: >CDLC Creator>Add>Edit>Generate" + Environment.NewLine + Environment.NewLine);
"2) Look for and rename any artifact file names that contain special characters, e.g. '~' tilde" + Environment.NewLine +
"3) Reauthor the CDLC using: >CDLC Creator>Add>Edit>Generate" + Environment.NewLine);

GlobalExtension.HideProgress();
}
@@ -85,6 +85,7 @@ public static class RijndaelEncryptor
};

#endregion

/// <summary>
/// Unpacks zipped data.
/// </summary>
@@ -281,8 +282,17 @@ public static void DecryptPSARC(Stream input, Stream output, long len)
}
}

private static bool activated = false;
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();
activated = true;
}

rij.Padding = PaddingMode.None;
rij.Mode = cipher;
rij.BlockSize = 128;
@@ -2,6 +2,7 @@
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Resources;

// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.

0 comments on commit 8f37570

Please sign in to comment.
You can’t perform that action at this time.