Skip to content

Commit

Permalink
Now SLM can auto-update itself!
Browse files Browse the repository at this point in the history
and further optimizations
  • Loading branch information
RevoLand committed Aug 3, 2015
1 parent c7fd735 commit 0dffe9c
Show file tree
Hide file tree
Showing 16 changed files with 349 additions and 101 deletions.
Binary file modified Binaries/Steam Library Manager.exe
Binary file not shown.
2 changes: 1 addition & 1 deletion Binaries/Version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.0.1|Suggested
1.0.0|Important
18 changes: 17 additions & 1 deletion Source/Steam Library Manager/Definitions/SLM.cs
Original file line number Diff line number Diff line change
@@ -1,10 +1,26 @@
namespace Steam_Library_Manager.Definitions
using System.Collections.Generic;
using System.Drawing;

namespace Steam_Library_Manager.Definitions
{
// Definitions about Steam Library Manager (SLM)
class SLM
{
// Definitions we are using to pass library and game details to MoveGame form
public static List.LibraryList LatestSelectedLibrary, LatestDropLibrary;
public static List.GamesList LatestSelectedGame;

// Update control URL
public static string UpdateLink = "https://raw.githubusercontent.com/RevoLand/Steam-Library-Manager/master/Binaries/Version.txt";

// GitHub Link
public static string LatestVersionLink = "https://raw.githubusercontent.com/RevoLand/Steam-Library-Manager/master/Binaries/Steam%20Library%20Manager.exe";

// SLM Version
public static string CurrentVersion = "1.0.0", LatestVersion = "", LatestVersionImportance = "";

// Version Importance Visual Colors
public static Dictionary<string, Color> VersionImportanceColors = new Dictionary<string, Color>();

}
}
135 changes: 122 additions & 13 deletions Source/Steam Library Manager/Forms/Main.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

42 changes: 35 additions & 7 deletions Source/Steam Library Manager/Forms/Main.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,17 +21,21 @@ public Main()
tabControl1.SelectedTab = tab_InstalledGames;

// Set form icon from resources
Icon = Steam_Library_Manager.Properties.Resources.steam_icon;
Icon = Properties.Resources.steam_icon;

// If allowed by user, check for updates
if (Properties.Settings.Default.CheckForUpdatesAtStartup)
Functions.Updater.CheckForUpdates();
}

private void linkLabel_SteamPath_LinkClicked(object sender, MouseEventArgs e)
{
try
{
// If the selected Steam installation path exists
if (Directory.Exists(Properties.Settings.Default.Steam_InstallationPath))
if (Directory.Exists(Properties.Settings.Default.SteamInstallationPath))
// Open the path in explorer as user requested
Process.Start(Properties.Settings.Default.Steam_InstallationPath);
Process.Start(Properties.Settings.Default.SteamInstallationPath);
else
// Else, do nothing
return;
Expand All @@ -55,7 +59,7 @@ private void fileDialog_SelectSteamPath_FileOk(object sender, System.ComponentMo
try
{
// Update our setting in memory
Properties.Settings.Default.Steam_InstallationPath = Path.GetDirectoryName(fileDialog_SelectSteamPath.FileName) + @"\";
Properties.Settings.Default.SteamInstallationPath = Path.GetDirectoryName(fileDialog_SelectSteamPath.FileName) + @"\";

// Update main form as visual
Functions.Settings.UpdateMainForm();
Expand Down Expand Up @@ -83,7 +87,7 @@ private void SLM_sizeCalculationMethod_SelectedIndexChanged(object sender, Event
try
{
// Update setting value
Properties.Settings.Default.SLM_GameSizeCalcMethod = (SLM_sizeCalculationMethod.SelectedIndex == 0) ? "ACF" : "Enum";
Properties.Settings.Default.GameSizeCalculationMethod = (SLM_sizeCalculationMethod.SelectedIndex == 0) ? "ACF" : "Enum";

// Save settings to file
Functions.Settings.Save();
Expand All @@ -96,7 +100,7 @@ private void SLM_archiveSizeCalcMethod_SelectedIndexChanged(object sender, Event
try
{
// Update setting value
Properties.Settings.Default.SLM_ArchiveSizeCalcMethod = (SLM_archiveSizeCalcMethod.SelectedIndex == 0) ? "Uncompressed" : "Archive";
Properties.Settings.Default.ArchiveSizeCalculationMethod = (SLM_archiveSizeCalcMethod.SelectedIndex == 0) ? "Uncompressed" : "Archive";

// Save settings to file
Functions.Settings.Save();
Expand All @@ -121,12 +125,36 @@ private void button_RefreshLibraries_Click(object sender, EventArgs e)
}


private void button_CheckForUpdates_Click(object sender, EventArgs e)
{
try
{
// Check for updates manually
Functions.Updater.CheckForUpdates();
}
catch { }
}


private void checkbox_LogErrorsToFile_CheckedChanged(object sender, EventArgs e)
{
try
{
// Update setting value
Properties.Settings.Default.SLM_LogErrorsToFile = checkbox_LogErrorsToFile.Checked;
Properties.Settings.Default.LogErrorsToFile = checkbox_LogErrorsToFile.Checked;

// Save settings to file
Functions.Settings.Save();
}
catch { }
}

private void checkbox_CheckForUpdatesAtStartup_CheckedChanged(object sender, EventArgs e)
{
try
{
// Update setting value
Properties.Settings.Default.CheckForUpdatesAtStartup = checkbox_CheckForUpdatesAtStartup.Checked;

// Save settings to file
Functions.Settings.Save();
Expand Down
4 changes: 2 additions & 2 deletions Source/Steam Library Manager/Forms/MoveGame.cs
Original file line number Diff line number Diff line change
Expand Up @@ -440,7 +440,7 @@ async void CopyGame(bool Validate, bool RemoveOld, bool Compress, bool deCompres
Log("There was an error happened while moving game.");

// If we are asked to log errors to file
if (Properties.Settings.Default.SLM_LogErrorsToFile)
if (Properties.Settings.Default.LogErrorsToFile)
// Then log errors to file
Functions.Log.ErrorsToFile("CopyGame", ex.ToString());

Expand Down Expand Up @@ -516,7 +516,7 @@ async void CopyGame(bool Validate, bool RemoveOld, bool Compress, bool deCompres
catch (Exception ex)
{
// If user want us to log errors to file
if (Properties.Settings.Default.SLM_LogErrorsToFile)
if (Properties.Settings.Default.LogErrorsToFile)
// Log errors to DirectoryRemoval.txt
Functions.Log.ErrorsToFile("DirectoryRemoval", ex.ToString());
}
Expand Down

0 comments on commit 0dffe9c

Please sign in to comment.