[Python-checkins] CVS: distutils/misc install.c,1.6,1.7
Thomas Heller
python-dev@python.org
Fri, 29 Sep 2000 04:28:44 -0700
Update of /cvsroot/python/distutils/misc
In directory slayer.i.sourceforge.net:/tmp/cvs-serv21086
Modified Files:
install.c
Log Message:
Include files updated.
Variable value_size had the wrong type (found by Rene Liebscher)
Removed the extra_dirs, path_file, and prefix_dir variables
and the related code to create a .pth file.
They are unneeded: All this stuff is already done by the
install command which is run by bdist_wininst.
Comments updated accordingly.
Some code reformatting to break up long lines.
Index: install.c
===================================================================
RCS file: /cvsroot/python/distutils/misc/install.c,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -r1.6 -r1.7
*** install.c 2000/09/09 21:15:16 1.6
--- install.c 2000/09/29 11:28:41 1.7
***************
*** 23,28 ****
* [Setup]
* info= text to be displayed in the edit-box
- * path_file = name of .pth file (if needed)
- * extra_dirs = extra directories for installation
* title= to be displayed by this program
* target_version = if present, python version required
--- 23,26 ----
***************
*** 41,51 ****
* - The user can select the python version to use.
* - The python-installation directory (sys.prefix) is displayed
- * in an edit field. This directory can be edited, and will
- * be used as the root-directory for the modules to be installed.
* - When the start-button is pressed, files from the zip-archive
* are extracted to the file system. All .py filenames are stored
* in a list.
- * - If an installation-directory different from sys.prefix
- * had been specified, a .pth file is created in sys.prefix.
*/
--- 39,45 ----
***************
*** 65,73 ****
#include <windows.h>
#include <commctrl.h>
- #include <shlobj.h>
#include "resource.h"
#include <stdio.h>
#include <stdarg.h>
#include "archive.h"
--- 59,68 ----
#include <windows.h>
#include <commctrl.h>
#include "resource.h"
#include <stdio.h>
+ #include <stdlib.h>
#include <stdarg.h>
+ #include <string.h>
#include "archive.h"
***************
*** 81,86 ****
char info[4096]; /* [Setup] info= */
char title[80]; /* [Setup] title= */
- char path_file[80]; /* [Setup] path_file= */
- char extra_dirs[MAX_PATH]; /* [Setup] extra_dirs= */
char target_version[10]; /* [Setup] target_version= */
char build_info[80]; /* [Setup] build_info= */
--- 76,79 ----
***************
*** 90,94 ****
char *arc_data; /* memory mapped archive */
DWORD arc_size; /* number of bytes in archive */
- char prefix_dir[MAX_PATH];
char install_dir[MAX_PATH];
char pythondll[MAX_PATH];
--- 83,86 ----
***************
*** 549,553 ****
char subkey_name[80], vers_name[80], prefix_buf[MAX_PATH+1];
int itemindex;
! int value_size;
HKEY hk;
--- 541,545 ----
char subkey_name[80], vers_name[80], prefix_buf[MAX_PATH+1];
int itemindex;
! DWORD value_size;
HKEY hk;
***************
*** 557,564 ****
continue;
! wsprintf (vers_name, "Python Version %s (found in registry)", core_version);
itemindex = SendMessage (hwnd, LB_ADDSTRING, 0,
(LPARAM)(LPSTR)vers_name);
! wsprintf (subkey_name, "Software\\Python\\PythonCore\\%s\\InstallPath",
core_version);
value_size = sizeof (subkey_name);
--- 549,558 ----
continue;
! wsprintf (vers_name, "Python Version %s (found in registry)",
! core_version);
itemindex = SendMessage (hwnd, LB_ADDSTRING, 0,
(LPARAM)(LPSTR)vers_name);
! wsprintf (subkey_name,
! "Software\\Python\\PythonCore\\%s\\InstallPath",
core_version);
value_size = sizeof (subkey_name);
***************
*** 625,634 ****
id,
0);
- strcpy (prefix_dir, cp);
strcpy (install_dir, cp);
- if (extra_dirs && *extra_dirs) {
- strcat (install_dir, "\\");
- strcat (install_dir, extra_dirs);
- }
SetDlgItemText (hwnd, IDC_PATH, install_dir);
result = SendDlgItemMessage (hwnd, IDC_VERSIONS_LIST,
--- 619,623 ----
***************
*** 737,743 ****
if (install_dir[strlen(install_dir)-1] != '\\')
strcat (install_dir, "\\");
- /* Create install_dir if necessary */
- if (strcmp (install_dir, prefix_dir))
- ensure_directory (install_dir, install_dir, notify);
/* Strip the trailing backslash again */
install_dir[strlen(install_dir)-1] = '\0';
--- 726,729 ----
***************
*** 759,781 ****
compile_filelist (TRUE);
}
- if (path_file && *path_file) {
- char filename[MAX_PATH];
- FILE *fp;
- strcpy (filename, prefix_dir);
- strcat (filename, "\\");
- strcat (filename, path_file);
- strcat (filename, ".pth");
- SetDlgItemText (hwnd, IDC_TITLE, "Creating pathfile");
- SetDlgItemText (hwnd, IDC_INFO, filename);
- fp = fopen (filename, "w");
- if (fp) {
- fprintf (fp, extra_dirs);
- fclose (fp);
- } else {
- SystemError (GetLastError(),
- "Could not create pathfile");
- success = 0;
- }
- }
break;
--- 745,748 ----
***************
*** 901,908 ****
sizeof (title), ini_file);
unescape (title);
- GetPrivateProfileString ("Setup", "path_file", "", path_file,
- sizeof (path_file), ini_file);
- GetPrivateProfileString ("Setup", "extra_dirs", "", extra_dirs,
- sizeof (extra_dirs), ini_file);
GetPrivateProfileString ("Setup", "info", "", info,
--- 868,871 ----