From 30869c1c9c2ce500d7dc78473d9579324a53095e Mon Sep 17 00:00:00 2001 From: Quantum Date: Sat, 13 Sep 2025 23:47:52 -0400 Subject: [PATCH] [idd] debug: log to C:\ProgramData\Looking Glass (IDD) --- idd/LGCommon/CDebug.cpp | 11 +---------- idd/installer.nsi | 6 ++++-- 2 files changed, 5 insertions(+), 12 deletions(-) diff --git a/idd/LGCommon/CDebug.cpp b/idd/LGCommon/CDebug.cpp index 56606cac..5083dfe0 100644 --- a/idd/LGCommon/CDebug.cpp +++ b/idd/LGCommon/CDebug.cpp @@ -43,16 +43,7 @@ void CDebug::Init(const char * name) if (IsDebuggerPresent()) return; - // get the system temp directory - char tempPath[MAX_PATH]; - DWORD pathLen = GetTempPathA(sizeof(tempPath), tempPath); - if (pathLen == 0) - { - DEBUG_ERROR_HR(GetLastError(), "Failed to get the temp path"); - return; - } - - std::string folder = tempPath; + std::string folder = "C:\\ProgramData\\Looking Glass (IDD)\\"; std::string baseName = name; std::string ext = ".txt"; std::string logFile = folder + baseName + ext; diff --git a/idd/installer.nsi b/idd/installer.nsi index bdc92e4e..51f4bda5 100644 --- a/idd/installer.nsi +++ b/idd/installer.nsi @@ -78,6 +78,7 @@ Function ShowHelpMessage FunctionEnd Function .onInit + SetShellVarContext all var /GLOBAL cmdLineParams Push $R0 @@ -153,6 +154,9 @@ SectionEnd Section "!Indirect Display Driver (IDD)" Section1 SectionIn RO + DetailPrint "Creating log directory" + CreateDirectory "$APPDATA\Looking Glass (IDD)" + DetailPrint "Extracting IDD" SetOutPath $INSTDIR File lgidd.cat @@ -201,8 +205,6 @@ Section "!Indirect Display Driver (IDD)" Section1 SectionEnd Section "Uninstall" Section6 - SetShellVarContext all - !insertmacro StopLGIddHelper DetailPrint "Uninstalling IDD"