summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJon TURNEY <jon.turney@dronecode.org.uk>2014-06-05 15:05:46 +0100
committerJon TURNEY <jon.turney@dronecode.org.uk>2014-06-05 15:05:51 +0100
commite96b27a0ec639a79b1282ab67bb021e0eeb9aa51 (patch)
treed750084c0eca7d12c605414a0b3c07dd74156f31
parent2d55c345bd3ce04bfb01c7bad23e36d662574531 (diff)
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.
-rw-r--r--main.cc6
1 files changed, 6 insertions, 0 deletions
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;