summaryrefslogtreecommitdiffstats
path: root/PC/bdist_wininst
diff options
context:
space:
mode:
authorBenjamin Peterson <benjamin@python.org>2014-11-28 02:39:02 (GMT)
committerBenjamin Peterson <benjamin@python.org>2014-11-28 02:39:02 (GMT)
commit25c7d3fb2125f964fe5b9317b31de39117072150 (patch)
tree372bd7588e219aeb85924bbe6bb03c90b48f1e28 /PC/bdist_wininst
parent9a4fc19589a080d8e21ade8d64034b78d500b004 (diff)
downloadcpython-25c7d3fb2125f964fe5b9317b31de39117072150.zip
cpython-25c7d3fb2125f964fe5b9317b31de39117072150.tar.gz
cpython-25c7d3fb2125f964fe5b9317b31de39117072150.tar.bz2
give a nice message when installer is launched w/o admin rights (closes #16561)
Diffstat (limited to 'PC/bdist_wininst')
-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 e9401d9..a0232d2 100644
--- a/PC/bdist_wininst/install.c
+++ b/PC/bdist_wininst/install.c
@@ -1774,6 +1774,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),