From 57f99145dde49449d24b82ea96ca130340fb8561 Mon Sep 17 00:00:00 2001 From: Daira Hopwood Date: Wed, 29 Oct 2014 03:28:06 +0000 Subject: [PATCH] More WIP. Signed-off-by: Daira Hopwood --- .../windows/installer/installer/installer.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/misc/build_helpers/windows/installer/installer/installer.cpp b/misc/build_helpers/windows/installer/installer/installer.cpp index 0749d387..48c089cd 100644 --- a/misc/build_helpers/windows/installer/installer/installer.cpp +++ b/misc/build_helpers/windows/installer/installer/installer.cpp @@ -10,9 +10,9 @@ void empty_directory(wchar_t *destination_dir); void unzip_from_executable(wchar_t *executable_path, wchar_t *destination_dir); size_t read_uint32_le(unsigned char *b); void unzip(wchar_t *zip_path, wchar_t *destination_dir); -bool have_acceptable_python(); -void install_python(wchar_t *python_installer_dir); bool spawn_with_redirect(FILE *redirect, unsigned char *output_buf, size_t output_size, const wchar_t *argv[]); +void install_python(wchar_t *python_installer_dir); +void scriptsetup(); #define fail_unless(x, s) if (!(x)) { fail(s); } void fail(char *s); @@ -36,8 +36,8 @@ int wmain(int argc, wchar_t *argv[]) { wchar_t *destination_dir = (argc >= 2) ? argv[1] : get_default_destination_dir(); self_extract(destination_dir); - install_python(destination_dir); + scriptsetup(); return 0; } @@ -389,9 +389,12 @@ void install_python(wchar_t *python_installer_dir) { intptr_t exit_code = _wspawnvp(P_WAIT, python_installer_argv[0], python_installer_argv); fail_unless(errno == 0, "Could not execute Python installer."); fail_unless(exit_code == 0, "Python installer failed."); +} +void scriptsetup() { + unsigned char output_buf[10240]; const wchar_t *scriptsetup_argv[] = { L"python", L"setup.py", L"scriptsetup", L"--allusers", NULL }; - res = spawn_with_redirect(stdout, output_buf, sizeof(output_buf), &scriptsetup_argv[0]); + bool res = spawn_with_redirect(stdout, output_buf, sizeof(output_buf), &scriptsetup_argv[0]); puts((char *) output_buf); fail_unless(res, "Could not set up Python to run the 'tahoe' command."); } -- 2.45.2