blob: 35d2fd6a5fc765a404f97f6624557b0ef713ee03 [file] [log] [blame]
Thomas Hellerd1d92ea2004-07-14 15:17:04 +00001/*
2 IMPORTANT NOTE: IF THIS FILE IS CHANGED, WININST-6.EXE MUST BE RECOMPILED
3 WITH THE MSVC6 WININST.DSW WORKSPACE FILE MANUALLY, AND WININST-7.1.EXE MUST
4 BE RECOMPILED WITH THE MSVC 2003.NET WININST-7.1.VCPROJ FILE MANUALLY.
5
6 IF CHANGES TO THIS FILE ARE CHECKED INTO PYTHON CVS, THE RECOMPILED BINARIES
7 MUST BE CHECKED IN AS WELL!
8*/
9
Thomas Hellerbb4b7d22002-11-22 20:39:33 +000010#pragma pack(1)
11
12/* zip-archive headers
13 * See: http://www.pkware.com/appnote.html
14 */
15
16struct eof_cdir {
17 long tag; /* must be 0x06054b50 */
18 short disknum;
19 short firstdisk;
20 short nTotalCDirThis;
21 short nTotalCDir;
22 long nBytesCDir;
23 long ofsCDir;
24 short commentlen;
25};
26
27struct cdir {
28 long tag; /* must be 0x02014b50 */
29 short version_made;
30 short version_extract;
31 short gp_bitflag;
32 short comp_method;
33 short last_mod_file_time;
34 short last_mod_file_date;
35 long crc32;
36 long comp_size;
37 long uncomp_size;
38 short fname_length;
39 short extra_length;
40 short comment_length;
41 short disknum_start;
42 short int_file_attr;
43 long ext_file_attr;
44 long ofs_local_header;
45};
46
47struct fhdr {
48 long tag; /* must be 0x04034b50 */
49 short version_needed;
50 short flags;
51 short method;
52 short last_mod_file_time;
53 short last_mod_file_date;
54 long crc32;
55 long comp_size;
56 long uncomp_size;
57 short fname_length;
58 short extra_length;
59};
60
61
62struct meta_data_hdr {
63 int tag;
64 int uncomp_size;
65 int bitmap_size;
66};
67
68#pragma pack()
69
70/* installation scheme */
71
72typedef struct tagSCHEME {
73 char *name;
74 char *prefix;
75} SCHEME;
76
77typedef int (*NOTIFYPROC)(int code, LPSTR text, ...);
78
79extern BOOL
80extract_file(char *dst, char *src, int method, int comp_size,
81 int uncomp_size, NOTIFYPROC notify);
82
83extern BOOL
84unzip_archive(SCHEME *scheme, char *dirname, char *data,
85 DWORD size, NOTIFYPROC notify);
86
87extern char *
88map_new_file(DWORD flags, char *filename, char
89 *pathname_part, int size,
90 WORD wFatDate, WORD wFatTime,
91 NOTIFYPROC callback);
92
93extern BOOL
94ensure_directory (char *pathname, char *new_part,
95 NOTIFYPROC callback);
96
97/* codes for NOITIFYPROC */
98#define DIR_CREATED 1
99#define CAN_OVERWRITE 2
100#define FILE_CREATED 3
101#define ZLIB_ERROR 4
102#define SYSTEM_ERROR 5
103#define NUM_FILES 6
104#define FILE_OVERWRITTEN 7
105