diff --git a/src/Config.ahk b/src/Config.ahk index 886e1be..6c5af2b 100644 --- a/src/Config.ahk +++ b/src/Config.ahk @@ -94,8 +94,6 @@ Config_init() { ; configuration management Config_autoSaveSession := False ; Automatically save the current state of monitors, views, layouts (active view, layout, axes, mfact and msplit) to the configuration file (set below) when quitting bug.n. - If Not Config_filePath ; The file path, to which the configuration and session is saved. This target directory must be writable by the user (%A_ScriptDir% is the diretory, in which "Main.ahk" or the executable of bug.n is saved). - Config_filePath := A_ScriptDir "\Config.ini" Config_restore("Config") Config_getSystemSettings() diff --git a/src/Main.ahk b/src/Main.ahk index 20ecf7e..6e5804b 100644 --- a/src/Main.ahk +++ b/src/Main.ahk @@ -32,22 +32,13 @@ SetWinDelay, 10 #WinActivateForce ; pseudo main function - EnvGet, appDir, APPDATA - bugnDir := appDir . "\bug.n" - IfNotExist, %bugnDir% - FileCreateDir, %bugnDir% - FileGetAttrib, attrib, %bugnDir% - IfNotInString, attrib, D - { - MsgBox, The file path '%appDir%' already exists and is not a directory. Aborting. - Return - } - logFile := bugnDir . "\bugn_log.txt" - Log_init(logFile, False) - - Log_msg("====== Initializing ======") If 0 = 1 - Config_filePath = %1% + Main_dataDir = %1% + Else + Main_dataDir = %A_ScriptDir% ;; %A_ScriptDir% is the directory, in which 'Main.ahk' or the executable of bug.n is saved. + Log_init(Main_dataDir "\log.txt", False) + Log_msg("====== Initializing ======") + Config_filePath := Main_dataDir "\config.ini" Config_init() Menu, Tray, Tip, %NAME% %VERSION%