more pre-release changes

This commit is contained in:
Bitl 2021-11-10 10:18:50 -07:00
parent 59c81fc9dd
commit 02d726d43f
6 changed files with 51 additions and 22 deletions

View File

@ -1,5 +1,6 @@
#region Usings
using System;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Reflection;
@ -72,7 +73,7 @@ namespace Novetus.ReleasePreparer
string infopathlite = litepath + @"\\config\\info.ini";
Console.WriteLine("Editing " + infopathlite);
SetBranch(infopathlite);
SetToLite(infopathlite);
string currbranchlite = GetBranch(infopathlite);
string pathlite = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location) + @"\\releasenomapsversion.txt";
@ -89,8 +90,8 @@ namespace Novetus.ReleasePreparer
}
else if (args.Contains("-snapshot"))
{
string infopath = novpath + @"\\changelog.txt";
string currver = File.ReadLines(infopath).First();
string infopath = novpath + @"\\config\\info.ini";
string currver = GetBranch(infopath);
string pathbeta = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location) + @"\\betaversion.txt";
Console.WriteLine("Creating " + pathbeta);
@ -146,35 +147,54 @@ namespace Novetus.ReleasePreparer
public static string GetBranch(string infopath)
{
//READ
string versionbranch;
INIFile ini = new INIFile(infopath);
string section = "ProgramInfo";
versionbranch = ini.IniReadValue(section, "Branch", "0.0");
return versionbranch;
return GetBranch(ini, infopath);
}
public static void SetBranch(string infopath)
public static string GetBranch(INIFile ini, string infopath)
{
//READ
string versionbranch;
INIFile ini = new INIFile(infopath);
string versionbranch, extendedVersionNumber, extendedVersionTemplate, extendedVersionRevision, isLite;
string section = "ProgramInfo";
versionbranch = ini.IniReadValue(section, "Branch", "0.0");
extendedVersionNumber = ini.IniReadValue(section, "ExtendedVersionNumber", "False");
extendedVersionTemplate = ini.IniReadValue(section, "ExtendedVersionTemplate", "%version%");
extendedVersionRevision = ini.IniReadValue(section, "ExtendedVersionRevision", "-1");
isLite = ini.IniReadValue(section, "IsLite", "False");
string novpath = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location) + @"\\Novetus\\bin\\Novetus.exe";
if (!extendedVersionNumber.Equals("False"))
{
var versionInfo = FileVersionInfo.GetVersionInfo(novpath);
return extendedVersionTemplate.Replace("%version%", versionbranch)
.Replace("%build%", versionInfo.ProductBuildPart.ToString())
.Replace("%revision%", versionInfo.FilePrivatePart.ToString())
.Replace("%extended-revision%", (!extendedVersionRevision.Equals("-1") ? extendedVersionRevision : ""))
.Replace("%lite%", (!isLite.Equals("False") ? " (Lite)" : ""));
}
else
{
return versionbranch;
}
}
public static void SetToLite(string infopath)
{
INIFile ini = new INIFile(infopath);
string section = "ProgramInfo";
string isLite = ini.IniReadValue(section, "IsLite", "False");
try
{
if (!versionbranch.Contains("(Lite)"))
if (!isLite.Equals("True"))
{
ini.IniWriteValue(section, "Branch", versionbranch + " (Lite)");
ini.IniWriteValue(section, "IsLite", "True");
}
}
catch (Exception)
{
SetBranch(infopath);
SetToLite(infopath);
}
}
}

View File

@ -27,7 +27,7 @@ public class GlobalFuncs
//READ
string versionbranch, defaultclient, defaultmap, regclient1,
regclient2, extendedversionnumber, extendedversiontemplate,
extendedversionrevision, extendedversioneditchangelog;
extendedversionrevision, extendedversioneditchangelog, isLite;
INIFile ini = new INIFile(infopath);
@ -43,6 +43,7 @@ public class GlobalFuncs
extendedversioneditchangelog = ini.IniReadValue(section, "ExtendedVersionEditChangelog", "False");
extendedversiontemplate = ini.IniReadValue(section, "ExtendedVersionTemplate", "%version%");
extendedversionrevision = ini.IniReadValue(section, "ExtendedVersionRevision", "-1");
isLite = ini.IniReadValue(section, "IsLite", "False");
try
{
@ -57,7 +58,8 @@ public class GlobalFuncs
GlobalVars.ProgramInformation.Version = extendedversiontemplate.Replace("%version%", versionbranch)
.Replace("%build%", versionInfo.ProductBuildPart.ToString())
.Replace("%revision%", versionInfo.FilePrivatePart.ToString())
.Replace("%extended-revision%", (!extendedversionrevision.Equals("-1") ? extendedversionrevision : ""));
.Replace("%extended-revision%", (!extendedversionrevision.Equals("-1") ? extendedversionrevision : ""))
.Replace("%lite%", (!isLite.Equals("False") ? " (Lite)" : ""));
}
else
{
@ -69,7 +71,8 @@ public class GlobalFuncs
GlobalVars.ProgramInformation.Version = extendedversiontemplate.Replace("%version%", versionbranch)
.Replace("%build%", Assembly.GetExecutingAssembly().GetName().Version.Build.ToString())
.Replace("%revision%", Assembly.GetExecutingAssembly().GetName().Version.Revision.ToString())
.Replace("%extended-revision%", (!extendedversionrevision.Equals("-1") ? extendedversionrevision : ""));
.Replace("%extended-revision%", (!extendedversionrevision.Equals("-1") ? extendedversionrevision : ""))
.Replace("%lite%", (!extendedversionrevision.Equals("False") ? " (Lite)" : ""));
}
bool changelogedit = Convert.ToBoolean(extendedversioneditchangelog);

View File

@ -1,6 +1,7 @@
@ECHO OFF
del /S Novetus\*.pdb
del /S Novetus\*.log
del /S Novetus\*.bak
del /s /q Novetus\clients\2007E\content\scripts\CSMPBoot.lua
del /s /q Novetus\clients\2007E-Shaders\content\scripts\CSMPBoot.lua

View File

@ -0,0 +1,3 @@
@ECHO OFF
call clean_junk.bat
ReleasePreparer.exe -lite

View File

@ -128,6 +128,7 @@ if not exist "%dest%\scripts\batch" mkdir "%scriptsdir%\batch"
XCOPY "%cd%\dev_menu.bat" "%scriptsdir%\batch" /y
XCOPY "%cd%\clean_junk.bat" "%scriptsdir%\batch" /y
XCOPY "%cd%\github_sync.bat" "%scriptsdir%\batch" /y
XCOPY "%cd%\create_lite.bat" "%scriptsdir%\batch" /y
XCOPY "%cd%\Novetus\Novetus_dependency_installer.bat" "%scriptsdir%\batch" /y
XCOPY "%cd%\Novetus\Novetus_launcher_legacy.bat" "%scriptsdir%\batch" /y
XCOPY "%cd%\Novetus\documentation.txt" "%dest%" /y

View File

@ -6,5 +6,6 @@ UserAgentRegisterClient1=2007M
UserAgentRegisterClient2=2010L
ExtendedVersionNumber=True
ExtendedVersionEditChangelog=False
ExtendedVersionTemplate=%version% v11.2021.%extended-revision%
ExtendedVersionRevision=1
ExtendedVersionTemplate=%version% v11.2021.%extended-revision%%lite%
ExtendedVersionRevision=1
IsLite=False