mirror of
https://github.com/JustArchiNET/ArchiSteamFarm.git
synced 2025-12-19 15:58:39 +00:00
Use SharedInfo + Add ConfigGenerator version check
This commit is contained in:
@@ -114,6 +114,7 @@
|
|||||||
<Compile Include="ObsoleteSteamGuardAccount.cs" />
|
<Compile Include="ObsoleteSteamGuardAccount.cs" />
|
||||||
<Compile Include="Program.cs" />
|
<Compile Include="Program.cs" />
|
||||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||||
|
<Compile Include="SharedInfo.cs" />
|
||||||
<Compile Include="Trading.cs" />
|
<Compile Include="Trading.cs" />
|
||||||
<Compile Include="Utilities.cs" />
|
<Compile Include="Utilities.cs" />
|
||||||
<Compile Include="WCF.cs" />
|
<Compile Include="WCF.cs" />
|
||||||
|
|||||||
@@ -881,7 +881,7 @@ namespace ArchiSteamFarm {
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
return "https://github.com/" + Program.GithubRepo + "/wiki/Commands";
|
return "https://github.com/" + SharedInfo.GithubRepo + "/wiki/Commands";
|
||||||
}
|
}
|
||||||
|
|
||||||
private async Task<string> ResponseRedeem(ulong steamID, string message, bool validate) {
|
private async Task<string> ResponseRedeem(ulong steamID, string message, bool validate) {
|
||||||
|
|||||||
@@ -61,10 +61,9 @@ namespace ArchiSteamFarm {
|
|||||||
internal const string ConfigDirectory = "config";
|
internal const string ConfigDirectory = "config";
|
||||||
internal const string DebugDirectory = "debug";
|
internal const string DebugDirectory = "debug";
|
||||||
internal const string LogFile = "log.txt";
|
internal const string LogFile = "log.txt";
|
||||||
internal const string GithubRepo = "JustArchi/ArchiSteamFarm";
|
|
||||||
|
|
||||||
private const string ASF = "ASF";
|
private const string ASF = "ASF";
|
||||||
private const string GithubReleaseURL = "https://api.github.com/repos/" + GithubRepo + "/releases"; // GitHub API is HTTPS only
|
private const string GithubReleaseURL = "https://api.github.com/repos/" + SharedInfo.GithubRepo + "/releases"; // GitHub API is HTTPS only
|
||||||
private const string GlobalConfigFile = ASF + ".json";
|
private const string GlobalConfigFile = ASF + ".json";
|
||||||
private const string GlobalDatabaseFile = ASF + ".db";
|
private const string GlobalDatabaseFile = ASF + ".db";
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
using System.Reflection;
|
using System.Reflection;
|
||||||
using System.Runtime.InteropServices;
|
using System.Runtime.InteropServices;
|
||||||
|
using ArchiSteamFarm;
|
||||||
|
|
||||||
// General Information about an assembly is controlled through the following
|
// General Information about an assembly is controlled through the following
|
||||||
// set of attributes. Change these attribute values to modify the information
|
// set of attributes. Change these attribute values to modify the information
|
||||||
@@ -9,7 +10,7 @@ using System.Runtime.InteropServices;
|
|||||||
[assembly: AssemblyConfiguration("")]
|
[assembly: AssemblyConfiguration("")]
|
||||||
[assembly: AssemblyCompany("")]
|
[assembly: AssemblyCompany("")]
|
||||||
[assembly: AssemblyProduct("ArchiSteamFarm")]
|
[assembly: AssemblyProduct("ArchiSteamFarm")]
|
||||||
[assembly: AssemblyCopyright("Copyright © ArchiSteamFarm 2015-2016")]
|
[assembly: AssemblyCopyright(SharedInfo.Copyright)]
|
||||||
[assembly: AssemblyTrademark("")]
|
[assembly: AssemblyTrademark("")]
|
||||||
[assembly: AssemblyCulture("")]
|
[assembly: AssemblyCulture("")]
|
||||||
|
|
||||||
@@ -31,5 +32,5 @@ using System.Runtime.InteropServices;
|
|||||||
// You can specify all the values or you can default the Build and Revision Numbers
|
// You can specify all the values or you can default the Build and Revision Numbers
|
||||||
// by using the '*' as shown below:
|
// by using the '*' as shown below:
|
||||||
// [assembly: AssemblyVersion("1.0.*")]
|
// [assembly: AssemblyVersion("1.0.*")]
|
||||||
[assembly: AssemblyVersion("2.1.1.2")]
|
[assembly: AssemblyVersion(SharedInfo.Version)]
|
||||||
[assembly: AssemblyFileVersion("2.1.1.2")]
|
[assembly: AssemblyFileVersion(SharedInfo.Version)]
|
||||||
|
|||||||
32
ArchiSteamFarm/SharedInfo.cs
Normal file
32
ArchiSteamFarm/SharedInfo.cs
Normal file
@@ -0,0 +1,32 @@
|
|||||||
|
/*
|
||||||
|
_ _ _ ____ _ _____
|
||||||
|
/ \ _ __ ___ | |__ (_)/ ___| | |_ ___ __ _ _ __ ___ | ___|__ _ _ __ _ __ ___
|
||||||
|
/ _ \ | '__|/ __|| '_ \ | |\___ \ | __|/ _ \ / _` || '_ ` _ \ | |_ / _` || '__|| '_ ` _ \
|
||||||
|
/ ___ \ | | | (__ | | | || | ___) || |_| __/| (_| || | | | | || _|| (_| || | | | | | | |
|
||||||
|
/_/ \_\|_| \___||_| |_||_||____/ \__|\___| \__,_||_| |_| |_||_| \__,_||_| |_| |_| |_|
|
||||||
|
|
||||||
|
Copyright 2015-2016 Łukasz "JustArchi" Domeradzki
|
||||||
|
Contact: JustArchi@JustArchi.net
|
||||||
|
|
||||||
|
Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
you may not use this file except in compliance with the License.
|
||||||
|
You may obtain a copy of the License at
|
||||||
|
|
||||||
|
http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
|
||||||
|
Unless required by applicable law or agreed to in writing, software
|
||||||
|
distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
See the License for the specific language governing permissions and
|
||||||
|
limitations under the License.
|
||||||
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
namespace ArchiSteamFarm {
|
||||||
|
internal static class SharedInfo {
|
||||||
|
internal const string Copyright = "Copyright © ArchiSteamFarm 2015-2016";
|
||||||
|
internal const string Version = "2.1.1.2";
|
||||||
|
|
||||||
|
internal const string GithubRepo = "JustArchi/ArchiSteamFarm";
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -49,6 +49,9 @@
|
|||||||
<Reference Include="System.Windows.Forms" />
|
<Reference Include="System.Windows.Forms" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
<Compile Include="..\ArchiSteamFarm\SharedInfo.cs">
|
||||||
|
<Link>SharedInfo.cs</Link>
|
||||||
|
</Compile>
|
||||||
<Compile Include="ASFConfig.cs" />
|
<Compile Include="ASFConfig.cs" />
|
||||||
<Compile Include="BotConfig.cs" />
|
<Compile Include="BotConfig.cs" />
|
||||||
<Compile Include="DialogBox.cs" />
|
<Compile Include="DialogBox.cs" />
|
||||||
|
|||||||
@@ -29,6 +29,7 @@ using System.IO;
|
|||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Text.RegularExpressions;
|
using System.Text.RegularExpressions;
|
||||||
using System.Windows.Forms;
|
using System.Windows.Forms;
|
||||||
|
using ArchiSteamFarm;
|
||||||
|
|
||||||
namespace ConfigGenerator {
|
namespace ConfigGenerator {
|
||||||
internal sealed partial class MainForm : Form {
|
internal sealed partial class MainForm : Form {
|
||||||
@@ -196,7 +197,7 @@ namespace ConfigGenerator {
|
|||||||
|
|
||||||
args.Cancel = true;
|
args.Cancel = true;
|
||||||
Tutorial.OnAction(Tutorial.EPhase.Help);
|
Tutorial.OnAction(Tutorial.EPhase.Help);
|
||||||
Process.Start("https://github.com/JustArchi/ArchiSteamFarm/wiki/Configuration");
|
Process.Start("https://github.com/" + SharedInfo.GithubRepo + "/wiki/Configuration");
|
||||||
Tutorial.OnAction(Tutorial.EPhase.HelpFinished);
|
Tutorial.OnAction(Tutorial.EPhase.HelpFinished);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -23,10 +23,12 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
|
using System.Diagnostics;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Reflection;
|
using System.Reflection;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using System.Windows.Forms;
|
using System.Windows.Forms;
|
||||||
|
using ArchiSteamFarm;
|
||||||
|
|
||||||
namespace ConfigGenerator {
|
namespace ConfigGenerator {
|
||||||
internal static class Program {
|
internal static class Program {
|
||||||
@@ -35,8 +37,10 @@ namespace ConfigGenerator {
|
|||||||
internal const string GlobalConfigFile = ASF + ".json";
|
internal const string GlobalConfigFile = ASF + ".json";
|
||||||
|
|
||||||
private const string ASFDirectory = "ArchiSteamFarm";
|
private const string ASFDirectory = "ArchiSteamFarm";
|
||||||
|
private const string ASFExecutableFile = ASF + ".exe";
|
||||||
|
|
||||||
private static readonly string ExecutableDirectory = Path.GetDirectoryName(Assembly.GetEntryAssembly().Location);
|
private static readonly string ExecutableDirectory = Path.GetDirectoryName(Assembly.GetEntryAssembly().Location);
|
||||||
|
private static readonly Version Version = Assembly.GetEntryAssembly().GetName().Version;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The main entry point for the application.
|
/// The main entry point for the application.
|
||||||
@@ -75,11 +79,30 @@ namespace ConfigGenerator {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Directory.Exists(ConfigDirectory)) {
|
if (!Directory.Exists(ConfigDirectory)) {
|
||||||
|
Logging.LogGenericErrorWithoutStacktrace("Config directory could not be found!");
|
||||||
|
Environment.Exit(1);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!File.Exists(ASFExecutableFile)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
Logging.LogGenericErrorWithoutStacktrace("Config directory could not be found!");
|
FileVersionInfo asfVersionInfo = FileVersionInfo.GetVersionInfo(ASFExecutableFile);
|
||||||
|
|
||||||
|
Version asfVersion = new Version(asfVersionInfo.ProductVersion);
|
||||||
|
if (Version == asfVersion) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
Logging.LogGenericErrorWithoutStacktrace(
|
||||||
|
"Version of ASF and ConfigGenerator doesn't match!" + Environment.NewLine +
|
||||||
|
"ASF version: " + asfVersion + " | ConfigGenerator version: " + Version + Environment.NewLine +
|
||||||
|
Environment.NewLine +
|
||||||
|
"Please use ConfigGenerator from the same ASF release, I'll redirect you to appropriate ASF release..."
|
||||||
|
);
|
||||||
|
|
||||||
|
Process.Start("https://github.com/" + SharedInfo.GithubRepo + "/releases/tag/" + asfVersion);
|
||||||
Environment.Exit(1);
|
Environment.Exit(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
using System.Reflection;
|
using System.Reflection;
|
||||||
using System.Runtime.InteropServices;
|
using System.Runtime.InteropServices;
|
||||||
|
using ArchiSteamFarm;
|
||||||
|
|
||||||
// General Information about an assembly is controlled through the following
|
// General Information about an assembly is controlled through the following
|
||||||
// set of attributes. Change these attribute values to modify the information
|
// set of attributes. Change these attribute values to modify the information
|
||||||
@@ -9,7 +10,7 @@ using System.Runtime.InteropServices;
|
|||||||
[assembly: AssemblyConfiguration("")]
|
[assembly: AssemblyConfiguration("")]
|
||||||
[assembly: AssemblyCompany("")]
|
[assembly: AssemblyCompany("")]
|
||||||
[assembly: AssemblyProduct("ConfigGenerator")]
|
[assembly: AssemblyProduct("ConfigGenerator")]
|
||||||
[assembly: AssemblyCopyright("Copyright © ArchiSteamFarm 2015-2016")]
|
[assembly: AssemblyCopyright(SharedInfo.Copyright)]
|
||||||
[assembly: AssemblyTrademark("")]
|
[assembly: AssemblyTrademark("")]
|
||||||
[assembly: AssemblyCulture("")]
|
[assembly: AssemblyCulture("")]
|
||||||
|
|
||||||
@@ -31,5 +32,5 @@ using System.Runtime.InteropServices;
|
|||||||
// You can specify all the values or you can default the Build and Revision Numbers
|
// You can specify all the values or you can default the Build and Revision Numbers
|
||||||
// by using the '*' as shown below:
|
// by using the '*' as shown below:
|
||||||
// [assembly: AssemblyVersion("1.0.*")]
|
// [assembly: AssemblyVersion("1.0.*")]
|
||||||
[assembly: AssemblyVersion("1.0.0.0")]
|
[assembly: AssemblyVersion(SharedInfo.Version)]
|
||||||
[assembly: AssemblyFileVersion("1.0.0.0")]
|
[assembly: AssemblyFileVersion(SharedInfo.Version)]
|
||||||
|
|||||||
Reference in New Issue
Block a user