File tree Expand file tree Collapse file tree 9 files changed +53
-40
lines changed
Expand file tree Collapse file tree 9 files changed +53
-40
lines changed Original file line number Diff line number Diff line change 11using System . Diagnostics ;
22using System . IO . Compression ;
3+ using Utils ;
34
45namespace RyuUpdater ;
56
@@ -31,6 +32,8 @@ private static async Task Main(string[] args) {
3132
3233 ZipFile . ExtractToDirectory ( updateFile , targetDir , overwriteFiles : true ) ;
3334 Directory . Delete ( tempDir , recursive : true ) ;
35+
36+ Flags . CreateFlag ( Constants . UPDATE_RECENT_FLAG_FILE_NAME ) ;
3437
3538 var srmmPath = Path . Combine ( targetDir , srmmFileName ) ;
3639
Original file line number Diff line number Diff line change 1212 <ApplicationIcon >..\ShinRyuModManager-CE\UserInterface\Assets\Icons\SRMM_icon.ico</ApplicationIcon >
1313 <EnableTrimAnalyzer >true</EnableTrimAnalyzer >
1414 <TrimmerSingleWarn >false</TrimmerSingleWarn >
15- <AssemblyVersion >1.0.0 </AssemblyVersion >
15+ <AssemblyVersion >1.0.1 </AssemblyVersion >
1616 <VersionPrefix >$(AssemblyVersion)</VersionPrefix >
1717 <Version >$(AssemblyVersion)</Version >
1818 <IncludeSourceRevisionInInformationalVersion >false</IncludeSourceRevisionInInformationalVersion >
1919 </PropertyGroup >
2020
21+ <ItemGroup >
22+ <ProjectReference Include =" ..\Utils\Utils.csproj" />
23+ </ItemGroup >
24+
2125</Project >
Original file line number Diff line number Diff line change @@ -3,14 +3,6 @@ namespace ShinRyuModManager;
33public static class Settings {
44 //TEMP
55 public const string TEMP_DIRECTORY_NAME = "ShinRyuModManager" ;
6-
7- //UPDATES
8- public const string UPDATER_EXECUTABLE_NAME = "RyuUpdater.exe" ;
9- public const string UPDATE_FLAG_FILE_NAME = "update.txt" ;
10- public const string UPDATE_RECENT_FLAG_FILE_NAME = ".SRMM_RECENT_UPDATE_FLAG" ;
11- public const string UPDATE_INFO_REPO_OWNER = "SRMM-Studio" ;
12- public const string UPDATE_INFO_REPO = "srmm-version-info" ;
13- public const string UPDATE_INFO_FILE_PATH = "RyuUpdater/config.yaml" ;
146
157 //EVENTS
168 public const string EVENT_FOOLS24_FLAG_FILE_NAME = ".SRMM_FOOLS24_FLAG" ;
Original file line number Diff line number Diff line change 1414 <AvaloniaUseCompiledBindingsByDefault >true</AvaloniaUseCompiledBindingsByDefault >
1515
1616 <!-- Versioning -->
17- <AssemblyVersion >1.2.1 </AssemblyVersion >
17+ <AssemblyVersion >1.2.2 </AssemblyVersion >
1818 <VersionPrefix >$(AssemblyVersion)</VersionPrefix >
1919 <AssemblyTitle >ShinRyuModManager-CE</AssemblyTitle >
2020 <Company >SRMM Studio</Company >
Original file line number Diff line number Diff line change 1+ > ### ** %{color: orange } Version 1.2.2 %** ###
2+ * Fixed bug with the recent update flag
3+
4+ ---
5+
16> ### ** %{color: orange } Version 1.2.1 %** ###
27* Fixed linux bug with auto updater failing to check version
38
Original file line number Diff line number Diff line change @@ -30,10 +30,10 @@ public MainWindow() {
3030
3131 private void Window_OnLoaded ( object sender , RoutedEventArgs e ) {
3232 // Display change log if the recent update flag exists
33- if ( Utils . CheckFlag ( Settings . UPDATE_RECENT_FLAG_FILE_NAME ) ) {
33+ if ( Flags . CheckFlag ( Constants . UPDATE_RECENT_FLAG_FILE_NAME ) ) {
3434 CreateOrActivateWindow < ChangeLogWindow > ( ) ;
3535
36- Utils . DeleteFlag ( Settings . UPDATE_RECENT_FLAG_FILE_NAME ) ;
36+ Flags . DeleteFlag ( Constants . UPDATE_RECENT_FLAG_FILE_NAME ) ;
3737 }
3838
3939 RunPreInitAsync ( ) . ConfigureAwait ( false ) ;
Original file line number Diff line number Diff line change @@ -18,34 +18,6 @@ public static string NormalizeNameLower(string path) {
1818 public static string NormalizeToNodePath ( string path ) {
1919 return NormalizeSeparator ( path , NodeSystem . PathSeparator . ToCharArray ( ) [ 0 ] ) ;
2020 }
21-
22- internal static bool CheckFlag ( string flagName ) {
23- var currentPath = Path . GetDirectoryName ( Environment . CurrentDirectory ) ;
24- var flagFilePath = Path . Combine ( currentPath , flagName ) ;
25-
26- return File . Exists ( flagFilePath ) ;
27- }
28-
29- internal static void CreateFlag ( string flagName ) {
30- if ( CheckFlag ( flagName ) )
31- return ;
32-
33- var currentPath = Path . GetDirectoryName ( Environment . CurrentDirectory ) ;
34- var flagFilePath = Path . Combine ( currentPath , flagName ) ;
35-
36- File . Create ( flagFilePath ) ;
37- File . SetAttributes ( flagFilePath , File . GetAttributes ( flagFilePath ) | FileAttributes . Hidden ) ;
38- }
39-
40- internal static void DeleteFlag ( string flagName ) {
41- if ( ! CheckFlag ( flagName ) )
42- return ;
43-
44- var currentPath = Path . GetDirectoryName ( Environment . CurrentDirectory ) ;
45- var flagFilePath = Path . Combine ( currentPath , flagName ) ;
46-
47- File . Delete ( flagFilePath ) ;
48- }
4921
5022 internal static bool IsFileLocked ( string path ) {
5123 if ( ! File . Exists ( path ) )
Original file line number Diff line number Diff line change 11namespace Utils ;
22
33public static class Constants {
4+ // File Names
45 public const string INI = "YakuzaParless.ini" ;
56 public const string TXT = "ModList.txt" ;
67 public const string TXT_OLD = "ModLoadOrder.txt" ;
@@ -28,4 +29,12 @@ public static class Constants {
2829 "particle" ,
2930 "stage"
3031 ] ;
32+
33+ // Updates
34+ public const string UPDATER_EXECUTABLE_NAME = "RyuUpdater.exe" ;
35+ public const string UPDATE_FLAG_FILE_NAME = "update.txt" ;
36+ public const string UPDATE_RECENT_FLAG_FILE_NAME = ".SRMM_RECENT_UPDATE_FLAG" ;
37+ public const string UPDATE_INFO_REPO_OWNER = "SRMM-Studio" ;
38+ public const string UPDATE_INFO_REPO = "srmm-version-info" ;
39+ public const string UPDATE_INFO_FILE_PATH = "RyuUpdater/config.yaml" ;
3140}
Original file line number Diff line number Diff line change 1+ namespace Utils ;
2+
3+ public static class Flags {
4+ public static bool CheckFlag ( string flagName ) {
5+ var flagFilePath = Path . Combine ( Environment . CurrentDirectory , flagName ) ;
6+
7+ return File . Exists ( flagFilePath ) ;
8+ }
9+
10+ public static void CreateFlag ( string flagName ) {
11+ if ( CheckFlag ( flagName ) )
12+ return ;
13+
14+ var flagFilePath = Path . Combine ( Environment . CurrentDirectory , flagName ) ;
15+
16+ File . Create ( flagFilePath ) ;
17+ File . SetAttributes ( flagFilePath , File . GetAttributes ( flagFilePath ) | FileAttributes . Hidden ) ;
18+ }
19+
20+ public static void DeleteFlag ( string flagName ) {
21+ if ( ! CheckFlag ( flagName ) )
22+ return ;
23+
24+ var flagFilePath = Path . Combine ( Environment . CurrentDirectory , flagName ) ;
25+
26+ File . Delete ( flagFilePath ) ;
27+ }
28+ }
You can’t perform that action at this time.
0 commit comments