summaryrefslogtreecommitdiff
path: root/PC
diff options
context:
space:
mode:
authorBenjamin Peterson <benjamin@python.org>2014-11-27 20:39:02 -0600
committerBenjamin Peterson <benjamin@python.org>2014-11-27 20:39:02 -0600
commit209dd468fb233be5691639024212ff291da3f5b2 (patch)
tree4c4bed972fd0d063eb59857d8bcb523693fd458e /PC
parenteeab49a8a497b5ba44d712ed95e8d951a0b3e755 (diff)
downloadcpython-git-209dd468fb233be5691639024212ff291da3f5b2.tar.gz
give a nice message when installer is launched w/o admin rights (closes #16561)
Diffstat (limited to 'PC')
-rw-r--r--PC/bdist_wininst/install.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/PC/bdist_wininst/install.c b/PC/bdist_wininst/install.c
index 2b1deefa4c..8b5be619c3 100644
--- a/PC/bdist_wininst/install.c
+++ b/PC/bdist_wininst/install.c
@@ -1742,6 +1742,16 @@ static BOOL OpenLogfile(char *dir)
sprintf(buffer, "%s\\%s-wininst.log", dir, meta_name);
logfile = fopen(buffer, "a");
+ if (!logfile) {
+ char error[1024];
+
+ sprintf(error, "Can't create \"%s\" (%s).\n\n"
+ "Try to execute the installer as administrator.",
+ buffer, strerror(errno));
+ MessageBox(GetFocus(), error, NULL, MB_OK | MB_ICONSTOP);
+ return FALSE;
+ }
+
time(&ltime);
now = localtime(&ltime);
strftime(buffer, sizeof(buffer),