From e96b27a0ec639a79b1282ab67bb021e0eeb9aa51 Mon Sep 17 00:00:00 2001 From: Jon TURNEY Date: Thu, 5 Jun 2014 15:05:46 +0100 Subject: Fix opening htmlhelp when run without Administrator privileges. Use cygwin_internal(CW_SYNC_WINENV) to populate the Win32 environment, so that HtmlHelp() will try to create temporary files in a suitable location. rather than falling back to %WINDIR%, which will fail without Adminstrator privileges. --- main.cc | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/main.cc b/main.cc index cfaba0d..d343536 100644 --- a/main.cc +++ b/main.cc @@ -839,6 +839,12 @@ void usage(void) int main(int argc, char **argv) { + // It seems that HtmlHelp() may need to create a temporary file using + // GetTempPath(). Create a full Win32 environment, so that it can find a + // suitable location, rather than falling back to %WINDIR%, which will fail + // if we don't have Adminstrator privileges. + cygwin_internal(CW_SYNC_WINENV); + try { InitCommonControls(); CMyWizard dialog; -- cgit v1.2.3