Skip to content
Permalink
Browse files

- added additional popup messages to Auto Updater to help users with …

…process
  • Loading branch information...
cozy1 committed Mar 8, 2019
1 parent 6b07b79 commit 47e75b2f2a284b76a0ce44bf89e80334fafb6f61
@@ -1,10 +1,13 @@
<?xml version="1.0" encoding="utf-8" ?>
<!-- App.config is solution to error 'caused the assembly to be sandboxed' -->
<configuration>
<!-- monitor this change -->
<!-- may cause Defender to quarantine the app -->
<startup useLegacyV2RuntimeActivationPolicy="true">
<!-- force newer version of .NET Framework to be backward compatible -->
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/>
</startup>
<runtime>
<!-- solution to MS error 'caused the assembly to be sandboxed' -->
<loadFromRemoteSources enabled="true"/>
</runtime>
</configuration>
@@ -29,5 +29,5 @@
//
// THESE VALUES ARE PROGRAMMATICALLY GENERATED - DO NOT EDIT
[assembly: AssemblyVersion("2.9.2.0")]
[assembly: AssemblyInformationalVersion("a61b2199")]
[assembly: AssemblyInformationalVersion("6b07b79c")]
[assembly: AssemblyConfiguration("")]
@@ -1,5 +1,6 @@
Rocksmith Toolkit Release Notes

- added additional popup messages to Auto Updater to help users with process
- added system display setting logging and verification
- fixed VS Sandbox error that occurs when using newer version of .NET Framework
- fixed known VS MouseUp glitch in CDLC Creator GUI
@@ -1,10 +1,13 @@
<?xml version="1.0" encoding="utf-8" ?>
<!-- App.config is solution to error 'caused the assembly to be sandboxed' -->
<configuration>
<!-- monitor this change -->
<!-- may cause Defender to quarantine the app -->
<startup useLegacyV2RuntimeActivationPolicy="true">
<!-- force newer version of .NET Framework to be backward compatible -->
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/>
</startup>
<runtime>
<!-- solution to MS error 'caused the assembly to be sandboxed' -->
<loadFromRemoteSources enabled="true"/>
</runtime>
</configuration>
@@ -27,5 +27,5 @@
//
// THESE VALUES ARE PROGRAMMATICALLY GENERATED - DO NOT EDIT
[assembly: AssemblyVersion("2.9.2.0")]
[assembly: AssemblyInformationalVersion("a61b2199")]
[assembly: AssemblyInformationalVersion("6b07b79c")]
[assembly: AssemblyConfiguration("")]
@@ -1,10 +1,13 @@
<?xml version="1.0" encoding="utf-8" ?>
<!-- App.config is solution to error 'caused the assembly to be sandboxed' -->
<configuration>
<!-- monitor this change -->
<!-- may cause Defender to quarantine the app -->
<startup useLegacyV2RuntimeActivationPolicy="true">
<!-- force newer version of .NET Framework to be backward compatible -->
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/>
</startup>
<runtime>
<!-- solution to MS error 'caused the assembly to be sandboxed' -->
<loadFromRemoteSources enabled="true"/>
</runtime>
</configuration>
@@ -270,9 +270,9 @@ public AutoUpdaterForm(string[] args)
var lockedLocalFiles = DeleteDirectory(localToolkitDir);
if (lockedLocalFiles.Any())
{
ShowCurrentOperation("<WARNING> localToolkitDir full cleanup failed ...");
ShowLockedFiles(lockedLocalFiles);
Environment.Exit(1);
ShowCurrentOperation("<WARNING> Local toolkit directory cleanup failed ...");
if (!ShowLockedFilesAndContinue(lockedLocalFiles))
Environment.Exit(1);
}
}

@@ -287,10 +287,11 @@ public AutoUpdaterForm(string[] args)
}
catch (Exception ex)
{
if (MessageBox.Show("<ERROR> Could not unzip file: " + Path.GetFileName(latestZipPath) + Environment.NewLine + "The AutoUpdater can not continue." + Environment.NewLine + "Do you want to roll back the installation process?" + Environment.NewLine + ex.Message, "RocksmithToolkit AutoUpdater", MessageBoxButtons.YesNo, MessageBoxIcon.Error) == DialogResult.No)
{
if (DialogResult.No == MessageBox.Show("<ERROR> Could not unzip file: " + Path.GetFileName(latestZipPath) + Environment.NewLine +
"The AutoUpdater can not continue." + Environment.NewLine +
"Do you want to roll back the installation process?" + Environment.NewLine +
ex.Message, "RocksmithToolkit AutoUpdater", MessageBoxButtons.YesNo, MessageBoxIcon.Error))
Environment.Exit(1);
}

// rollback the process to its original state
DeleteDirectory(newLocalToolkitDir);
@@ -319,10 +320,7 @@ public AutoUpdaterForm(string[] args)
{
File.Copy(cgmFile, cgmFile.Replace(tempToolkitDir, newLocalToolkitDir));
}
catch
{
/* Do nothing */
}
catch {/* Do nothing */}
}

// TODO: merge custom/user dds xml/cfg files
@@ -332,8 +330,8 @@ public AutoUpdaterForm(string[] args)
if (lockedTempFiles.Any())
{
ShowCurrentOperation("<WARNING> tempToolkitDir full cleanup failed ...");
if (isDebugMe)
ShowLockedFiles(lockedTempFiles);
if (!ShowLockedFilesAndContinue(lockedTempFiles))
Environment.Exit(1);
}
}

@@ -342,7 +340,7 @@ public AutoUpdaterForm(string[] args)

if (localToolkitDir != newLocalToolkitDir)
{
// find open localToolkitDir and close it so it can be deleted
// find open localToolkitDir and attempt to close it so it can be deleted
var shellWindows = new SHDocVw.ShellWindows();
foreach (SHDocVw.InternetExplorer shellWindow in shellWindows)
{
@@ -355,10 +353,11 @@ public AutoUpdaterForm(string[] args)
shellWindow.Quit();
Thread.Sleep(100);

if (isDebugMe)
MessageBox.Show("localToolkitDir: " + localToolkitDir + Environment.NewLine +
"should now be closed ...", "DPDM");

MessageBox.Show("The old local toolkit directory should now be closed: " + Environment.NewLine +
localToolkitDir + Environment.NewLine + Environment.NewLine +
"Manually close the directory if it is still open" + Environment.NewLine +
"before pressing 'OK' to continue. The old toolkit" + Environment.NewLine +
"may be deleted after the update finishes ...", "Close Toolkit Directory ...", MessageBoxButtons.OK, MessageBoxIcon.Hand);
break;
}
}
@@ -374,7 +373,7 @@ public AutoUpdaterForm(string[] args)
"Check latestZipPath deleted: " + latestZipPath, "DPDM");

ShowCurrentOperation("Please wait ... Restarting ToolkitGUI ...");
Thread.Sleep(3000); // settle down before restart
Thread.Sleep(1000); // settle down before restart
RestartToolkitGUI(newLocalToolkitDir);
}

@@ -569,9 +568,11 @@ private bool BackupProcessDir(string srcDir, string destDir)
var lockedFiles = CopyDirectory(srcDir, destDir);
if (lockedFiles.Any())
{
ShowCurrentOperation("<ERROR> Backup failed, locked destination path ...");
ShowLockedFiles(lockedFiles);
return false;
ShowCurrentOperation("<ERROR> Backup failed ...");
if (!ShowLockedFilesAndContinue(lockedFiles))
return false;

return true;
}

ShowCurrentOperation("Backup was sucessful ...");
@@ -721,26 +722,32 @@ private void RollBack(string srcDir, string destDir)
if (lockedFiles.Any())
{
ShowCurrentOperation("<ERROR> Rollback failed, locked files ...");
ShowLockedFiles(lockedFiles);
Environment.Exit(0);
if (!ShowLockedFilesAndContinue(lockedFiles))
Environment.Exit(0);
}
}

private void ShowLockedFiles(List<string> lockedFiles)
private bool ShowLockedFilesAndContinue(List<string> lockedFiles)
{
if (!lockedFiles.Any())
return;
return true;

var sb = new StringBuilder();
sb.AppendLine("<WARNING> The following file(s) are locked,");
sb.AppendLine("so they could not be processed correctly ...");
sb.AppendLine("<WARNING> Some files could not be programmatically deleted!");
sb.AppendLine("Please remember to deleted these after auto update is finished ... ");
sb.AppendLine("");

foreach (var lockedFile in lockedFiles)
sb.AppendLine(lockedFile);

MessageBox.Show(sb.ToString(), "RocksmithToolkit AutoUpdater",
MessageBoxButtons.OK, MessageBoxIcon.Error);
sb.AppendLine();
sb.AppendLine("Do you want continue?");

if (DialogResult.OK != MessageBox.Show(sb.ToString(), "RocksmithToolkit AutoUpdater",
MessageBoxButtons.OKCancel, MessageBoxIcon.Error))
return false;

return true;
}

private void AutoUpdaterForm_FormClosing(object sender, FormClosingEventArgs e)
@@ -29,5 +29,5 @@
//
// THESE VALUES ARE PROGRAMMATICALLY GENERATED - DO NOT EDIT
[assembly: AssemblyVersion("2.9.2.0")]
[assembly: AssemblyInformationalVersion("a61b2199")]
[assembly: AssemblyInformationalVersion("6b07b79c")]
[assembly: AssemblyConfiguration("")]
@@ -1,3 +1,3 @@
2.9.2.0
a61b2199
6b07b79c

0 comments on commit 47e75b2

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