@@ -54,7 +54,8 @@ public static class LauncherConfig
54
54
public static AppIniStruct appIni = new AppIniStruct ( ) ;
55
55
56
56
public static string AppCurrentVersion ;
57
- public static string AppFolder = AppDomain . CurrentDomain . BaseDirectory ;
57
+ public static string AppFolder = Path . GetDirectoryName ( System . Reflection . Assembly . GetEntryAssembly ( ) . Location ) ;
58
+ public static string AppConfigFolder = Path . Combine ( AppFolder , "Config" ) ;
58
59
public static string AppDefaultBG = Path . Combine ( AppFolder , "Assets" , "BG" , "default.png" ) ;
59
60
public static string AppLangFolder = Path . Combine ( AppFolder , "Lang" ) ;
60
61
public static string AppDataFolder = Path . Combine ( Environment . GetFolderPath ( Environment . SpecialFolder . UserProfile ) , "AppData" , "LocalLow" , "CollapseLauncher" ) ;
@@ -72,8 +73,9 @@ public static string AppExecutablePath {
72
73
}
73
74
public static string AppGameImgFolder { get => Path . Combine ( AppGameFolder , "_img" ) ; }
74
75
public static string AppGameLogsFolder { get => Path . Combine ( AppGameFolder , "_logs" ) ; }
75
- public static string AppConfigFile = Path . Combine ( AppDataFolder , "config.ini" ) ;
76
- public static string AppNotifIgnoreFile = Path . Combine ( AppDataFolder , "ignore_notif_ids.json" ) ;
76
+ public static string AppConfigFile = Path . Combine ( AppConfigFolder , "config.ini" ) ;
77
+ public static string AppConfigFileOld = Path . Combine ( AppDataFolder , "config.ini" ) ;
78
+ public static string AppNotifIgnoreFile = Path . Combine ( AppConfigFolder , "ignore_notif_ids.json" ) ;
77
79
public static string GamePathOnSteam ;
78
80
79
81
public static string AppNotifURLPrefix => GetCurrentCDN ( ) . URLPrefix + "/notification_{0}.json" ;
@@ -157,6 +159,8 @@ public static void GetScreenResolutionString()
157
159
158
160
public static void InitAppPreset ( )
159
161
{
162
+ TryCopyOldConfig ( ) ;
163
+
160
164
// Initialize resolution settings first and assign AppConfigFile to ProfilePath
161
165
InitScreenResSettings ( ) ;
162
166
appIni . ProfilePath = AppConfigFile ;
@@ -205,6 +209,23 @@ public static void InitAppPreset()
205
209
IsFirstInstall = ! ( IsConfigFileExist && IsUserHasPermission ) ;
206
210
}
207
211
212
+ private static void TryCopyOldConfig ( )
213
+ {
214
+ try
215
+ {
216
+ if ( File . Exists ( AppConfigFileOld ) )
217
+ {
218
+ if ( ! Directory . Exists ( AppConfigFolder ) )
219
+ {
220
+ Directory . CreateDirectory ( AppConfigFolder ) ;
221
+ }
222
+
223
+ File . Move ( AppConfigFileOld , AppConfigFile ) ;
224
+ }
225
+ }
226
+ catch { }
227
+ }
228
+
208
229
private static bool IsDriveExist ( string path )
209
230
{
210
231
return new DriveInfo ( Path . GetPathRoot ( path ) ) . IsReady ;
0 commit comments