mirror of
https://github.com/python/cpython
synced 2024-09-16 03:59:56 +00:00
give a nice message when installer is launched w/o admin rights (closes #16561)
This commit is contained in:
parent
9a4fc19589
commit
25c7d3fb21
|
@ -1774,6 +1774,16 @@ static BOOL OpenLogfile(char *dir)
|
||||||
|
|
||||||
sprintf(buffer, "%s\\%s-wininst.log", dir, meta_name);
|
sprintf(buffer, "%s\\%s-wininst.log", dir, meta_name);
|
||||||
logfile = fopen(buffer, "a");
|
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(<ime);
|
time(<ime);
|
||||||
now = localtime(<ime);
|
now = localtime(<ime);
|
||||||
strftime(buffer, sizeof(buffer),
|
strftime(buffer, sizeof(buffer),
|
||||||
|
|
Loading…
Reference in a new issue