introduced 'Main_dataDir' as the target for config.ini and log.txt

This commit is contained in:
joten 2012-09-28 16:15:20 +02:00
parent 99b74ad39c
commit aa7ddae698
2 changed files with 6 additions and 17 deletions

View file

@ -94,8 +94,6 @@ Config_init() {
; configuration management ; 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. 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_restore("Config")
Config_getSystemSettings() Config_getSystemSettings()

View file

@ -32,22 +32,13 @@ SetWinDelay, 10
#WinActivateForce #WinActivateForce
; pseudo main function ; 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 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() Config_init()
Menu, Tray, Tip, %NAME% %VERSION% Menu, Tray, Tip, %NAME% %VERSION%