From 809d91868ab277732a1b8590c26ef1c9e150c568 Mon Sep 17 00:00:00 2001 From: Joshua Fuhs Date: Sat, 30 Jun 2012 12:37:13 -0400 Subject: [PATCH] Use user data directory for logs. --- src/Main.ahk | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/src/Main.ahk b/src/Main.ahk index 3487259..96dffd4 100644 --- a/src/Main.ahk +++ b/src/Main.ahk @@ -32,7 +32,22 @@ SetWinDelay, 10 #WinActivateForce ; pseudo main function - Log_init("bugn_log.txt", False) + + + 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%