5 ? io_stream-net_latest.diff
6 ? io_stream-net_latest_Makefile.in.diff
14 ===================================================================
15 RCS file: /cvs/src/src/winsup/cinstall/Makefile.in,v
16 retrieving revision 2.39
17 diff -u -p -r2.39 Makefile.in
18 --- Makefile.in 2001/12/20 11:49:53 2.39
19 +++ Makefile.in 2001/12/20 12:35:57
20 @@ -87,6 +87,7 @@ OBJS = \
28 @@ -129,6 +130,8 @@ OBJS = \
37 @@ -138,7 +141,9 @@ OBJS = \
48 ===================================================================
49 RCS file: /cvs/src/src/winsup/cinstall/choose.cc,v
50 retrieving revision 2.79
51 diff -u -p -r2.79 choose.cc
52 --- choose.cc 2001/12/20 11:49:53 2.79
53 +++ choose.cc 2001/12/20 12:35:59
54 @@ -36,6 +36,7 @@ static const char *cvsid =
62 @@ -47,6 +48,7 @@ static const char *cvsid =
64 #include "filemanip.h"
65 #include "io_stream.h"
66 +#include "propsheet.h"
70 @@ -55,6 +57,8 @@ static const char *cvsid =
71 #include "package_version.h"
74 +#include "threebar.h"
75 +extern ThreeBarProgressPage Progress;
77 #define alloca __builtin_alloca
79 @@ -1089,6 +1093,7 @@ dialog_proc (HWND h, UINT message, WPARA
82 create_listview (h, &r);
87 @@ -1193,7 +1198,7 @@ scan_downloaded_files ()
91 -do_choose (HINSTANCE h)
92 +do_choose (HINSTANCE h, HWND owner)
96 @@ -1217,9 +1222,9 @@ do_choose (HINSTANCE h)
98 fill_missing_category ();
100 - rv = DialogBox (h, MAKEINTRESOURCE (IDD_CHOOSE), 0, dialog_proc);
101 + rv = DialogBox (h, MAKEINTRESOURCE (IDD_CHOOSE), owner, dialog_proc);
103 - fatal (IDS_DIALOG_FAILED);
104 + fatal (owner, IDS_DIALOG_FAILED);
106 log (LOG_BABBLE, "Chooser results...");
108 @@ -1302,4 +1307,63 @@ do_choose (HINSTANCE h)
114 +#define WM_APP_START_CHOOSE WM_APP+0
115 +#define WM_APP_CHOOSE_IS_FINISHED WM_APP+1
118 +do_choose (HINSTANCE h, HWND owner);
120 +void do_choose_thread(void *p)
124 + cp = static_cast<ChooserPage*>(p);
126 + do_choose(cp->GetInstance(), cp->GetHWND());
128 + cp->PostMessage(WM_APP_CHOOSE_IS_FINISHED);
133 +bool ChooserPage::Create()
135 + return PropertyPage::Create(IDD_CHOOSER);
138 +void ChooserPage::OnActivate()
140 + GetOwner()->SetButtons(0);
141 + PostMessage(WM_APP_START_CHOOSE);
144 +bool ChooserPage::OnMessageApp(UINT uMsg, WPARAM wParam, LPARAM lParam)
148 + case WM_APP_START_CHOOSE:
150 + // Start the chooser thread.
151 + _beginthread(do_choose_thread, 0, this);
154 + case WM_APP_CHOOSE_IS_FINISHED:
156 + if(next_dialog == 0)
159 + GetOwner()->PressButton(PSBTN_CANCEL);
162 + Progress.SetActivateTask(WM_APP_START_DOWNLOAD);
163 + GetOwner()->SetActivePageByID(IDD_INSTATUS);
173 ===================================================================
174 RCS file: /cvs/src/src/winsup/cinstall/choose.h,v
175 retrieving revision 2.9
176 diff -u -p -r2.9 choose.h
177 --- choose.h 2001/12/20 11:49:53 2.9
178 +++ choose.h 2001/12/20 12:35:59
183 +#include "proppage.h"
188 @@ -195,5 +197,18 @@ private:
190 void init_headers (HDC dc);
193 +class ChooserPage : public PropertyPage
197 + virtual ~ChooserPage() {};
199 + virtual bool OnMessageApp(UINT uMsg, WPARAM wParam, LPARAM lParam);
202 + virtual void OnActivate();
205 #endif /* __cplusplus */
206 #endif /* _CHOOSE_H_ */
208 ===================================================================
209 RCS file: cistring.cc
211 --- /dev/null Tue May 5 13:32:27 1998
212 +++ cistring.cc Thu Dec 20 04:35:59 2001
215 + * Copyright (c) 2001, Gary R. Van Sickle.
217 + * This program is free software; you can redistribute it and/or modify
218 + * it under the terms of the GNU General Public License as published by
219 + * the Free Software Foundation; either version 2 of the License, or
220 + * (at your option) any later version.
222 + * A copy of the GNU General Public License can be found at
223 + * http://www.gnu.org/
225 + * Written by Gary R. Van Sickle <g.r.vansickle@worldnet.att.net>
229 +// Yep, another string class
231 +#include "cistring.h"
235 +cistring::Format (UINT i, ...)
237 + TCHAR FormatStringBuffer[256];
242 + // Get the string from the stringtable (FormatMessage() can only work with
243 + // literal strings or *message*table entries, which are different for some
244 + // inexplicable reason).
245 + LoadString (GetModuleHandle (NULL), i, FormatStringBuffer, 256);
247 + va_start (arglist, i);
249 + FormatMessage (FORMAT_MESSAGE_ALLOCATE_BUFFER |
250 + FORMAT_MESSAGE_FROM_STRING, FormatStringBuffer, i, 0,
251 + (LPTSTR) & Buff, 0, &arglist);
256 + // Something went wrong.
260 + buffer = new TCHAR[(numchars + 1) * sizeof (TCHAR)];
261 + memcpy (buffer, Buff, (numchars + 1) * sizeof (TCHAR));
267 ===================================================================
270 --- /dev/null Tue May 5 13:32:27 1998
271 +++ cistring.h Thu Dec 20 04:35:59 2001
274 + * Copyright (c) 2001, Gary R. Van Sickle.
276 + * This program is free software; you can redistribute it and/or modify
277 + * it under the terms of the GNU General Public License as published by
278 + * the Free Software Foundation; either version 2 of the License, or
279 + * (at your option) any later version.
281 + * A copy of the GNU General Public License can be found at
282 + * http://www.gnu.org/
284 + * Written by Gary R. Van Sickle <g.r.vansickle@worldnet.att.net>
288 +// Yep, another string class
290 +#include <windows.h>
300 + cistring (const TCHAR * s);
303 + if (buffer != NULL)
307 + const TCHAR *c_str ()
312 + DWORD Format (UINT i, ...);
315 ===================================================================
316 RCS file: /cvs/src/src/winsup/cinstall/desktop.cc,v
317 retrieving revision 2.19
318 diff -u -p -r2.19 desktop.cc
319 --- desktop.cc 2001/12/20 11:49:53 2.19
320 +++ desktop.cc 2001/12/20 12:35:59
321 @@ -48,6 +48,8 @@ static const char *cvsid =
322 #include "package_meta.h"
323 #include "package_version.h"
325 +#include "desktop.h"
327 static OSVERSIONINFO verinfo;
329 /* Lines starting with '@' are conditionals - include 'N' for NT,
330 @@ -444,56 +446,48 @@ dialog_cmd (HWND h, int id, HWND hwndctl
332 check_if_enable_next (h);
337 - do_desktop_setup ();
338 - NEXT (IDD_S_POSTINSTALL);
353 -static BOOL CALLBACK
354 -dialog_proc (HWND h, UINT message, WPARAM wParam, LPARAM lParam)
356 +DesktopSetupPage::Create ()
360 - case WM_INITDIALOG:
364 - return HANDLE_WM_COMMAND (h, wParam, lParam, dialog_cmd);
367 + return PropertyPage::Create (NULL, dialog_cmd, IDD_DESKTOP);
371 -do_desktop (HINSTANCE h)
372 +DesktopSetupPage::OnInit ()
374 + // FIXME: This CoInitialize() feels like it could be moved to startup in main.cc.
377 verinfo.dwOSVersionInfoSize = sizeof (verinfo);
378 GetVersionEx (&verinfo);
381 check_desktop ("Cygwin", backslash (cygpath ("/cygwin.bat", 0)));
383 check_startmenu ("Cygwin Bash Shell",
384 backslash (cygpath ("/cygwin.bat", 0)));
385 + load_dialog (GetHWND ());
390 +DesktopSetupPage::OnBack ()
392 + HWND h = GetHWND ();
395 + return IDD_CHOOSER;
399 +DesktopSetupPage::OnFinish ()
401 + HWND h = GetHWND ();
403 + do_desktop_setup ();
404 + NEXT (IDD_S_POSTINSTALL);
405 + do_postinstall (GetInstance (), h);
407 - rv = DialogBox (h, MAKEINTRESOURCE (IDD_DESKTOP), 0, dialog_proc);
409 - fatal (IDS_DIALOG_FAILED);
413 ===================================================================
416 --- /dev/null Tue May 5 13:32:27 1998
417 +++ desktop.h Thu Dec 20 04:35:59 2001
419 +#ifndef CINSTALL_DESKTOP_H
420 +#define CINSTALL_DESKTOP_H
423 + * Copyright (c) 2001, Gary R. Van Sickle.
425 + * This program is free software; you can redistribute it and/or modify
426 + * it under the terms of the GNU General Public License as published by
427 + * the Free Software Foundation; either version 2 of the License, or
428 + * (at your option) any later version.
430 + * A copy of the GNU General Public License can be found at
431 + * http://www.gnu.org/
433 + * Written by Gary R. Van Sickle <g.r.vansickle@worldnet.att.net>
437 +// This is the header for the DesktopSetupPage class. Allows selection
438 +// of "create desktop icon" and "add to start menu".
440 +#include "proppage.h"
442 +class DesktopSetupPage:public PropertyPage
445 + DesktopSetupPage ()
448 + virtual ~ DesktopSetupPage ()
454 + virtual void OnInit ();
455 + virtual bool OnFinish ();
456 + virtual long OnBack ();
459 +#endif // CINSTALL_DESKTOP_H
461 ===================================================================
462 RCS file: /cvs/src/src/winsup/cinstall/dialog.h,v
463 retrieving revision 2.4
464 diff -u -p -r2.4 dialog.h
465 --- dialog.h 2001/11/13 01:49:31 2.4
466 +++ dialog.h 2001/12/20 12:35:59
467 @@ -22,7 +22,7 @@ extern int next_dialog;
468 /* either "nothing to do" or "setup complete" or something like that */
471 -#define D(x) void x(HINSTANCE _h)
472 +#define D(x) void x(HINSTANCE _h, HWND owner)
474 /* prototypes for all the do_* functions (most called by main.cc) */
477 ===================================================================
478 RCS file: /cvs/src/src/winsup/cinstall/download.cc,v
479 retrieving revision 2.18
480 diff -u -p -r2.18 download.cc
481 --- download.cc 2001/12/20 11:49:53 2.18
482 +++ download.cc 2001/12/20 12:35:59
483 @@ -25,6 +25,7 @@ static const char *cvsid =
487 +#include <process.h>
489 #include "resource.h"
491 @@ -47,6 +48,9 @@ static const char *cvsid =
495 +#include "threebar.h"
496 +extern ThreeBarProgressPage Progress;
501 @@ -95,7 +99,7 @@ check_for_cached (packagesource & pkgsou
503 /* download a file from a mirror site to the local cache. */
505 -download_one (packagesource & pkgsource)
506 +download_one (packagesource & pkgsource, HWND owner)
508 if (check_for_cached (pkgsource) && source != IDC_SOURCE_DOWNLOAD)
510 @@ -106,14 +110,15 @@ download_one (packagesource & pkgsource)
511 for (size_t n = 1; n <= pkgsource.sites.number () && !success; n++)
513 const char *local = concat (local_dir, "/",
514 - rfc1738_escape_part (pkgsource.sites[n]->key), "/",
515 + rfc1738_escape_part (pkgsource.sites[n]->
517 pkgsource.Canonical (), 0);
518 io_stream::mkpath_p (PATH_TO_FILE, concat ("file://", local, 0));
522 (pkgsource.sites[n]->key, "/", pkgsource.Canonical (), 0),
523 - concat (local, ".tmp", 0), pkgsource.size))
524 + concat (local, ".tmp", 0), pkgsource.size, owner))
526 /* FIXME: note new source ? */
528 @@ -146,8 +151,8 @@ download_one (packagesource & pkgsource)
533 -do_download (HINSTANCE h)
535 +do_download_thread (HINSTANCE h, HWND owner)
538 total_download_bytes = 0;
539 @@ -157,19 +162,19 @@ do_download (HINSTANCE h)
540 /* calculate the amount needed */
541 for (size_t n = 1; n < db.packages.number (); n++)
543 - packagemeta &pkg = * db.packages[n];
544 + packagemeta & pkg = *db.packages[n];
545 if (pkg.desired && (pkg.desired->srcpicked || pkg.desired->binpicked))
547 - packageversion *version = pkg.desired;
549 - (check_for_cached (version->bin)
550 - && source != IDC_SOURCE_DOWNLOAD))
551 - total_download_bytes += version->bin.size;
553 - (check_for_cached (version->src)
554 - && source != IDC_SOURCE_DOWNLOAD))
555 - total_download_bytes += version->src.size;
558 + packageversion *version = pkg.desired;
560 + (check_for_cached (version->bin)
561 + && source != IDC_SOURCE_DOWNLOAD) && pkg.desired->binpicked)
562 + total_download_bytes += version->bin.size;
564 + (check_for_cached (version->src)
565 + && source != IDC_SOURCE_DOWNLOAD) && pkg.desired->srcpicked)
566 + total_download_bytes += version->src.size;
570 /* and do the download. FIXME: This here we assign a new name for the cached version
571 @@ -177,28 +182,28 @@ do_download (HINSTANCE h)
573 for (size_t n = 1; n < db.packages.number (); n++)
575 - packagemeta &pkg = * db.packages[n];
576 - if (pkg.desired && (pkg.desired->srcpicked || pkg.desired->binpicked))
579 - packageversion *version = pkg.desired;
580 - if (version->binpicked)
581 - e += download_one (version->bin);
582 - if (version->srcpicked)
583 - e += download_one (version->src);
585 + packagemeta & pkg = *db.packages[n];
586 + if (pkg.desired && (pkg.desired->srcpicked || pkg.desired->binpicked))
589 + packageversion *version = pkg.desired;
590 + if (version->binpicked)
591 + e += download_one (version->bin, owner);
592 + if (version->srcpicked)
593 + e += download_one (version->src, owner);
597 - pkg->action = ACTION_ERROR;
599 + pkg->action = ACTION_ERROR;
605 dismiss_url_status_dialog ();
609 - if (yesno (IDS_DOWNLOAD_INCOMPLETE) == IDYES)
610 + if (yesno (owner, IDS_DOWNLOAD_INCOMPLETE) == IDYES)
612 next_dialog = IDD_SITE;
614 @@ -215,4 +220,29 @@ do_download (HINSTANCE h)
617 next_dialog = IDD_S_INSTALL;
621 +do_download_reflector (void *p)
624 + context = (HANDLE *) p;
626 + do_download_thread ((HINSTANCE) context[0], (HWND) context[1]);
628 + // Tell the progress page that we're done downloading
629 + Progress.PostMessage (WM_APP_DOWNLOAD_THREAD_COMPLETE, 0, next_dialog);
634 +static HANDLE context[2];
637 +do_download (HINSTANCE h, HWND owner)
640 + context[1] = owner;
642 + _beginthread (do_download_reflector, 0, context);
645 ===================================================================
646 RCS file: /cvs/src/src/winsup/cinstall/fromcwd.cc,v
647 retrieving revision 2.16
648 diff -u -p -r2.16 fromcwd.cc
649 --- fromcwd.cc 2001/12/20 11:49:53 2.16
650 +++ fromcwd.cc 2001/12/20 12:36:00
651 @@ -118,7 +118,7 @@ check_ini (char *path, unsigned int fsiz
655 -do_fromcwd (HINSTANCE h)
656 +do_fromcwd (HINSTANCE h, HWND owner)
659 find (".", check_ini);
661 ===================================================================
662 RCS file: /cvs/src/src/winsup/cinstall/geturl.cc,v
663 retrieving revision 2.15
664 diff -u -p -r2.15 geturl.cc
665 --- geturl.cc 2001/12/02 03:25:11 2.15
666 +++ geturl.cc 2001/12/20 12:36:00
667 @@ -43,119 +43,33 @@ static const char *cvsid =
668 #include "diskfull.h"
671 -static HWND gw_dialog = 0;
672 -static HWND gw_url = 0;
673 -static HWND gw_rate = 0;
674 -static HWND gw_progress = 0;
675 -static HWND gw_pprogress = 0;
676 -static HWND gw_iprogress = 0;
677 -static HWND gw_progress_text = 0;
678 -static HWND gw_pprogress_text = 0;
679 -static HWND gw_iprogress_text = 0;
680 -static HANDLE init_event;
681 +#include "threebar.h"
682 +extern ThreeBarProgressPage Progress;
684 static int max_bytes = 0;
685 static int is_local_install = 0;
687 int total_download_bytes = 0;
688 int total_download_bytes_sofar = 0;
691 -dialog_cmd (HWND h, int id, HWND hwndctl, UINT code)
701 -static BOOL CALLBACK
702 -dialog_proc (HWND h, UINT message, WPARAM wParam, LPARAM lParam)
706 - case WM_INITDIALOG:
708 - gw_url = GetDlgItem (h, IDC_DLS_URL);
709 - gw_rate = GetDlgItem (h, IDC_DLS_RATE);
710 - gw_progress = GetDlgItem (h, IDC_DLS_PROGRESS);
711 - gw_pprogress = GetDlgItem (h, IDC_DLS_PPROGRESS);
712 - gw_iprogress = GetDlgItem (h, IDC_DLS_IPROGRESS);
713 - gw_progress_text = GetDlgItem (h, IDC_DLS_PROGRESS_TEXT);
714 - gw_pprogress_text = GetDlgItem (h, IDC_DLS_PPROGRESS_TEXT);
715 - gw_iprogress_text = GetDlgItem (h, IDC_DLS_IPROGRESS_TEXT);
716 - SetEvent (init_event);
719 - return HANDLE_WM_COMMAND (h, wParam, lParam, dialog_cmd);
728 - HWND local_gw_dialog =
729 - CreateDialog (hinstance, MAKEINTRESOURCE (IDD_DLSTATUS),
731 - ShowWindow (local_gw_dialog, SW_SHOWNORMAL);
732 - UpdateWindow (local_gw_dialog);
733 - while (GetMessage (&m, 0, 0, 0) > 0)
735 - TranslateMessage (&m);
736 - DispatchMessage (&m);
741 static DWORD start_tics;
744 -init_dialog (char const *url, int length)
745 +init_dialog (char const *url, int length, HWND owner)
747 if (is_local_install)
749 - if (gw_dialog == 0)
753 - init_event = CreateEvent (0, 0, 0, 0);
754 - thread = CreateThread (0, 0, dialog, 0, 0, &tid);
755 - WaitForSingleObject (init_event, 1000);
756 - CloseHandle (init_event);
757 - SendMessage (gw_progress, PBM_SETRANGE, 0, MAKELPARAM (0, 100));
758 - SendMessage (gw_pprogress, PBM_SETRANGE, 0, MAKELPARAM (0, 100));
759 - SendMessage (gw_iprogress, PBM_SETRANGE, 0, MAKELPARAM (0, 100));
762 char const *sl = url;
764 for (cp = url; *cp; cp++)
765 if (*cp == '/' || *cp == '\\' || *cp == ':')
768 - SetWindowText (gw_url, sl);
769 - SetWindowText (gw_rate, "Connecting...");
770 - SendMessage (gw_progress, PBM_SETPOS, (WPARAM) 0, 0);
771 - ShowWindow (gw_progress, (length > 0) ? SW_SHOW : SW_HIDE);
773 - SetWindowText (gw_progress_text, "Package");
775 - SetWindowText (gw_progress_text, " ");
776 - ShowWindow (gw_pprogress, (total_download_bytes > 0) ? SW_SHOW : SW_HIDE);
777 - if (total_download_bytes > 0)
779 - SetWindowText (gw_pprogress_text, "Total");
780 - SetWindowText (gw_iprogress_text, "Disk");
784 - SetWindowText (gw_pprogress_text, " ");
785 - SetWindowText (gw_iprogress_text, " ");
787 - ShowWindow (gw_iprogress, (total_download_bytes > 0) ? SW_SHOW : SW_HIDE);
788 - ShowWindow (gw_dialog, SW_SHOWNORMAL);
789 + Progress.SetText1 ("Downloading...");
790 + Progress.SetText2 (sl);
791 + Progress.SetText3 ("Connecting...");
792 + Progress.SetBar1 (0);
793 start_tics = GetTickCount ();
796 @@ -166,7 +80,7 @@ progress (int bytes)
797 if (is_local_install)
799 static char buf[100];
802 static unsigned int last_tics = 0;
803 DWORD tics = GetTickCount ();
804 if (tics == start_tics) // to prevent division by zero
805 @@ -175,36 +89,31 @@ progress (int bytes)
809 - kbps = bytes / (tics - start_tics);
810 - ShowWindow (gw_progress, (max_bytes > 0) ? SW_SHOW : SW_HIDE);
811 - ShowWindow (gw_pprogress, (total_download_bytes > 0) ? SW_SHOW : SW_HIDE);
812 - ShowWindow (gw_iprogress, (total_download_bytes > 0) ? SW_SHOW : SW_HIDE);
813 - if (max_bytes > 100)
815 - int perc = bytes / (max_bytes / 100);
816 - SendMessage (gw_progress, PBM_SETPOS, (WPARAM) perc, 0);
817 - sprintf (buf, "%3d %% (%dk/%dk) %d kb/s\n",
818 + kbps = ((double) bytes) / (double) (tics - start_tics);
821 + int perc = (int) (100.0 * ((double) bytes) / (double) max_bytes);
822 + Progress.SetBar1 (bytes, max_bytes);
823 + sprintf (buf, "%3d %% (%dk/%dk) %2.1f kb/s\n",
824 perc, bytes / 1000, max_bytes / 1000, kbps);
825 if (total_download_bytes > 0)
828 - (total_download_bytes_sofar +
829 - bytes) / (total_download_bytes / 100);
830 - SendMessage (gw_pprogress, PBM_SETPOS, (WPARAM) totalperc, 0);
831 + Progress.SetBar2 (total_download_bytes_sofar + bytes,
832 + total_download_bytes);
836 - sprintf (buf, "%d %d kb/s\n", bytes, kbps);
837 + sprintf (buf, "%d %2.1f kb/s\n", bytes, kbps);
839 - SetWindowText (gw_rate, buf);
840 + Progress.SetText3 (buf);
844 -get_url_to_membuf (char const *_url)
845 +get_url_to_membuf (char const *_url, HWND owner)
847 log (LOG_BABBLE, "get_url_to_membuf %s", _url);
848 is_local_install = (source == IDC_SOURCE_CWD);
849 - init_dialog (_url, 0);
850 + init_dialog (_url, 0, owner);
851 NetIO *n = NetIO::open (_url);
854 @@ -254,9 +163,9 @@ get_url_to_membuf (char const *_url)
858 -get_url_to_string (char const *_url)
859 +get_url_to_string (char const *_url, HWND owner)
861 - io_stream *stream = get_url_to_membuf (_url);
862 + io_stream *stream = get_url_to_membuf (_url, owner);
865 size_t bytes = stream->get_size ();
866 @@ -264,10 +173,11 @@ get_url_to_string (char const *_url)
868 /* zero length, or error retrieving length */
870 - log (LOG_BABBLE, "get_url_to_string(): couldn't retrieve buffer size, or zero length buffer");
872 + "get_url_to_string(): couldn't retrieve buffer size, or zero length buffer");
875 - char *rv = new char [bytes + 1];
876 + char *rv = new char[bytes + 1];
880 @@ -276,22 +186,22 @@ get_url_to_string (char const *_url)
882 /* membufs are quite safe */
883 stream->read (rv, bytes);
891 get_url_to_file (char *_url, char *_filename, int expected_length,
892 - BOOL allow_ftp_auth)
893 + HWND owner, BOOL allow_ftp_auth)
895 log (LOG_BABBLE, "get_url_to_file %s %s", _url, _filename);
896 if (total_download_bytes > 0)
898 int df = diskfull (get_root_dir ());
899 - SendMessage (gw_iprogress, PBM_SETPOS, (WPARAM) df, 0);
900 + Progress.SetBar3 (df);
902 - init_dialog (_url, expected_length);
903 + init_dialog (_url, expected_length, owner);
905 remove (_filename); /* but ignore errors */
907 @@ -309,7 +219,7 @@ get_url_to_file (char *_url, char *_file
908 const char *err = strerror (errno);
910 err = "(unknown error)";
911 - fatal (IDS_ERR_OPEN_WRITE, _filename, err);
912 + fatal (owner, IDS_ERR_OPEN_WRITE, _filename, err);
916 @@ -338,15 +248,16 @@ get_url_to_file (char *_url, char *_file
917 if (total_download_bytes > 0)
919 int df = diskfull (get_root_dir ());
920 - SendMessage (gw_iprogress, PBM_SETPOS, (WPARAM) df, 0);
921 + Progress.SetBar3 (df);
927 +// FIXME: I think this can go now, I don't think anything calls it.
929 dismiss_url_status_dialog ()
931 - if (!is_local_install)
932 - ShowWindow (gw_dialog, SW_HIDE);
933 + //if (!is_local_install)
934 + //ShowWindow (gw_dialog, SW_HIDE);
937 ===================================================================
938 RCS file: /cvs/src/src/winsup/cinstall/geturl.h,v
939 retrieving revision 2.4
940 diff -u -p -r2.4 geturl.h
941 --- geturl.h 2001/12/02 03:25:11 2.4
942 +++ geturl.h 2001/12/20 12:36:00
943 @@ -21,8 +21,8 @@ extern int total_download_bytes_sofar;
947 -io_stream *get_url_to_membuf (char const *);
948 -char *get_url_to_string (char const *);
949 +io_stream *get_url_to_membuf (char const *, HWND owner);
950 +char *get_url_to_string (char const *, HWND owner);
951 int get_url_to_file (char *_url, char *_filename, int expected_size,
952 - BOOL allow_ftp_auth = FALSE);
953 + HWND owner, BOOL allow_ftp_auth = FALSE);
954 void dismiss_url_status_dialog ();
956 ===================================================================
957 RCS file: /cvs/src/src/winsup/cinstall/ini.cc,v
958 retrieving revision 2.15
959 diff -u -p -r2.15 ini.cc
960 --- ini.cc 2001/12/03 22:22:09 2.15
961 +++ ini.cc 2001/12/20 12:36:00
962 @@ -28,6 +28,7 @@ static const char *cvsid =
966 +#include <process.h>
969 #include "resource.h"
970 @@ -45,6 +46,9 @@ static const char *cvsid =
972 #include "io_stream.h"
974 +#include "threebar.h"
975 +extern ThreeBarProgressPage Progress;
977 unsigned int setup_timestamp = 0;
978 char *setup_version = 0;
980 @@ -59,50 +63,54 @@ static int local_ini;
982 find_routine (char *path, unsigned int fsize)
984 - if (!strstr (path, "/setup.ini") )
985 + if (!strstr (path, "/setup.ini"))
987 - io_stream *ini_file = io_stream::open (concat ("file://", local_dir,"/", path, 0), "rb");
988 + io_stream *ini_file =
989 + io_stream::open (concat ("file://", local_dir, "/", path, 0), "rb");
992 - note (IDS_SETUPINI_MISSING, path);
994 + note (NULL, IDS_SETUPINI_MISSING, path);
998 /* FIXME: only use most recent copy */
1002 - ini_init (ini_file, concat ("file://", local_dir,"/", path, 0));
1003 + ini_init (ini_file, concat ("file://", local_dir, "/", path, 0));
1007 if (yyparse () || error_count > 0)
1008 - MessageBox (0, error_buf, error_count == 1 ? "Parse Error" : "Parse Errors", 0);
1009 + MessageBox (0, error_buf,
1010 + error_count == 1 ? "Parse Error" : "Parse Errors", 0);
1017 +do_local_ini (HWND owner)
1020 find (local_dir, find_routine);
1027 +do_remote_ini (HWND owner)
1029 size_t ini_count = 0;
1031 for (size_t n = 1; n <= site_list.number (); n++)
1033 io_stream *ini_file =
1034 - get_url_to_membuf (concat (site_list[n]->url, "/setup.ini", 0));
1035 + get_url_to_membuf (concat (site_list[n]->url, "/setup.ini", 0),
1037 dismiss_url_status_dialog ();
1041 - note (IDS_SETUPINI_MISSING, site_list[n]->url);
1042 + note (owner, IDS_SETUPINI_MISSING, site_list[n]->url);
1046 @@ -139,14 +147,14 @@ do_remote_ini ()
1051 -do_ini (HINSTANCE h)
1053 +do_ini_thread (HINSTANCE h, HWND owner)
1055 size_t ini_count = 0;
1056 if (source == IDC_SOURCE_CWD)
1057 - ini_count = do_local_ini ();
1058 + ini_count = do_local_ini (owner);
1060 - ini_count = do_remote_ini ();
1061 + ini_count = do_remote_ini (owner);
1065 @@ -171,7 +179,7 @@ do_ini (HINSTANCE h)
1066 if (old_timestamp && setup_timestamp
1067 && (old_timestamp > setup_timestamp))
1069 - int yn = yesno (IDS_OLD_SETUPINI);
1070 + int yn = yesno (owner, IDS_OLD_SETUPINI);
1074 @@ -197,11 +205,37 @@ do_ini (HINSTANCE h)
1075 char *ini_version = canonicalize_version (setup_version);
1076 char *our_version = canonicalize_version (version);
1077 if (strcmp (our_version, ini_version) < 0)
1078 - note (IDS_OLD_SETUP_VERSION, version, setup_version);
1079 + note (owner, IDS_OLD_SETUP_VERSION, version, setup_version);
1082 + next_dialog = IDD_CHOOSER;
1086 +do_ini_thread_reflector (void *p)
1089 + context = (HANDLE *) p;
1091 + do_ini_thread ((HINSTANCE) context[0], (HWND) context[1]);
1093 + // Tell the progress page that we're done downloading
1094 + Progress.PostMessage (WM_APP_SETUP_INI_DOWNLOAD_COMPLETE, 0, next_dialog);
1099 - next_dialog = IDD_CHOOSE;
1100 +static HANDLE context[2];
1103 +do_ini (HINSTANCE h, HWND owner)
1106 + context[1] = owner;
1108 + _beginthread (do_ini_thread_reflector, 0, context);
1112 extern int yylineno;
1115 ===================================================================
1116 RCS file: /cvs/src/src/winsup/cinstall/install.cc,v
1117 retrieving revision 2.31
1118 diff -u -p -r2.31 install.cc
1119 --- install.cc 2001/12/20 11:49:53 2.31
1120 +++ install.cc 2001/12/20 12:36:00
1121 @@ -33,6 +33,8 @@ static const char *cvsid =
1122 #include <sys/types.h>
1123 #include <sys/stat.h>
1125 +#include <process.h>
1127 #include "zlib/zlib.h"
1129 #include "resource.h"
1130 @@ -61,109 +63,31 @@ static const char *cvsid =
1134 -static HWND ins_dialog = 0;
1135 -static HWND ins_action = 0;
1136 -static HWND ins_pkgname = 0;
1137 -static HWND ins_filename = 0;
1138 -static HWND ins_pprogress = 0;
1139 -static HWND ins_iprogress = 0;
1140 -static HWND ins_diskfull = 0;
1141 -static HANDLE init_event;
1142 +#include "threebar.h"
1143 +extern ThreeBarProgressPage Progress;
1145 static int total_bytes = 0;
1146 static int total_bytes_sofar = 0;
1147 static int package_bytes = 0;
1150 -dialog_cmd (HWND h, int id, HWND hwndctl, UINT code)
1160 -static BOOL CALLBACK
1161 -dialog_proc (HWND h, UINT message, WPARAM wParam, LPARAM lParam)
1165 - case WM_INITDIALOG:
1167 - ins_action = GetDlgItem (h, IDC_INS_ACTION);
1168 - ins_pkgname = GetDlgItem (h, IDC_INS_PKG);
1169 - ins_filename = GetDlgItem (h, IDC_INS_FILE);
1170 - ins_pprogress = GetDlgItem (h, IDC_INS_PPROGRESS);
1171 - ins_iprogress = GetDlgItem (h, IDC_INS_IPROGRESS);
1172 - ins_diskfull = GetDlgItem (h, IDC_INS_DISKFULL);
1173 - SetEvent (init_event);
1176 - return HANDLE_WM_COMMAND (h, wParam, lParam, dialog_cmd);
1181 -static WINAPI DWORD
1186 - HWND ins_dialog = CreateDialog (hinstance, MAKEINTRESOURCE (IDD_INSTATUS),
1188 - if (ins_dialog == 0)
1189 - fatal ("create dialog");
1190 - ShowWindow (ins_dialog, SW_SHOWNORMAL);
1191 - UpdateWindow (ins_dialog);
1192 - while (GetMessage (&m, 0, 0, 0) > 0)
1194 - TranslateMessage (&m);
1195 - DispatchMessage (&m);
1203 - if (ins_dialog == 0)
1207 - init_event = CreateEvent (0, 0, 0, 0);
1208 - thread = CreateThread (0, 0, dialog, 0, 0, &tid);
1209 - WaitForSingleObject (init_event, 10000);
1210 - CloseHandle (init_event);
1211 - SendMessage (ins_pprogress, PBM_SETRANGE, 0, MAKELPARAM (0, 100));
1212 - SendMessage (ins_iprogress, PBM_SETRANGE, 0, MAKELPARAM (0, 100));
1213 - SendMessage (ins_diskfull, PBM_SETRANGE, 0, MAKELPARAM (0, 100));
1216 - SetWindowText (ins_pkgname, "");
1217 - SetWindowText (ins_filename, "");
1218 - SendMessage (ins_pprogress, PBM_SETPOS, (WPARAM) 0, 0);
1219 - SendMessage (ins_iprogress, PBM_SETPOS, (WPARAM) 0, 0);
1220 - SendMessage (ins_diskfull, PBM_SETPOS, (WPARAM) 0, 0);
1221 - ShowWindow (ins_dialog, SW_SHOWNORMAL);
1222 + Progress.SetText2 ("");
1223 + Progress.SetText3 ("");
1227 progress (int bytes)
1231 - if (package_bytes > 100)
1232 + if (package_bytes > 0)
1234 - perc = bytes / (package_bytes / 100);
1235 - SendMessage (ins_pprogress, PBM_SETPOS, (WPARAM) perc, 0);
1236 + Progress.SetBar1 (bytes, package_bytes);
1239 - if (total_bytes > 100)
1240 + if (total_bytes > 0)
1242 - perc = (total_bytes_sofar + bytes) / (total_bytes / 100);
1243 - SendMessage (ins_iprogress, PBM_SETPOS, (WPARAM) perc, 0);
1244 + Progress.SetBar2 (total_bytes_sofar + bytes, total_bytes);
1248 @@ -192,11 +116,11 @@ static int num_installs, num_uninstalls;
1250 uninstall_one (packagemeta & pkgm)
1252 - SetWindowText (ins_pkgname, pkgm.name);
1253 - SetWindowText (ins_action, "Uninstalling...");
1254 - log (0, "Uninstalling %s", pkgm.name);
1255 - pkgm.uninstall ();
1257 + Progress.SetText1 ("Uninstalling...");
1258 + Progress.SetText2 (pkgm.name);
1259 + log (0, "Uninstalling %s", pkgm.name);
1260 + pkgm.uninstall ();
1265 @@ -207,10 +131,10 @@ install_one_source (packagemeta & pkgm,
1266 char const *prefix, package_type_t type)
1269 - SetWindowText (ins_pkgname, source.Base ());
1270 + Progress.SetText2 (source.Base ());
1271 if (!io_stream::exists (source.Cached ()))
1273 - note (IDS_ERR_OPEN_READ, source.Cached (), "No such file");
1274 + note (NULL, IDS_ERR_OPEN_READ, source.Cached (), "No such file");
1278 @@ -232,7 +156,7 @@ install_one_source (packagemeta & pkgm,
1281 strcpy (msg, "Installing");
1282 - SetWindowText (ins_action, msg);
1283 + Progress.SetText1 (msg);
1284 log (0, "%s%s", msg, source.Cached ());
1285 io_stream *tmp = io_stream::open (source.Cached (), "rb");
1286 archive *thefile = 0;
1287 @@ -254,7 +178,7 @@ install_one_source (packagemeta & pkgm,
1288 lst->write (concat (fn, "\n", 0), strlen (fn) + 1);
1290 /* FIXME: concat leaks memory */
1291 - SetWindowText (ins_filename, concat (prefix, fn, 0));
1292 + Progress.SetText3 (concat (prefix, fn, 0));
1293 log (LOG_BABBLE, "Installing file %s%s", prefix, fn);
1294 if (archive::extract_file (thefile, prefix) != 0)
1296 @@ -274,7 +198,7 @@ install_one_source (packagemeta & pkgm,
1299 int df = diskfull (get_root_dir ());
1300 - SendMessage (ins_diskfull, PBM_SETPOS, (WPARAM) df, 0);
1301 + Progress.SetBar3 (df);
1305 @@ -289,17 +213,17 @@ install_one (packagemeta & pkg)
1308 if (pkg.desired->binpicked)
1311 - install_one_source (pkg, pkg.desired->bin, "cygfile:///",
1314 - pkg.installed = pkg.desired;
1316 - if (pkg.desired->srcpicked)
1319 - install_one_source (pkg, pkg.desired->src, "cygfile:///usr/src",
1321 + install_one_source (pkg, pkg.desired->bin, "cygfile:///",
1324 + pkg.installed = pkg.desired;
1326 + if (pkg.desired->srcpicked)
1328 + install_one_source (pkg, pkg.desired->src, "cygfile:///usr/src",
1331 /* FIXME: make a upgrade method and reinstate this */
1333 @@ -375,8 +299,8 @@ check_for_old_cygwin ()
1338 -do_install (HINSTANCE h)
1340 +do_install_thread (HINSTANCE h, HWND owner)
1344 @@ -398,15 +322,13 @@ do_install (HINSTANCE h)
1345 io_stream *utmp = io_stream::open ("cygfile:///var/run/utmp", "wb");
1348 - dismiss_url_status_dialog ();
1353 total_bytes_sofar = 0;
1355 int df = diskfull (get_root_dir ());
1356 - SendMessage (ins_diskfull, PBM_SETPOS, (WPARAM) df, 0);
1357 + Progress.SetBar3 (df);
1359 int istext = (root_text == IDC_ROOT_TEXT) ? 1 : 0;
1360 int issystem = (root_scope == IDC_ROOT_SYSTEM) ? 1 : 0;
1361 @@ -419,27 +341,26 @@ do_install (HINSTANCE h)
1363 for (size_t n = 1; n < db.packages.number (); n++)
1365 - packagemeta &pkg = * db.packages[n];
1366 + packagemeta & pkg = *db.packages[n];
1368 - if (pkg.desired && (pkg.desired->srcpicked || pkg.desired->binpicked))
1370 - if (pkg.desired->srcpicked)
1371 - total_bytes += pkg.desired->src.size;
1372 - if (pkg.desired->binpicked)
1373 - total_bytes += pkg.desired->bin.size;
1375 + if (pkg.desired && (pkg.desired->srcpicked || pkg.desired->binpicked))
1377 + if (pkg.desired->srcpicked)
1378 + total_bytes += pkg.desired->src.size;
1379 + if (pkg.desired->binpicked)
1380 + total_bytes += pkg.desired->bin.size;
1384 for (size_t n = 1; n < db.packages.number (); n++)
1386 - packagemeta &pkg = * db.packages[n];
1387 + packagemeta & pkg = *db.packages[n];
1388 if (pkg.installed && (!pkg.desired || pkg.desired != pkg.installed))
1390 uninstall_one (pkg);
1394 - && (pkg.desired->srcpicked || pkg.desired->binpicked))
1395 + if (pkg.desired && (pkg.desired->srcpicked || pkg.desired->binpicked))
1398 e += install_one (pkg);
1399 @@ -450,15 +371,13 @@ do_install (HINSTANCE h)
1401 } // end of big package loop
1403 - ShowWindow (ins_dialog, SW_HIDE);
1406 if ((temperr = db.flush ()))
1408 const char *err = strerror (temperr);
1410 err = "(unknown error)";
1411 - fatal (IDS_ERR_OPEN_WRITE, err);
1412 + fatal (owner, IDS_ERR_OPEN_WRITE, err);
1416 @@ -478,4 +397,29 @@ do_install (HINSTANCE h)
1417 exit_msg = IDS_INSTALL_INCOMPLETE;
1419 exit_msg = IDS_INSTALL_COMPLETE;
1423 +do_install_reflector (void *p)
1426 + context = (HANDLE *) p;
1428 + do_install_thread ((HINSTANCE) context[0], (HWND) context[1]);
1430 + // Tell the progress page that we're done downloading
1431 + Progress.PostMessage (WM_APP_INSTALL_THREAD_COMPLETE, next_dialog);
1436 +static HANDLE context[2];
1439 +do_install (HINSTANCE h, HWND owner)
1442 + context[1] = owner;
1444 + _beginthread (do_install_reflector, 0, context);
1447 ===================================================================
1448 RCS file: /cvs/src/src/winsup/cinstall/localdir.cc,v
1449 retrieving revision 2.5
1450 diff -u -p -r2.5 localdir.cc
1451 --- localdir.cc 2001/11/14 00:11:35 2.5
1452 +++ localdir.cc 2001/12/20 12:36:00
1453 @@ -39,6 +39,8 @@ static const char *cvsid =
1455 #include "io_stream.h"
1457 +#include "localdir.h"
1462 @@ -128,74 +130,20 @@ dialog_cmd (HWND h, int id, HWND hwndctl
1463 case IDC_LOCAL_DIR_BROWSE:
1469 - save_local_dir ();
1470 - if (SetCurrentDirectoryA (local_dir))
1474 - case IDC_SOURCE_DOWNLOAD:
1475 - case IDC_SOURCE_NETINST:
1478 - case IDC_SOURCE_CWD:
1479 - NEXT (IDD_S_FROM_CWD);
1482 - msg ("source is default? %d\n", source);
1488 - note (IDS_ERR_CHDIR, local_dir);
1496 - case IDC_SOURCE_DOWNLOAD:
1497 - NEXT (IDD_SOURCE);
1499 - case IDC_SOURCE_NETINST:
1500 - case IDC_SOURCE_CWD:
1504 - msg ("source is default? %d\n", source);
1516 +//extern char cwd[_MAX_PATH];
1518 -static BOOL CALLBACK
1519 -dialog_proc (HWND h, UINT message, WPARAM wParam, LPARAM lParam)
1521 +LocalDirPage::Create ()
1525 - case WM_INITDIALOG:
1529 - return HANDLE_WM_COMMAND (h, wParam, lParam, dialog_cmd);
1532 + return PropertyPage::Create (NULL, dialog_cmd, IDD_LOCAL_DIR);
1535 -extern char cwd[_MAX_PATH];
1538 -do_local_dir (HINSTANCE h)
1539 +LocalDirPage::OnInit ()
1541 static int inited = 0;
1543 @@ -217,11 +165,43 @@ do_local_dir (HINSTANCE h)
1550 +LocalDirPage::OnActivate ()
1552 + load_dialog (GetHWND ());
1556 - rv = DialogBox (h, MAKEINTRESOURCE (IDD_LOCAL_DIR), 0, dialog_proc);
1558 - fatal (IDS_DIALOG_FAILED);
1560 +LocalDirPage::OnNext ()
1562 + HWND h = GetHWND ();
1565 + save_local_dir ();
1566 log (0, "Selected local directory: %s", local_dir);
1567 + if (SetCurrentDirectoryA (local_dir))
1569 + if (source == IDC_SOURCE_CWD)
1571 + return IDD_S_FROM_CWD;
1575 + note (h, IDS_ERR_CHDIR, local_dir);
1581 +LocalDirPage::OnBack ()
1583 + save_dialog (GetHWND ());
1584 + if (source == IDC_SOURCE_DOWNLOAD)
1586 + // Downloading only, skip the unix root page
1587 + return IDD_SOURCE;
1592 ===================================================================
1593 RCS file: localdir.h
1595 --- /dev/null Tue May 5 13:32:27 1998
1596 +++ localdir.h Thu Dec 20 04:36:00 2001
1598 +#ifndef CINSTALL_LOCALDIR_H
1599 +#define CINSTALL_LOCALDIR_H
1602 + * Copyright (c) 2001, Gary R. Van Sickle.
1604 + * This program is free software; you can redistribute it and/or modify
1605 + * it under the terms of the GNU General Public License as published by
1606 + * the Free Software Foundation; either version 2 of the License, or
1607 + * (at your option) any later version.
1609 + * A copy of the GNU General Public License can be found at
1610 + * http://www.gnu.org/
1612 + * Written by Gary R. Van Sickle <g.r.vansickle@worldnet.att.net>
1616 +// This is the header for the LocalDirPage class. Allows the user to select
1617 +// the local package directory (i.e. where downloaded packages are stored).
1620 +#include "proppage.h"
1622 +class LocalDirPage:public PropertyPage
1628 + virtual ~ LocalDirPage ()
1634 + void OnActivate ();
1643 ===================================================================
1644 RCS file: /cvs/src/src/winsup/cinstall/log.cc,v
1645 retrieving revision 2.5
1646 diff -u -p -r2.5 log.cc
1647 --- log.cc 2001/11/13 01:49:32 2.5
1648 +++ log.cc 2001/12/20 12:36:00
1649 @@ -86,7 +86,7 @@ log_save (int babble, const char *filena
1650 FILE *f = fopen (filename, append ? "at" : "wt");
1653 - fatal (IDS_NOLOGFILE, filename);
1654 + fatal (NULL, IDS_NOLOGFILE, filename);
1658 @@ -115,7 +115,7 @@ exit_setup (int exit_code)
1663 + note (NULL, exit_msg);
1665 log (LOG_TIMESTAMP, "Ending cygwin install");
1668 ===================================================================
1669 RCS file: /cvs/src/src/winsup/cinstall/main.cc,v
1670 retrieving revision 2.9
1671 diff -u -p -r2.9 main.cc
1672 --- main.cc 2001/11/13 01:49:32 2.9
1673 +++ main.cc 2001/12/20 12:36:00
1674 @@ -29,6 +29,7 @@ static const char *cvsid =
1678 +#include <commctrl.h>
1682 @@ -42,7 +43,20 @@ static const char *cvsid =
1683 #include "version.h"
1686 +#include "proppage.h"
1687 +#include "propsheet.h"
1689 +// Page class headers
1690 +#include "splash.h"
1691 +#include "source.h"
1693 +#include "localdir.h"
1696 +#include "choose.h"
1697 +#include "threebar.h"
1698 +#include "desktop.h"
1703 @@ -123,6 +137,12 @@ out:
1707 +extern BOOL CALLBACK
1708 +root_dialog_proc (HWND h, UINT message, WPARAM wParam, LPARAM lParam);
1710 +// Other threads talk to this page, so we need to have it externable.
1711 +ThreeBarProgressPage Progress;
1714 WinMain (HINSTANCE h,
1715 HINSTANCE hPrevInstance, LPSTR command_line, int cmd_show)
1716 @@ -133,6 +153,16 @@ WinMain (HINSTANCE h,
1718 log (LOG_TIMESTAMP, "Starting cygwin install, version %s", version);
1720 + SplashPage Splash;
1721 + SourcePage Source;
1723 + LocalDirPage LocalDir;
1726 + ChooserPage Chooser;
1727 + DesktopSetupPage Desktop;
1728 + PropSheet MainWindow;
1730 char cwd[_MAX_PATH];
1731 GetCurrentDirectory (sizeof (cwd), cwd);
1732 local_dir = strdup (cwd);
1733 @@ -150,58 +180,36 @@ WinMain (HINSTANCE h,
1735 set_default_dacl ();
1737 - while (next_dialog)
1739 - switch (next_dialog)
1747 - case IDD_LOCAL_DIR:
1759 - case IDD_OTHER_URL:
1762 - case IDD_S_LOAD_INI:
1765 - case IDD_S_FROM_CWD:
1771 - case IDD_S_DOWNLOAD:
1774 - case IDD_S_INSTALL:
1780 - case IDD_S_POSTINSTALL:
1781 - do_postinstall (h);
1789 + // Initialize common controls
1790 + InitCommonControls ();
1792 + // Init window class lib
1793 + Window::SetAppInstance (h);
1799 + LocalDir.Create ();
1802 + Chooser.Create ();
1803 + Progress.Create ();
1804 + Desktop.Create ();
1806 + // Add pages to sheet
1807 + MainWindow.AddPage (&Splash);
1808 + MainWindow.AddPage (&Source);
1809 + MainWindow.AddPage (&Root);
1810 + MainWindow.AddPage (&LocalDir);
1811 + MainWindow.AddPage (&Net);
1812 + MainWindow.AddPage (&Site);
1813 + MainWindow.AddPage (&Chooser);
1814 + MainWindow.AddPage (&Progress);
1815 + MainWindow.AddPage (&Desktop);
1817 + // Create the PropSheet main window
1818 + MainWindow.Create ();
1821 /* Keep gcc happy :} */
1823 ===================================================================
1824 RCS file: /cvs/src/src/winsup/cinstall/msg.cc,v
1825 retrieving revision 2.2
1826 diff -u -p -r2.2 msg.cc
1827 --- msg.cc 2001/11/13 01:49:32 2.2
1828 +++ msg.cc 2001/12/20 12:36:00
1829 @@ -38,7 +38,7 @@ msg (const char *fmt, ...)
1833 -mbox (const char *name, int type, int id, va_list args)
1834 +mbox (HWND owner, const char *name, int type, int id, va_list args)
1836 char buf[1000], fmt[1000];
1838 @@ -47,30 +47,30 @@ mbox (const char *name, int type, int id
1840 vsprintf (buf, fmt, args);
1841 log (0, "mbox %s: %s", name, buf);
1842 - return MessageBox (0, buf, "Cygwin Setup", type | MB_TOPMOST);
1843 + return MessageBox (owner, buf, "Cygwin Setup", type /*| MB_TOPMOST */ );
1848 +note (HWND owner, int id, ...)
1851 va_start (args, id);
1852 - mbox ("note", 0, id, args);
1853 + mbox (owner, "note", 0, id, args);
1857 -fatal (int id, ...)
1858 +fatal (HWND owner, int id, ...)
1861 va_start (args, id);
1862 - mbox ("fatal", 0, id, args);
1863 + mbox (owner, "fatal", 0, id, args);
1868 -yesno (int id, ...)
1869 +yesno (HWND owner, int id, ...)
1872 va_start (args, id);
1873 - return mbox ("yesno", MB_YESNO, id, args);
1874 + return mbox (owner, "yesno", MB_YESNO, id, args);
1877 ===================================================================
1878 RCS file: /cvs/src/src/winsup/cinstall/msg.h,v
1879 retrieving revision 2.1
1880 diff -u -p -r2.1 msg.h
1881 --- msg.h 2001/11/13 01:49:32 2.1
1882 +++ msg.h 2001/12/20 12:36:00
1883 @@ -23,11 +23,11 @@ void msg (const char *fmt, ...);
1884 is interpreted like printf. The program exits when the user
1887 -void fatal (int id, ...);
1888 +void fatal (HWND owner, int id, ...);
1890 /* Similar, but the program continues when the user presses OK */
1892 -void note (int id, ...);
1893 +void note (HWND owner, int id, ...);
1895 /* returns IDYES or IDNO, otherwise same as note() */
1896 -int yesno (int id, ...);
1897 +int yesno (HWND owner, int id, ...);
1899 ===================================================================
1900 RCS file: /cvs/src/src/winsup/cinstall/net.cc,v
1901 retrieving revision 2.7
1902 diff -u -p -r2.7 net.cc
1903 --- net.cc 2001/11/13 01:49:32 2.7
1904 +++ net.cc 2001/12/20 12:36:00
1905 @@ -30,6 +30,11 @@ static const char *cvsid =
1911 +#include "threebar.h"
1912 +extern ThreeBarProgressPage Progress;
1914 static int rb[] = { IDC_NET_IE5, IDC_NET_DIRECT, IDC_NET_PROXY, 0 };
1917 @@ -84,71 +89,50 @@ dialog_cmd (HWND h, int id, HWND hwndctl
1919 check_if_enable_next (h);
1926 - case IDC_SOURCE_NETINST:
1927 - case IDC_SOURCE_DOWNLOAD:
1930 - case IDC_SOURCE_CWD:
1934 - msg ("source is default? %d\n", source);
1941 - NEXT (IDD_LOCAL_DIR);
1951 -static BOOL CALLBACK
1952 -dialog_proc (HWND h, UINT message, WPARAM wParam, LPARAM lParam)
1958 - case WM_INITDIALOG:
1961 - // Check to see if any radio buttons are selected. If not, select a default.
1963 - (!SendMessage (GetDlgItem (h, IDC_NET_IE5), BM_GETCHECK, 0, 0) ==
1965 - && (!SendMessage (GetDlgItem (h, IDC_NET_PROXY), BM_GETCHECK, 0, 0)
1968 - SendMessage (GetDlgItem (h, IDC_NET_DIRECT), BM_CLICK, 0, 0);
1972 - return HANDLE_WM_COMMAND (h, wParam, lParam, dialog_cmd);
1975 + return PropertyPage::Create (NULL, dialog_cmd, IDD_NET);
1979 -do_net (HINSTANCE h)
1983 + HWND h = GetHWND ();
1985 net_method = IDC_NET_DIRECT;
1986 - rv = DialogBox (h, MAKEINTRESOURCE (IDD_NET), 0, dialog_proc);
1988 - fatal (IDS_DIALOG_FAILED);
1991 + // Check to see if any radio buttons are selected. If not, select a default.
1992 + if ((!SendMessage (GetDlgItem (IDC_NET_IE5), BM_GETCHECK, 0, 0) ==
1994 + && (!SendMessage (GetDlgItem (IDC_NET_PROXY), BM_GETCHECK, 0, 0)
1997 + SendMessage (GetDlgItem (IDC_NET_DIRECT), BM_CLICK, 0, 0);
2004 + save_dialog (GetHWND ());
2007 (net_method == IDC_NET_IE5) ? "IE5" :
2008 (net_method == IDC_NET_DIRECT) ? "Direct" : "Proxy");
2010 + Progress.SetActivateTask (WM_APP_START_SITE_INFO_DOWNLOAD);
2011 + return IDD_INSTATUS;
2017 + save_dialog (GetHWND ());
2021 ===================================================================
2024 --- /dev/null Tue May 5 13:32:27 1998
2025 +++ net.h Thu Dec 20 04:36:00 2001
2027 +#ifndef CINSTALL_NET_H
2028 +#define CINSTALL_NET_H
2031 + * Copyright (c) 2001, Gary R. Van Sickle.
2033 + * This program is free software; you can redistribute it and/or modify
2034 + * it under the terms of the GNU General Public License as published by
2035 + * the Free Software Foundation; either version 2 of the License, or
2036 + * (at your option) any later version.
2038 + * A copy of the GNU General Public License can be found at
2039 + * http://www.gnu.org/
2041 + * Written by Gary R. Van Sickle <g.r.vansickle@worldnet.att.net>
2045 +// This is the header for the NetPage class. It allows the user to select
2049 +#include "proppage.h"
2051 +class NetPage:public PropertyPage
2057 + virtual ~ NetPage ()
2063 + virtual void OnInit ();
2064 + virtual long OnNext ();
2065 + virtual long OnBack ();
2068 +#endif // CINSTALL_NET_H
2070 ===================================================================
2071 RCS file: /cvs/src/src/winsup/cinstall/netio.cc,v
2072 retrieving revision 2.5
2073 diff -u -p -r2.5 netio.cc
2074 --- netio.cc 2001/12/02 03:25:11 2.5
2075 +++ netio.cc 2001/12/20 12:36:00
2076 @@ -229,29 +229,29 @@ auth_proc (HWND h, UINT message, WPARAM
2080 -auth_common (HINSTANCE h, int id)
2081 +auth_common (HINSTANCE h, int id, HWND owner)
2083 - return DialogBox (h, MAKEINTRESOURCE (id), 0, auth_proc);
2084 + return DialogBox (h, MAKEINTRESOURCE (id), owner, auth_proc);
2089 +NetIO::get_auth (HWND owner)
2092 passwd = &net_passwd;
2093 - return auth_common (hinstance, IDD_NET_AUTH);
2094 + return auth_common (hinstance, IDD_NET_AUTH, owner);
2098 -NetIO::get_proxy_auth ()
2099 +NetIO::get_proxy_auth (HWND owner)
2101 user = &net_proxy_user;
2102 passwd = &net_proxy_passwd;
2103 - return auth_common (hinstance, IDD_PROXY_AUTH);
2104 + return auth_common (hinstance, IDD_PROXY_AUTH, owner);
2108 -NetIO::get_ftp_auth ()
2109 +NetIO::get_ftp_auth (HWND owner)
2113 @@ -267,5 +267,5 @@ NetIO::get_ftp_auth ()
2115 user = &net_ftp_user;
2116 passwd = &net_ftp_passwd;
2117 - return auth_common (hinstance, IDD_FTP_AUTH);
2118 + return auth_common (hinstance, IDD_FTP_AUTH, owner);
2121 ===================================================================
2122 RCS file: /cvs/src/src/winsup/cinstall/netio.h,v
2123 retrieving revision 2.4
2124 diff -u -p -r2.4 netio.h
2125 --- netio.h 2001/12/02 03:25:11 2.4
2126 +++ netio.h 2001/12/20 12:36:00
2127 @@ -50,7 +50,7 @@ public:
2128 /* Helper functions for http/ftp protocols. Both return nonzero for
2129 "cancel", zero for "ok". They set net_proxy_user, etc, in
2132 - int get_proxy_auth ();
2133 - int get_ftp_auth ();
2134 + int get_auth (HWND owner);
2135 + int get_proxy_auth (HWND owner);
2136 + int get_ftp_auth (HWND owner);
2139 ===================================================================
2140 RCS file: /cvs/src/src/winsup/cinstall/nio-file.cc,v
2141 retrieving revision 2.4
2142 diff -u -p -r2.4 nio-file.cc
2143 --- nio-file.cc 2001/12/02 03:25:11 2.4
2144 +++ nio-file.cc 2001/12/20 12:36:00
2145 @@ -45,7 +45,7 @@ NetIO (Purl)
2146 const char *err = strerror (errno);
2148 err = "(unknown error)";
2149 - note (IDS_ERR_OPEN_READ, path, err);
2150 + note (NULL, IDS_ERR_OPEN_READ, path, err);
2155 ===================================================================
2156 RCS file: /cvs/src/src/winsup/cinstall/nio-ftp.cc,v
2157 retrieving revision 2.8
2158 diff -u -p -r2.8 nio-ftp.cc
2159 --- nio-ftp.cc 2001/12/02 03:25:11 2.8
2160 +++ nio-ftp.cc 2001/12/20 12:36:02
2161 @@ -95,7 +95,7 @@ NetIO_FTP::NetIO_FTP (char const *Purl,
2163 if (code == 530) /* Authentication failed, retry */
2166 + get_ftp_auth (NULL);
2167 if (net_ftp_user && net_ftp_passwd)
2171 ===================================================================
2172 RCS file: /cvs/src/src/winsup/cinstall/nio-http.cc,v
2173 retrieving revision 2.9
2174 diff -u -p -r2.9 nio-http.cc
2175 --- nio-http.cc 2001/12/02 03:25:11 2.9
2176 +++ nio-http.cc 2001/12/20 12:36:02
2177 @@ -148,14 +148,14 @@ retry_get:
2179 if (code == 401) /* authorization required */
2187 if (code == 407) /* proxy authorization required */
2189 - get_proxy_auth ();
2190 + get_proxy_auth (NULL);
2194 @@ -163,7 +163,7 @@ retry_get:
2195 if (code == 500 /* ftp authentication through proxy required */
2196 && net_method == IDC_NET_PROXY && !strncmp (url, "ftp://", 6))
2199 + get_ftp_auth (NULL);
2200 if (net_ftp_user && net_ftp_passwd)
2204 ===================================================================
2205 RCS file: /cvs/src/src/winsup/cinstall/nio-ie5.cc,v
2206 retrieving revision 2.4
2207 diff -u -p -r2.4 nio-ie5.cc
2208 --- nio-ie5.cc 2001/12/02 03:25:11 2.4
2209 +++ nio-ie5.cc 2001/12/20 12:36:02
2210 @@ -44,7 +44,7 @@ NetIO (_url)
2211 HINSTANCE h = LoadLibrary ("wininet.dll");
2214 - note (IDS_WININET);
2215 + note (NULL, IDS_WININET);
2219 @@ -112,14 +112,14 @@ try_again:
2220 if (type == 401) /* authorization required */
2228 else if (type == 407) /* proxy authorization required */
2231 - get_proxy_auth ();
2232 + get_proxy_auth (NULL);
2237 ===================================================================
2238 RCS file: /cvs/src/src/winsup/cinstall/other.cc,v
2239 retrieving revision 2.3
2240 diff -u -p -r2.3 other.cc
2241 --- other.cc 2001/12/03 22:22:09 2.3
2242 +++ other.cc 2001/12/20 12:36:02
2243 @@ -103,12 +103,12 @@ dialog_proc (HWND h, UINT message, WPARA
2247 -do_other (HINSTANCE h)
2248 +do_other (HINSTANCE h, HWND owner)
2251 - rv = DialogBox (h, MAKEINTRESOURCE (IDD_OTHER_URL), 0, dialog_proc);
2252 + rv = DialogBox (h, MAKEINTRESOURCE (IDD_OTHER_URL), owner, dialog_proc);
2254 - fatal (IDS_DIALOG_FAILED);
2255 + fatal (owner, IDS_DIALOG_FAILED);
2257 log (0, "site: %s", other_url);
2259 Index: postinstall.cc
2260 ===================================================================
2261 RCS file: /cvs/src/src/winsup/cinstall/postinstall.cc,v
2262 retrieving revision 2.4
2263 diff -u -p -r2.4 postinstall.cc
2264 --- postinstall.cc 2001/11/13 01:49:32 2.4
2265 +++ postinstall.cc 2001/12/20 12:36:02
2266 @@ -98,7 +98,7 @@ static const char *shells[] = {
2270 -do_postinstall (HINSTANCE h)
2271 +do_postinstall (HINSTANCE h, HWND owner)
2276 ===================================================================
2277 RCS file: proppage.cc
2279 --- /dev/null Tue May 5 13:32:27 1998
2280 +++ proppage.cc Thu Dec 20 04:36:02 2001
2283 + * Copyright (c) 2001, Gary R. Van Sickle.
2285 + * This program is free software; you can redistribute it and/or modify
2286 + * it under the terms of the GNU General Public License as published by
2287 + * the Free Software Foundation; either version 2 of the License, or
2288 + * (at your option) any later version.
2290 + * A copy of the GNU General Public License can be found at
2291 + * http://www.gnu.org/
2293 + * Written by Gary R. Van Sickle <g.r.vansickle@worldnet.att.net>
2297 +// This is the implementation of the PropertyPage class. It works closely with the
2298 +// PropSheet class to implement a single page of the property sheet.
2300 +#include "proppage.h"
2301 +#include "propsheet.h"
2305 + PropertyPage::DoOnceForSheet =
2308 +PropertyPage::PropertyPage ()
2316 +PropertyPage::~PropertyPage ()
2321 +PropertyPage::Create (int TemplateID)
2323 + return Create (NULL, NULL, TemplateID);
2327 +PropertyPage::Create (DLGPROC dlgproc, int TemplateID)
2329 + return Create (dlgproc, NULL, TemplateID);
2333 +PropertyPage::Create (DLGPROC dlgproc,
2334 + BOOL (*cproc) (HWND h, int id, HWND hwndctl, UINT code),
2337 + psp.dwSize = sizeof (PROPSHEETPAGE);
2339 + psp.hInstance = GetInstance ();
2340 + psp.pfnDlgProc = FirstDialogProcReflector;
2341 + psp.pszTemplate = (LPCSTR) TemplateID;
2342 + psp.lParam = (LPARAM) this;
2343 + psp.pfnCallback = NULL;
2352 +PropertyPage::FirstDialogProcReflector (HWND hwnd, UINT message,
2353 + WPARAM wParam, LPARAM lParam)
2355 + PropertyPage *This;
2357 + if (message != WM_INITDIALOG)
2359 + // Don't handle anything until we get a WM_INITDIALOG message, which
2360 + // will have our this pointer with it.
2364 + This = (PropertyPage *) (((PROPSHEETPAGE *) lParam)->lParam);
2366 + SetWindowLong (hwnd, DWL_USER, (DWORD) This);
2367 + SetWindowLong (hwnd, DWL_DLGPROC, (DWORD) DialogProcReflector);
2369 + This->SetHWND (hwnd);
2370 + return This->DialogProc (message, wParam, lParam);
2374 +PropertyPage::DialogProcReflector (HWND hwnd, UINT message, WPARAM wParam,
2377 + PropertyPage *This;
2379 + This = (PropertyPage *) GetWindowLong (hwnd, DWL_USER);
2381 + return This->DialogProc (message, wParam, lParam);
2385 +PropertyPage::DialogProc (UINT message, WPARAM wParam, LPARAM lParam)
2389 + proc (GetHWND (), message, wParam, lParam);
2396 + case WM_INITDIALOG:
2399 + // TRUE = Set focus to default control (in wParam).
2404 + switch (((NMHDR FAR *) lParam)->code)
2407 + SetWindowLong (GetHWND (), DWL_MSGRESULT, PSNRET_NOERROR);
2410 + case PSN_SETACTIVE:
2412 + if (DoOnceForSheet)
2414 + // Tell our parent PropSheet what its own HWND is.
2415 + GetOwner ()->SetHWNDFromPage (((NMHDR FAR *) lParam)->
2417 + GetOwner ()->CenterWindow ();
2418 + // Add a minimize box to the parent property sheet. We do this here
2419 + // instead of in the sheet class mainly because it will work with either
2420 + // modal or modeless sheets.
2421 + LONG style =::GetWindowLong (((NMHDR FAR *) lParam)->hwndFrom,
2423 + ::SetWindowLong (((NMHDR FAR *) lParam)->hwndFrom, GWL_STYLE,
2424 + style | WS_MINIMIZEBOX);
2425 + DoOnceForSheet = false;
2428 + // Set the wizard buttons apropriately
2431 + // Disable "Back" on first page.
2432 + GetOwner ()->SetButtons (PSWIZB_NEXT);
2433 + //::PropSheet_SetWizButtons(((NMHDR FAR *) lParam)->hwndFrom, PSWIZB_NEXT);
2437 + // Disable "Next", enable "Finish" on last page
2438 + GetOwner ()->SetButtons (PSWIZB_BACK | PSWIZB_FINISH);
2439 + //::PropSheet_SetWizButtons(((NMHDR FAR *) lParam)->hwndFrom, PSWIZB_BACK | PSWIZB_FINISH);
2443 + // Middle page, enable both "Next" and "Back" buttons
2444 + GetOwner ()->SetButtons (PSWIZB_BACK | PSWIZB_NEXT);
2445 + //::PropSheet_SetWizButtons(((NMHDR FAR *) lParam)->hwndFrom, PSWIZB_BACK | PSWIZB_NEXT);
2450 + // 0 == Accept activation, -1 = Don't accept
2451 + ::SetWindowLong (GetHWND (), DWL_MSGRESULT, 0);
2455 + case PSN_KILLACTIVE:
2457 + // FALSE = Allow deactivation
2458 + SetWindowLong (GetHWND (), DWL_MSGRESULT, FALSE);
2464 + retval = OnNext ();
2465 + SetWindowLong (GetHWND (), DWL_MSGRESULT, retval);
2472 + retval = OnBack ();
2473 + SetWindowLong (GetHWND (), DWL_MSGRESULT, retval);
2477 + case PSN_WIZFINISH:
2478 + retval = OnFinish ();
2479 + // False = Allow the wizard to finish
2480 + SetWindowLong (GetHWND (), DWL_MSGRESULT, FALSE);
2484 + // Unrecognized notification
2490 + if (cmdproc != NULL)
2492 + return HANDLE_WM_COMMAND (GetHWND (), wParam, lParam, cmdproc);
2499 + if ((message >= WM_APP) && (message < 0xC000))
2501 + // It's a private app message
2502 + return OnMessageApp (message, wParam, lParam);
2509 ===================================================================
2510 RCS file: proppage.h
2512 --- /dev/null Tue May 5 13:32:27 1998
2513 +++ proppage.h Thu Dec 20 04:36:02 2001
2515 +#ifndef CINSTALL_PROPPAGE_H
2516 +#define CINSTALL_PROPPAGE_H
2519 + * Copyright (c) 2001, Gary R. Van Sickle.
2521 + * This program is free software; you can redistribute it and/or modify
2522 + * it under the terms of the GNU General Public License as published by
2523 + * the Free Software Foundation; either version 2 of the License, or
2524 + * (at your option) any later version.
2526 + * A copy of the GNU General Public License can be found at
2527 + * http://www.gnu.org/
2529 + * Written by Gary R. Van Sickle <g.r.vansickle@worldnet.att.net>
2533 +// This is the header for the PropertyPage class. It works closely with the
2534 +// PropSheet class to implement a single page of the property sheet.
2537 +#include <windows.h>
2540 +#include "window.h"
2544 +class PropertyPage:public Window
2546 + static bool DoOnceForSheet;
2547 + PROPSHEETPAGE psp;
2549 + BOOL (*cmdproc) (HWND h, int id, HWND hwndctl, UINT code);
2551 + // The sheet that owns this page.
2552 + PropSheet *OurSheet;
2554 + // For setting the back/finish buttons properly.
2555 + bool IsFirst, IsLast;
2557 + static BOOL CALLBACK FirstDialogProcReflector (HWND hwnd, UINT message,
2560 + static BOOL CALLBACK DialogProcReflector (HWND hwnd, UINT message,
2561 + WPARAM wParam, LPARAM lParam);
2564 + virtual BOOL CALLBACK DialogProc (UINT message, WPARAM wParam,
2569 + virtual ~ PropertyPage ();
2571 + PROPSHEETPAGE *GetPROPSHEETPAGEPtr ()
2576 + // FIXME: These should be private and friended to PropSheet.
2577 + void YouAreBeingAddedToASheet (PropSheet * ps)
2581 + void YouAreFirst ()
2586 + void YouAreLast ()
2591 + void YouAreMiddle ()
2597 + virtual bool Create (int TemplateID);
2598 + virtual bool Create (DLGPROC dlgproc, int TemplateID);
2599 + virtual bool Create (DLGPROC dlgproc,
2600 + BOOL (*cmdproc) (HWND h, int id, HWND hwndctl,
2601 + UINT code), int TemplateID);
2603 + virtual void OnInit ()
2606 + virtual void OnActivate ()
2609 + virtual void OnDeactivate ()
2612 + virtual long OnNext ()
2616 + virtual long OnBack ()
2620 + virtual bool OnFinish ()
2625 + PropSheet *GetOwner () const
2631 +#endif // CINSTALL_PROPPAGE_H
2633 ===================================================================
2634 RCS file: propsheet.cc
2635 diff -N propsheet.cc
2636 --- /dev/null Tue May 5 13:32:27 1998
2637 +++ propsheet.cc Thu Dec 20 04:36:03 2001
2640 + * Copyright (c) 2001, Gary R. Van Sickle.
2642 + * This program is free software; you can redistribute it and/or modify
2643 + * it under the terms of the GNU General Public License as published by
2644 + * the Free Software Foundation; either version 2 of the License, or
2645 + * (at your option) any later version.
2647 + * A copy of the GNU General Public License can be found at
2648 + * http://www.gnu.org/
2650 + * Written by Gary R. Van Sickle <g.r.vansickle@worldnet.att.net>
2654 +// This is the implementation of the PropSheet class. This class encapsulates
2655 +// a Windows property sheet / wizard and interfaces with the PropertyPage class.
2656 +// It's named PropSheet instead of PropertySheet because the latter conflicts with
2657 +// the Windows function of the same name.
2659 +#include "propsheet.h"
2660 +#include "proppage.h"
2662 +//#include <shlwapi.h>
2663 +// ...but since there is no shlwapi.h in mingw yet:
2664 +typedef struct _DllVersionInfo
2667 + DWORD dwMajorVersion;
2668 + DWORD dwMinorVersion;
2669 + DWORD dwBuildNumber;
2670 + DWORD dwPlatformID;
2673 +typedef HRESULT CALLBACK (*DLLGETVERSIONPROC) (DLLVERSIONINFO * pdvi);
2674 +#define PROPSHEETHEADER_V1_SIZE 40
2678 +PropSheet::PropSheet ()
2683 +PropSheet::~PropSheet ()
2688 +PropSheet::CreatePages ()
2690 + HPROPSHEETPAGE *retarray;
2692 + // Create the return array
2693 + retarray = new HPROPSHEETPAGE[NumPropPages];
2695 + // Create the pages with CreatePropertySheetPage().
2696 + // We do it here rather than in the PropertyPages themselves
2697 + // because, for reasons known only to Microsoft, these handles will be
2698 + // destroyed by the property sheet before the PropertySheet() call returns,
2699 + // at least if it's modal (don't know about modeless).
2701 + for (i = 0; i < NumPropPages; i++)
2704 + CreatePropertySheetPage (PropertyPages[i]->GetPROPSHEETPAGEPtr ());
2706 + // Set position info
2709 + PropertyPages[i]->YouAreFirst ();
2711 + else if (i == NumPropPages - 1)
2713 + PropertyPages[i]->YouAreLast ();
2717 + PropertyPages[i]->YouAreMiddle ();
2725 +GetPROPSHEETHEADERSize ()
2727 + // For compatibility with all versions of comctl32.dll, we have to do this.
2729 + DLLVERSIONINFO vi;
2731 + DLLGETVERSIONPROC DllGetVersion;
2735 + // This 'isn't safe' in a DLL, according to MSDN
2736 + mod = LoadLibrary ("comctl32.dll");
2738 + DllGetVersion = (DLLGETVERSIONPROC) GetProcAddress (mod, "DllGetVersion");
2739 + if (DllGetVersion == NULL)
2741 + // Something's wildly broken, punt.
2742 + retval = PROPSHEETHEADER_V1_SIZE;
2746 + vi.cbSize = sizeof (DLLVERSIONINFO);
2747 + DllGetVersion (&vi);
2749 + if ((vi.dwMajorVersion < 4) ||
2750 + ((vi.dwMajorVersion == 4) && (vi.dwMinorVersion < 71)))
2753 + retval = sizeof (PROPSHEETHEADER);
2757 + // Old (== Win95/NT4 w/o IE 4 or better)
2758 + retval = PROPSHEETHEADER_V1_SIZE;
2762 + FreeLibrary (mod);
2768 +PropSheet::Create (const Window * Parent, DWORD Style)
2770 + PROPSHEETHEADER p;
2772 + PageHandles = CreatePages ();
2774 + p.dwSize = GetPROPSHEETHEADERSize ();
2775 + p.dwFlags = PSH_NOAPPLYNOW | PSH_WIZARD /*| PSH_MODELESS */ ;
2776 + if (Parent != NULL)
2778 + p.hwndParent = Parent->GetHWND ();
2782 + p.hwndParent = NULL;
2784 + p.hInstance = GetInstance ();
2785 + p.nPages = NumPropPages;
2787 + p.phpage = PageHandles;
2788 + p.pfnCallback = NULL;
2791 + PropertySheet (&p);
2793 + // Do a modeless property sheet...
2794 + //SetHWND((HWND)PropertySheet(&p));
2795 + /*Show(SW_SHOWNORMAL);
2797 + // ...but pretend it's modal
2799 + MessageBox(NULL, "DONE", NULL, MB_OK);
2801 + // FIXME: Enable the parent before destroying this window to prevent another window
2802 + // from becoming the foreground window
2803 + // ala: EnableWindow(<parent_hwnd>, TRUE);
2804 + //DestroyWindow(WindowHandle);
2813 +PropSheet::SetHWNDFromPage (HWND h)
2815 + // If we're a modal dialog, there's no way for us to know our window handle unless
2816 + // one of our pages tells us through this function.
2821 +PropSheet::AddPage (PropertyPage * p)
2823 + // Add a page to the property sheet.
2824 + p->YouAreBeingAddedToASheet (this);
2825 + PropertyPages[NumPropPages] = p;
2830 +PropSheet::SetActivePage (int i)
2832 + // Posts a message to the message queue, so this won't block
2833 + return static_cast < bool > (::PropSheet_SetCurSel (GetHWND (), NULL, i));
2837 +PropSheet::SetActivePageByID (int resource_id)
2839 + // Posts a message to the message queue, so this won't block
2840 + return static_cast < bool >
2841 + (::PropSheet_SetCurSelByID (GetHWND (), resource_id));
2845 +PropSheet::SetButtons (DWORD flags)
2847 + // Posts a message to the message queue, so this won't block
2848 + ::PropSheet_SetWizButtons (GetHWND (), flags);
2852 +PropSheet::PressButton (int button)
2854 + ::PropSheet_PressButton (GetHWND (), button);
2857 ===================================================================
2858 RCS file: propsheet.h
2860 --- /dev/null Tue May 5 13:32:27 1998
2861 +++ propsheet.h Thu Dec 20 04:36:03 2001
2863 +#ifndef CINSTALL_PROPSHEET_H
2864 +#define CINSTALL_PROPSHEET_H
2867 + * Copyright (c) 2001, Gary R. Van Sickle.
2869 + * This program is free software; you can redistribute it and/or modify
2870 + * it under the terms of the GNU General Public License as published by
2871 + * the Free Software Foundation; either version 2 of the License, or
2872 + * (at your option) any later version.
2874 + * A copy of the GNU General Public License can be found at
2875 + * http://www.gnu.org/
2877 + * Written by Gary R. Van Sickle <g.r.vansickle@worldnet.att.net>
2881 +// This is the header for the PropSheet class. This class encapsulates
2882 +// a Windows property sheet / wizard and interfaces with the PropertyPage class.
2883 +// It's named PropSheet instead of PropertySheet because the latter conflicts with
2884 +// the Windows function of the same name.
2887 +#include <windows.h>
2890 +#include "window.h"
2892 +class PropertyPage;
2894 +class PropSheet:public Window
2896 + PropertyPage *PropertyPages[MAXPROPPAGES];
2899 + HPROPSHEETPAGE *PageHandles;
2900 + HPROPSHEETPAGE *CreatePages ();
2904 + virtual ~ PropSheet ();
2906 + // Should be private and friended to PropertyPage
2907 + void SetHWNDFromPage (HWND h);
2909 + virtual bool Create (const Window * Parent = NULL,
2911 + WS_OVERLAPPEDWINDOW | WS_VISIBLE | WS_CLIPCHILDREN);
2913 + void AddPage (PropertyPage * p);
2915 + bool SetActivePage (int i);
2916 + bool SetActivePageByID (int resource_id);
2917 + void SetButtons (DWORD flags);
2918 + void PressButton (int button);
2921 +#endif // CINSTALL_PROPSHEET_H
2923 ===================================================================
2924 RCS file: /cvs/src/src/winsup/cinstall/res.rc,v
2925 retrieving revision 2.31
2926 diff -u -p -r2.31 res.rc
2927 --- res.rc 2001/12/03 22:22:09 2.31
2928 +++ res.rc 2001/12/20 12:36:03
2929 @@ -29,7 +29,7 @@ LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_U
2932 IDD_SOURCE DIALOG DISCARDABLE 0, 0, 215, 95
2933 -STYLE DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU
2934 +STYLE DS_MODALFRAME | DS_CENTER | WS_CHILD | WS_CAPTION | WS_SYSMENU
2935 CAPTION "Cygwin Setup"
2936 FONT 8, "MS Sans Serif"
2938 @@ -40,26 +40,21 @@ BEGIN
2939 BS_AUTORADIOBUTTON,55,30,89,10
2940 CONTROL "Install from &Local Directory",IDC_SOURCE_CWD,"Button",
2941 BS_AUTORADIOBUTTON,55,45,99,10
2942 - DEFPUSHBUTTON "&Next -->",IDOK,100,75,45,15
2943 - PUSHBUTTON "Cancel",IDCANCEL,165,75,45,15
2946 -IDD_LOCAL_DIR DIALOG DISCARDABLE 0, 0, 215, 95
2947 -STYLE DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU
2948 +IDD_LOCAL_DIR DIALOG DISCARDABLE 0, 0, 227, 94
2949 +STYLE DS_MODALFRAME | DS_CENTER | WS_CHILD | WS_CAPTION | WS_SYSMENU
2950 CAPTION "Cygwin Setup"
2951 FONT 8, "MS Sans Serif"
2953 ICON IDI_CYGWIN,IDC_STATIC,5,5,20,20
2954 - PUSHBUTTON "B&rowse...",IDC_LOCAL_DIR_BROWSE,150,10,34,14
2955 + PUSHBUTTON "B&rowse...",IDC_LOCAL_DIR_BROWSE,185,30,34,14
2956 LTEXT "Local Package &Directory",IDC_STATIC,55,15,85,11
2957 - EDITTEXT IDC_LOCAL_DIR,55,25,127,12,ES_AUTOHSCROLL
2958 - DEFPUSHBUTTON "&Next -->",IDOK,100,75,45,15
2959 - PUSHBUTTON "Cancel",IDCANCEL,165,75,45,15
2960 - PUSHBUTTON "<-- &Back",IDC_BACK,55,75,45,15
2961 + EDITTEXT IDC_LOCAL_DIR,55,30,127,15,ES_AUTOHSCROLL
2964 IDD_ROOT DIALOG DISCARDABLE 0, 0, 215, 95
2965 -STYLE DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU
2966 +STYLE DS_MODALFRAME | DS_CENTER | WS_CHILD | WS_CAPTION | WS_SYSMENU
2967 CAPTION "Cygwin Setup"
2968 FONT 8, "MS Sans Serif"
2970 @@ -77,23 +72,17 @@ BEGIN
2971 WS_GROUP,125,60,25,8
2972 CONTROL "Just &Me",IDC_ROOT_USER,"Button",BS_AUTORADIOBUTTON,160,
2974 - DEFPUSHBUTTON "&Next -->",IDOK,100,75,45,15
2975 - PUSHBUTTON "Cancel",IDCANCEL,165,75,45,15
2976 - PUSHBUTTON "<-- &Back",IDC_BACK,55,75,45,15
2979 -IDD_SITE DIALOG DISCARDABLE 0, 0, 222, 206
2980 -STYLE DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU
2981 +IDD_SITE DIALOG DISCARDABLE 0, 0, 247, 94
2982 +STYLE DS_MODALFRAME | DS_CENTER | WS_CHILD | WS_CAPTION | WS_SYSMENU
2983 CAPTION "Cygwin Setup"
2984 FONT 8, "MS Sans Serif"
2986 ICON IDI_CYGWIN,IDC_STATIC,5,5,20,20
2987 - LTEXT "Select Download &Sites",IDC_STATIC,55,5,135,11
2988 - LISTBOX IDC_URL_LIST,55,20,160,155,LBS_NOINTEGRALHEIGHT |
2989 - LBS_EXTENDEDSEL | WS_VSCROLL | WS_HSCROLL | WS_TABSTOP
2990 - DEFPUSHBUTTON "&Next -->",IDOK,105,185,45,15
2991 - PUSHBUTTON "Cancel",IDCANCEL,170,185,45,15
2992 - PUSHBUTTON "<-- &Back",IDC_BACK,60,185,45,15
2993 + LTEXT "Select Download &Site",IDC_STATIC,55,5,135,11
2994 + LISTBOX IDC_URL_LIST,55,20,185,65,LBS_NOINTEGRALHEIGHT |
2995 + LBS_EXTENDEDSEL | WS_VSCROLL | WS_HSCROLL | WS_TABSTOP
2998 IDD_OTHER_URL DIALOG DISCARDABLE 0, 0, 215, 95
2999 @@ -109,32 +98,31 @@ BEGIN
3000 PUSHBUTTON "<-- &Back",IDC_BACK,55,75,45,15
3003 -IDD_NET DIALOGEX 0, 0, 215, 95
3004 -STYLE DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU
3005 +IDD_NET DIALOG DISCARDABLE 0, 0, 247, 106
3006 +STYLE DS_MODALFRAME | DS_CENTER | WS_CHILD | WS_CAPTION | WS_SYSMENU
3007 CAPTION "Cygwin Setup"
3008 FONT 8, "MS Sans Serif"
3010 - ICON IDI_CYGWIN,IDC_STATIC,5,5,20,20
3011 CONTROL "&Direct Connection",IDC_NET_DIRECT,"Button",
3012 - BS_AUTORADIOBUTTON,55,10,73,10
3013 + BS_AUTORADIOBUTTON | WS_GROUP | WS_TABSTOP,55,10,73,10
3014 CONTROL "Use &IE5 Settings",IDC_NET_IE5,"Button",
3015 - BS_AUTORADIOBUTTON,55,25,69,10
3016 + BS_AUTORADIOBUTTON | WS_TABSTOP,55,25,69,10
3017 CONTROL "Use HTTP/FTP &Proxy:",IDC_NET_PROXY,"Button",
3018 - BS_AUTORADIOBUTTON,55,40,88,10
3019 - LTEXT "Proxy &Host",IDC_STATIC,10,55,50,15,SS_CENTERIMAGE,
3021 - EDITTEXT IDC_PROXY_HOST,65,55,80,12,ES_AUTOHSCROLL | WS_DISABLED
3022 - LTEXT "Por&t",IDC_STATIC,155,55,20,15,SS_CENTERIMAGE,
3024 - EDITTEXT IDC_PROXY_PORT,180,55,30,12,ES_AUTOHSCROLL | WS_DISABLED
3025 - DEFPUSHBUTTON "&Next -->",IDOK,100,75,45,15
3026 - PUSHBUTTON "Cancel",IDCANCEL,165,75,45,15
3027 - PUSHBUTTON "<-- &Back",IDC_BACK,55,75,45,15
3028 + BS_AUTORADIOBUTTON | WS_TABSTOP,55,40,88,10
3029 + EDITTEXT IDC_PROXY_HOST,115,60,120,12,ES_AUTOHSCROLL |
3030 + WS_DISABLED | WS_GROUP
3031 + EDITTEXT IDC_PROXY_PORT,115,80,30,12,ES_AUTOHSCROLL | WS_DISABLED
3032 + GROUPBOX "",IDC_STATIC,55,50,185,50
3033 + ICON IDI_CYGWIN,IDC_STATIC,5,5,21,20
3034 + RTEXT "Proxy &Host",IDC_STATIC,60,60,50,12,SS_CENTERIMAGE |
3036 + RTEXT "Por&t",IDC_STATIC,80,80,30,12,SS_CENTERIMAGE | NOT
3040 IDD_DLSTATUS DIALOG DISCARDABLE 0, 0, 215, 95
3041 -STYLE DS_MODALFRAME | DS_SETFOREGROUND | DS_CENTER | WS_POPUP | WS_VISIBLE |
3042 - WS_CAPTION | WS_SYSMENU
3043 +STYLE DS_MODALFRAME | DS_CENTER | WS_CHILD | WS_VISIBLE | WS_CAPTION |
3045 CAPTION "Cygwin Setup"
3046 FONT 8, "MS Sans Serif"
3048 @@ -154,26 +142,25 @@ BEGIN
3049 RTEXT "Disk",IDC_DLS_IPROGRESS_TEXT,5,60,45,8
3052 -IDD_INSTATUS DIALOG DISCARDABLE 0, 0, 215, 95
3053 -STYLE DS_MODALFRAME | DS_SETFOREGROUND | DS_CENTER | WS_POPUP | WS_VISIBLE |
3054 - WS_CAPTION | WS_SYSMENU
3055 +IDD_INSTATUS DIALOG DISCARDABLE 0, 0, 252, 94
3056 +STYLE DS_MODALFRAME | DS_CENTER | WS_CHILD | WS_VISIBLE | WS_CAPTION |
3058 CAPTION "Cygwin Setup"
3059 FONT 8, "MS Sans Serif"
3061 - ICON IDI_CYGWIN,IDC_STATIC,5,5,20,20
3062 - PUSHBUTTON "Cancel",IDCANCEL,165,75,45,15
3063 + ICON IDI_CYGWIN,IDC_STATIC,5,5,21,20
3064 LTEXT "Installing...",IDC_INS_ACTION,55,5,135,8
3065 LTEXT "(PKG)",IDC_INS_PKG,55,15,150,8
3066 LTEXT "(FILE)",IDC_INS_FILE,55,25,155,8
3067 CONTROL "Progress1",IDC_INS_DISKFULL,"msctls_progress32",
3068 - PBS_SMOOTH | WS_BORDER,55,60,155,10
3069 + PBS_SMOOTH | WS_BORDER,90,60,155,10
3070 CONTROL "Progress1",IDC_INS_IPROGRESS,"msctls_progress32",
3071 - PBS_SMOOTH | WS_BORDER,55,50,155,10
3072 + PBS_SMOOTH | WS_BORDER,90,50,155,10
3073 CONTROL "Progress1",IDC_INS_PPROGRESS,"msctls_progress32",
3074 - PBS_SMOOTH | WS_BORDER,55,40,155,10
3075 - RTEXT "Package",IDC_STATIC,5,40,45,8
3076 - RTEXT "Total",IDC_STATIC,10,50,40,8
3077 - RTEXT "Disk",IDC_STATIC,5,60,45,8
3078 + PBS_SMOOTH | WS_BORDER,90,40,155,10
3079 + RTEXT "Package",IDC_INS_BL_PACKAGE,40,40,45,8
3080 + RTEXT "Total",IDC_INS_BL_TOTAL,45,50,40,8
3081 + RTEXT "Disk",IDC_INS_BL_DISK,40,60,45,8
3084 IDD_PROXY_AUTH DIALOG DISCARDABLE 0, 0, 215, 95
3085 @@ -210,8 +197,9 @@ BEGIN
3086 PUSHBUTTON "Cancel",IDCANCEL,165,75,45,15
3089 -IDD_SPLASH DIALOG DISCARDABLE 0, 0, 215, 95
3090 -STYLE DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU
3091 +IDD_SPLASH DIALOG DISCARDABLE 0, 0, 216, 94
3092 +STYLE DS_MODALFRAME | DS_3DLOOK | DS_CENTER | WS_CHILD | WS_VISIBLE |
3093 + WS_CAPTION | WS_SYSMENU
3094 CAPTION "Cygwin Setup"
3095 FONT 8, "MS Sans Serif"
3097 @@ -223,17 +211,26 @@ BEGIN
3099 LTEXT "http://sources.redhat.com/cygwin/",IDC_STATIC,55,50,112,
3101 - DEFPUSHBUTTON "&Next -->",IDOK,100,75,45,15
3102 - PUSHBUTTON "Cancel",IDCANCEL,165,75,45,15
3105 -IDD_CHOOSE DIALOG DISCARDABLE 0, 0, 429, 266
3106 -STYLE DS_MODALFRAME | DS_3DLOOK | DS_CENTER | WS_POPUP | WS_CAPTION |
3108 +IDD_CHOOSE DIALOGEX 0, 0, 430, 266
3109 +STYLE DS_MODALFRAME | DS_3DLOOK | DS_CENTER | WS_CHILD | WS_VISIBLE |
3110 + WS_CAPTION | WS_SYSMENU
3111 +EXSTYLE WS_EX_CONTROLPARENT
3112 CAPTION "Cygwin Setup"
3113 FONT 8, "MS Sans Serif"
3115 - ICON IDI_CYGWIN,IDC_STATIC,0,2,21,20
3116 + DEFPUSHBUTTON "&Next -->",IDOK,311,242,45,15,WS_GROUP
3117 + PUSHBUTTON "Cancel",IDCANCEL,375,242,45,15
3118 + PUSHBUTTON "<-- &Back",IDC_BACK,266,242,45,15
3119 + CONTROL "&Prev",IDC_CHOOSE_PREV,"Button",BS_AUTORADIOBUTTON |
3120 + WS_GROUP | WS_TABSTOP,265,5,27,10
3121 + CONTROL "&Curr",IDC_CHOOSE_CURR,"Button",BS_AUTORADIOBUTTON,297,
3123 + CONTROL "E&xp",IDC_CHOOSE_EXP,"Button",BS_AUTORADIOBUTTON,323,5,
3125 + PUSHBUTTON "&View",IDC_CHOOSE_VIEW,353,5,20,10,WS_GROUP
3126 + ICON IDI_CYGWIN,IDC_STATIC,0,2,20,20
3127 LTEXT "Select packages to install",IDC_CHOOSE_INST_TEXT,125,5,
3129 CONTROL "",IDC_LISTVIEW_POS,"Static",SS_BLACKFRAME | NOT
3130 @@ -241,21 +238,12 @@ BEGIN
3131 CONTROL "SPIN",IDC_STATIC,"Static",SS_BITMAP,22,235,15,13
3132 LTEXT "= click to choose action, (p) = previous version, (x) = experimental",
3133 IDC_STATIC,35,234,220,8
3134 - PUSHBUTTON "&View",IDC_CHOOSE_VIEW,353,5,20,10
3135 LTEXT "",IDC_CHOOSE_VIEWCAPTION,390,5,30,10
3136 - CONTROL "E&xp",IDC_CHOOSE_EXP,"Button",BS_AUTORADIOBUTTON |
3137 - WS_GROUP,323,5,25,10
3138 - CONTROL "&Prev",IDC_CHOOSE_PREV,"Button",BS_AUTORADIOBUTTON,265,
3140 - CONTROL "&Curr",IDC_CHOOSE_CURR,"Button",BS_AUTORADIOBUTTON,297,
3142 - DEFPUSHBUTTON "&Next -->",IDOK,311,242,45,15
3143 - PUSHBUTTON "Cancel",IDCANCEL,375,242,45,15
3144 - PUSHBUTTON "<-- &Back",IDC_BACK,266,242,45,15
3147 IDD_DESKTOP DIALOG DISCARDABLE 0, 0, 215, 95
3148 -STYLE DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU
3149 +STYLE DS_MODALFRAME | DS_3DLOOK | DS_CENTER | WS_CHILD | WS_VISIBLE |
3150 + WS_CAPTION | WS_SYSMENU
3151 CAPTION "Cygwin Setup"
3152 FONT 8, "MS Sans Serif"
3154 @@ -264,12 +252,9 @@ BEGIN
3155 BS_AUTOCHECKBOX,55,25,100,8
3156 CONTROL "Add to &Start Menu",IDC_ROOT_MENU,"Button",
3157 BS_AUTOCHECKBOX,55,40,100,8
3158 - DEFPUSHBUTTON "&Next -->",IDOK,100,75,45,15
3159 - PUSHBUTTON "Cancel",IDCANCEL,165,75,45,15
3160 - PUSHBUTTON "<-- &Back",IDC_BACK,55,75,45,15
3163 -IDD_FTP_AUTH DIALOGEX 0, 0, 215, 95
3164 +IDD_FTP_AUTH DIALOG DISCARDABLE 0, 0, 215, 95
3165 STYLE DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU
3166 CAPTION "Cygwin Setup"
3167 FONT 8, "MS Sans Serif"
3168 @@ -286,7 +271,16 @@ BEGIN
3169 PUSHBUTTON "Cancel",IDCANCEL,165,75,45,15
3172 +IDD_CHOOSER DIALOG DISCARDABLE 0, 0, 186, 90
3173 +STYLE DS_MODALFRAME | DS_3DLOOK | WS_CHILD | WS_VISIBLE | WS_CAPTION |
3175 +CAPTION "Cygwin Setup"
3176 +FONT 8, "MS Sans Serif"
3178 + LTEXT "Don't look here",IDC_STATIC,25,38,134,8
3182 #ifdef APSTUDIO_INVOKED
3183 /////////////////////////////////////////////////////////////////////////////
3185 @@ -339,9 +333,21 @@ CYGWIN.ICON FILE DISCARDA
3186 #ifdef APSTUDIO_INVOKED
3187 GUIDELINES DESIGNINFO DISCARDABLE
3189 + IDD_LOCAL_DIR, DIALOG
3207 IDD_PROXY_AUTH, DIALOG
3208 @@ -354,10 +360,23 @@ BEGIN
3212 + IDD_CHOOSE, DIALOG
3217 IDD_FTP_AUTH, DIALOG
3222 + IDD_CHOOSER, DIALOG
3230 #endif // APSTUDIO_INVOKED
3232 @@ -409,6 +428,7 @@ BEGIN
3233 IDS_DOWNLOAD_FAILED "Unable to download %s"
3234 IDS_DOWNLOAD_INCOMPLETE "Download Incomplete. Try again?"
3235 IDS_INSTALL_INCOMPLETE "Installation incomplete. Check /setup.log.full for details"
3236 + IDS_VERSION_INFO "Setup.exe version %1"
3239 #endif // English (U.S.) resources
3241 ===================================================================
3242 RCS file: /cvs/src/src/winsup/cinstall/resource.h,v
3243 retrieving revision 2.13
3244 diff -u -p -r2.13 resource.h
3245 --- resource.h 2001/12/20 11:49:54 2.13
3246 +++ resource.h 2001/12/20 12:36:03
3248 #define IDS_DOWNLOAD_FAILED 25
3249 #define IDS_DOWNLOAD_INCOMPLETE 26
3250 #define IDS_INSTALL_INCOMPLETE 27
3251 +#define IDS_VERSION_INFO 28
3252 #define IDD_ROOT 101
3253 #define IDD_SOURCE 102
3254 #define IDD_OTHER_URL 103
3256 #define IDB_CHECK_NO 124
3257 #define IDB_CHECK_NA 125
3258 #define IDD_FTP_AUTH 126
3259 +#define IDD_CHOOSER 127
3260 #define IDC_SOURCE_DOWNLOAD 1000
3261 #define IDC_SOURCE_NETINST 1001
3262 #define IDC_SOURCE_CWD 1002
3264 #define IDC_DLS_PROGRESS_TEXT 1047
3265 #define IDC_DLS_PPROGRESS_TEXT 1048
3266 #define IDC_DLS_IPROGRESS_TEXT 1049
3267 -#define IDC_CHOOSE_INST_TEXT 1050
3268 +#define IDC_CHOOSE_INST_TEXT 1050
3269 #define IDC_CHOOSE_VIEWCAPTION 1051
3270 #define IDC_CHOOSE_LISTHEADER 1052
3271 +#define IDC_INS_BL_PACKAGE 1053
3272 +#define IDC_INS_BL_TOTAL 1054
3273 +#define IDC_INS_BL_DISK 1055
3274 #define IDC_STATIC -1
3276 // Next default values for new objects
3278 #ifndef APSTUDIO_READONLY_SYMBOLS
3279 #define _APS_NO_MFC 1
3280 #define _APS_3D_CONTROLS 1
3281 -#define _APS_NEXT_RESOURCE_VALUE 127
3282 +#define _APS_NEXT_RESOURCE_VALUE 128
3283 #define _APS_NEXT_COMMAND_VALUE 40003
3284 -#define _APS_NEXT_CONTROL_VALUE 1053
3285 +#define _APS_NEXT_CONTROL_VALUE 1056
3286 #define _APS_NEXT_SYMED_VALUE 101
3290 ===================================================================
3291 RCS file: /cvs/src/src/winsup/cinstall/root.cc,v
3292 retrieving revision 2.7
3293 diff -u -p -r2.7 root.cc
3294 --- root.cc 2001/11/13 01:49:32 2.7
3295 +++ root.cc 2001/12/20 12:36:03
3296 @@ -35,6 +35,7 @@ static const char *cvsid =
3302 static int rb[] = { IDC_ROOT_TEXT, IDC_ROOT_BINARY, 0 };
3303 static int su[] = { IDC_ROOT_SYSTEM, IDC_ROOT_USER, 0 };
3304 @@ -143,64 +144,56 @@ dialog_cmd (HWND h, int id, HWND hwndctl
3305 case IDC_ROOT_BROWSE:
3312 - if (!directory_is_absolute ())
3314 - note (IDS_ROOT_ABSOLUTE);
3318 - if (directory_is_rootdir ())
3319 - if (IDNO == yesno (IDS_ROOT_SLASH))
3322 - if (directory_has_spaces ())
3323 - if (IDNO == yesno (IDS_ROOT_SPACE))
3326 - NEXT (IDD_LOCAL_DIR);
3331 - NEXT (IDD_SOURCE);
3341 -static BOOL CALLBACK
3342 -dialog_proc (HWND h, UINT message, WPARAM wParam, LPARAM lParam)
3344 +RootPage::Create ()
3348 - case WM_INITDIALOG:
3352 - return HANDLE_WM_COMMAND (h, wParam, lParam, dialog_cmd);
3355 + return PropertyPage::Create (NULL, dialog_cmd, IDD_ROOT);
3359 -do_root (HINSTANCE h)
3360 +RootPage::OnInit ()
3363 if (!get_root_dir ())
3365 - rv = DialogBox (h, MAKEINTRESOURCE (IDD_ROOT), 0, dialog_proc);
3367 - fatal (IDS_DIALOG_FAILED);
3368 + load_dialog (GetHWND ());
3372 +RootPage::OnNext ()
3374 + HWND h = GetHWND ();
3378 + if (!directory_is_absolute ())
3380 + note (h, IDS_ROOT_ABSOLUTE);
3383 + else if (directory_is_rootdir () && (IDNO == yesno (h, IDS_ROOT_SLASH)))
3385 + else if (directory_has_spaces () && (IDNO == yesno (h, IDS_ROOT_SPACE)))
3388 + NEXT (IDD_LOCAL_DIR);
3390 log (0, "root: %s %s %s", get_root_dir (),
3391 (root_text == IDC_ROOT_TEXT) ? "text" : "binary",
3392 (root_scope == IDC_ROOT_USER) ? "user" : "system");
3398 +RootPage::OnBack ()
3400 + HWND h = GetHWND ();
3403 + NEXT (IDD_SOURCE);
3407 ===================================================================
3410 --- /dev/null Tue May 5 13:32:27 1998
3411 +++ root.h Thu Dec 20 04:36:03 2001
3413 +#ifndef CINSTALL_ROOT_H
3414 +#define CINSTALL_ROOT_H
3416 +#include "proppage.h"
3418 +class RootPage:public PropertyPage
3424 + virtual ~ RootPage ()
3431 + virtual long OnNext ();
3432 + virtual long OnBack ();
3435 +#endif // CINSTALL_ROOT_H
3437 ===================================================================
3438 RCS file: /cvs/src/src/winsup/cinstall/site.cc,v
3439 retrieving revision 2.10
3440 diff -u -p -r2.10 site.cc
3441 --- site.cc 2001/12/03 22:22:09 2.10
3442 +++ site.cc 2001/12/20 12:36:03
3443 @@ -25,6 +25,7 @@ static const char *cvsid =
3447 +#include <process.h>
3450 #include "resource.h"
3451 @@ -38,6 +39,12 @@ static const char *cvsid =
3456 +#include "propsheet.h"
3458 +#include "threebar.h"
3459 +extern ThreeBarProgressPage Progress;
3462 #define OTHER_IDX (-2)
3464 @@ -101,7 +108,12 @@ load_dialog (HWND h)
3465 int index = SendMessage (listbox, LB_FINDSTRING, (WPARAM) - 1,
3466 (LPARAM) site_list[n]->displayed_url);
3467 if (index != LB_ERR)
3468 - SendMessage (listbox, LB_SELITEMRANGE, TRUE, (index << 16) | index);
3470 + // Highlight the selected item
3471 + SendMessage (listbox, LB_SELITEMRANGE, TRUE, (index << 16) | index);
3472 + // Make sure it's fully visible
3473 + SendMessage (listbox, LB_SETCARETINDEX, index, FALSE);
3476 check_if_enable_next (h);
3478 @@ -167,63 +179,18 @@ dialog_cmd (HWND h, int id, HWND hwndctl
3480 check_if_enable_next (h);
3485 - if (mirror_idx == OTHER_IDX)
3486 - NEXT (IDD_OTHER_URL);
3490 - NEXT (IDD_S_LOAD_INI);
3506 -static BOOL CALLBACK
3507 -dialog_proc (HWND h, UINT message, WPARAM wParam, LPARAM lParam)
3513 - case WM_INITDIALOG:
3514 - listbox = GetDlgItem (h, IDC_URL_LIST);
3515 - for (size_t i = 1; i <= all_site_list.number (); i++)
3518 - SendMessage (listbox, LB_ADDSTRING, 0,
3519 - (LPARAM) all_site_list[i]->displayed_url);
3520 - SendMessage (listbox, LB_SETITEMDATA, j, i);
3522 - j = SendMessage (listbox, LB_ADDSTRING, 0, (LPARAM) "Other URL");
3523 - SendMessage (listbox, LB_SETITEMDATA, j, OTHER_IDX);
3527 - return HANDLE_WM_COMMAND (h, wParam, lParam, dialog_cmd);
3533 -get_site_list (HINSTANCE h)
3534 +get_site_list (HINSTANCE h, HWND owner)
3536 char mirror_url[1000];
3538 if (LoadString (h, IDS_MIRROR_LST, mirror_url, sizeof (mirror_url)) <= 0)
3540 - char *mirrors = get_url_to_string (mirror_url);
3541 + char *mirrors = get_url_to_string (mirror_url, owner);
3542 dismiss_url_status_dialog ();
3545 @@ -320,24 +287,106 @@ get_saved_sites ()
3550 -do_site (HINSTANCE h)
3552 +do_download_site_info_thread (void *p)
3558 + context = (HANDLE *) p;
3560 + hinst = (HINSTANCE) (context[0]);
3561 + h = (HWND) (context[1]);
3563 if (all_site_list.number () == 0)
3564 - if (get_site_list (h))
3570 + if (get_site_list (hinst, h))
3572 + // Error: Couldn't download the site info. Go back to the Net setup page.
3578 + // Everything worked, go to the site select page
3581 + // Tell the progress page that we're done downloading
3582 + Progress.PostMessage (WM_APP_SITE_INFO_DOWNLOAD_COMPLETE, 0, next_dialog);
3587 +static HANDLE context[2];
3590 +do_download_site_info (HINSTANCE hinst, HWND owner)
3593 + context[0] = hinst;
3594 + context[1] = owner;
3596 + _beginthread (do_download_site_info_thread, 0, context);
3601 +SitePage::Create ()
3603 + return PropertyPage::Create (NULL, dialog_cmd, IDD_SITE);
3607 +SitePage::OnInit ()
3609 + HWND h = GetHWND ();
3615 + listbox = GetDlgItem (IDC_URL_LIST);
3616 + for (size_t i = 1; i <= all_site_list.number (); i++)
3619 + SendMessage (listbox, LB_ADDSTRING, 0,
3620 + (LPARAM) all_site_list[i]->displayed_url);
3621 + SendMessage (listbox, LB_SETITEMDATA, j, i);
3623 + j = SendMessage (listbox, LB_ADDSTRING, 0, (LPARAM) "Other URL");
3624 + SendMessage (listbox, LB_SETITEMDATA, j, OTHER_IDX);
3628 - rv = DialogBox (h, MAKEINTRESOURCE (IDD_SITE), 0, dialog_proc);
3630 - fatal (IDS_DIALOG_FAILED);
3632 +SitePage::OnNext ()
3634 + HWND h = GetHWND ();
3636 - for (size_t n = 1; n <= site_list.number (); n++)
3637 - log (0, "site: %s", site_list[n]->url);
3639 + if (mirror_idx == OTHER_IDX)
3640 + NEXT (IDD_OTHER_URL);
3644 + NEXT (IDD_S_LOAD_INI);
3646 + for (size_t n = 1; n <= site_list.number (); n++)
3647 + log (0, "site: %s", site_list[n]->url);
3649 + Progress.SetActivateTask (WM_APP_START_SETUP_INI_DOWNLOAD);
3650 + return IDD_INSTATUS;
3657 +SitePage::OnBack ()
3659 + HWND h = GetHWND ();
3666 ===================================================================
3667 RCS file: /cvs/src/src/winsup/cinstall/site.h,v
3668 retrieving revision 2.1
3669 diff -u -p -r2.1 site.h
3670 --- site.h 2001/12/03 22:22:09 2.1
3671 +++ site.h 2001/12/20 12:36:03
3675 /* required to parse this file */
3676 -#include <strings.h>
3677 +#include <string.h>
3678 +#include <stdlib.h>
3681 +#include "proppage.h"
3683 +class SitePage:public PropertyPage
3689 + virtual ~ SitePage ()
3700 +void do_download_site_info (HINSTANCE h, HWND owner);
3702 class site_list_type
3705 - site_list_type () : url(0), displayed_url (0), key (0) {};
3706 + site_list_type ():url (0), displayed_url (0), key (0)
3709 site_list_type (char const *);
3710 /* workaround for missing placement new in gcc 2.95 */
3711 void init (char const *);
3712 - ~site_list_type ()
3713 + ~site_list_type ()
3717 @@ -42,9 +66,9 @@ public:
3720 /* user chosen sites */
3721 -extern list <site_list_type, const char *, strcasecmp> site_list;
3722 +extern list < site_list_type, const char *, strcasecmp > site_list;
3723 /* potential sites */
3724 -extern list <site_list_type, const char *, strcasecmp> all_site_list;
3725 +extern list < site_list_type, const char *, strcasecmp > all_site_list;
3727 void save_site_url ();
3730 ===================================================================
3731 RCS file: /cvs/src/src/winsup/cinstall/source.cc,v
3732 retrieving revision 2.9
3733 diff -u -p -r2.9 source.cc
3734 --- source.cc 2001/12/20 11:49:54 2.9
3735 +++ source.cc 2001/12/20 12:36:03
3736 @@ -31,6 +31,8 @@ static const char *cvsid =
3738 #include "package_db.h"
3740 +#include "source.h"
3743 { IDC_SOURCE_NETINST, IDC_SOURCE_DOWNLOAD, IDC_SOURCE_CWD, 0 };
3745 @@ -45,7 +47,8 @@ save_dialog (HWND h)
3747 source = rbget (h, rb);
3749 - db.task = source == IDC_SOURCE_DOWNLOAD ? PackageDB_Download : PackageDB_Install;
3751 + source == IDC_SOURCE_DOWNLOAD ? PackageDB_Download : PackageDB_Install;
3755 @@ -60,65 +63,61 @@ dialog_cmd (HWND h, int id, HWND hwndctl
3761 - if (source == IDC_SOURCE_DOWNLOAD)
3762 - NEXT (IDD_LOCAL_DIR);
3782 -static BOOL CALLBACK
3783 -dialog_proc (HWND h, UINT message, WPARAM wParam, LPARAM lParam)
3785 +SourcePage::Create ()
3789 - case WM_INITDIALOG:
3791 - // Check to see if any radio buttons are selected. If not, select a default.
3794 - (GetDlgItem (h, IDC_SOURCE_DOWNLOAD), BM_GETCHECK, 0,
3795 - 0) == BST_CHECKED)
3796 - && (!SendMessage (GetDlgItem (h, IDC_SOURCE_CWD), BM_GETCHECK, 0, 0)
3799 - SendMessage (GetDlgItem (h, IDC_SOURCE_NETINST), BM_SETCHECK,
3804 - return HANDLE_WM_COMMAND (h, wParam, lParam, dialog_cmd);
3807 + return PropertyPage::Create (NULL, dialog_cmd, IDD_SOURCE);
3811 -do_source (HINSTANCE h)
3812 +SourcePage::OnActivate ()
3815 - /* source = IDC_SOURCE_CWD; */
3817 source = IDC_SOURCE_NETINST;
3818 - rv = DialogBox (h, MAKEINTRESOURCE (IDD_SOURCE), 0, dialog_proc);
3820 - fatal (IDS_DIALOG_FAILED);
3821 + load_dialog (GetHWND ());
3822 + // Check to see if any radio buttons are selected. If not, select a default.
3824 + (GetDlgItem (IDC_SOURCE_DOWNLOAD), BM_GETCHECK, 0,
3825 + 0) == BST_CHECKED)
3826 + && (!SendMessage (GetDlgItem (IDC_SOURCE_CWD), BM_GETCHECK, 0, 0)
3829 + SendMessage (GetDlgItem (IDC_SOURCE_NETINST), BM_SETCHECK,
3835 +SourcePage::OnNext ()
3837 + HWND h = GetHWND ();
3840 + if (source == IDC_SOURCE_DOWNLOAD)
3842 + // If all we're doing is downloading,skip the root directory page
3843 + return IDD_LOCAL_DIR;
3850 +SourcePage::OnBack ()
3852 + save_dialog (GetHWND ());
3857 +SourcePage::OnDeactivate ()
3859 log (0, "source: %s",
3860 (source == IDC_SOURCE_DOWNLOAD) ? "download" :
3861 (source == IDC_SOURCE_NETINST) ? "network install" : "from cwd");
3863 ===================================================================
3866 --- /dev/null Tue May 5 13:32:27 1998
3867 +++ source.h Thu Dec 20 04:36:03 2001
3869 +#ifndef CINSTALL_SOURCE_H
3870 +#define CINSTALL_SOURCE_H
3873 + * Copyright (c) 2001, Gary R. Van Sickle.
3875 + * This program is free software; you can redistribute it and/or modify
3876 + * it under the terms of the GNU General Public License as published by
3877 + * the Free Software Foundation; either version 2 of the License, or
3878 + * (at your option) any later version.
3880 + * A copy of the GNU General Public License can be found at
3881 + * http://www.gnu.org/
3883 + * Written by Gary R. Van Sickle <g.r.vansickle@worldnet.att.net>
3887 +// This is the header for the SourcePage class, which lets the user
3888 +// select Download+Install, Download, or Install From Local Directory.
3891 +#include "proppage.h"
3893 +class SourcePage:public PropertyPage
3899 + virtual ~ SourcePage ()
3905 + void OnActivate ();
3906 + void OnDeactivate ();
3913 ===================================================================
3914 RCS file: /cvs/src/src/winsup/cinstall/splash.cc,v
3915 retrieving revision 2.6
3916 diff -u -p -r2.6 splash.cc
3917 --- splash.cc 2001/11/13 01:49:32 2.6
3918 +++ splash.cc 2001/12/20 12:36:03
3921 - * Copyright (c) 2000, Red Hat, Inc.
3922 + * Copyright (c) 2001, Gary R. Van Sickle.
3924 * This program is free software; you can redistribute it and/or modify
3925 * it under the terms of the GNU General Public License as published by
3927 * A copy of the GNU General Public License can be found at
3928 * http://www.gnu.org/
3930 - * Written by DJ Delorie <dj@cygnus.com>
3931 + * Written by Gary R. Van Sickle <g.r.vansickle@worldnet.att.net>
3935 -/* The purpose of this file is to display the program name, version,
3936 - copyright notice, and project URL. */
3937 +// This is the implementation of the SplashPage class. Since the splash page
3938 +// has little to do, there's not much here.
3941 -static const char *cvsid =
3947 -#include "dialog.h"
3948 -#include "resource.h"
3950 #include "version.h"
3951 +#include "resource.h"
3952 +#include "cistring.h"
3953 +#include "splash.h"
3956 -load_dialog (HWND h)
3958 +SplashPage::Create ()
3961 - HWND v = GetDlgItem (h, IDC_VERSION);
3962 - sprintf (buffer, "Setup.exe version %s",
3963 - version[0] ? version : "[unknown]");
3964 - SetWindowText (v, buffer);
3965 + return PropertyPage::Create (IDD_SPLASH);
3969 -dialog_cmd (HWND h, int id, HWND hwndctl, UINT code)
3971 +SplashPage::OnInit ()
3977 - NEXT (IDD_SOURCE);
3988 -static BOOL CALLBACK
3989 -dialog_proc (HWND h, UINT message, WPARAM wParam, LPARAM lParam)
3993 - case WM_INITDIALOG:
3997 - return HANDLE_WM_COMMAND (h, wParam, lParam, dialog_cmd);
4001 + ver.Format (IDS_VERSION_INFO, version[0] ? version : "[unknown]");
4004 -do_splash (HINSTANCE h)
4007 - rv = DialogBox (h, MAKEINTRESOURCE (IDD_SPLASH), 0, dialog_proc);
4009 - fatal (IDS_DIALOG_FAILED);
4010 + SetWindowText (GetDlgItem (IDC_VERSION), ver.c_str ());
4013 ===================================================================
4016 --- /dev/null Tue May 5 13:32:27 1998
4017 +++ splash.h Thu Dec 20 04:36:03 2001
4019 +#ifndef CINSTALL_SPLASH_H
4020 +#define CINSTALL_SPLASH_H
4023 + * Copyright (c) 2001, Gary R. Van Sickle.
4025 + * This program is free software; you can redistribute it and/or modify
4026 + * it under the terms of the GNU General Public License as published by
4027 + * the Free Software Foundation; either version 2 of the License, or
4028 + * (at your option) any later version.
4030 + * A copy of the GNU General Public License can be found at
4031 + * http://www.gnu.org/
4033 + * Written by Gary R. Van Sickle <g.r.vansickle@worldnet.att.net>
4037 +// This is the header for the SplashPage class. Since the splash page
4038 +// has little to do, there's not much here.
4040 +#include "proppage.h"
4042 +class SplashPage:public PropertyPage
4048 + virtual ~ SplashPage ()
4056 +#endif // CINSTALL_SPLASH_H
4058 ===================================================================
4059 RCS file: threebar.cc
4061 --- /dev/null Tue May 5 13:32:27 1998
4062 +++ threebar.cc Thu Dec 20 04:36:03 2001
4065 + * Copyright (c) 2001, Gary R. Van Sickle.
4067 + * This program is free software; you can redistribute it and/or modify
4068 + * it under the terms of the GNU General Public License as published by
4069 + * the Free Software Foundation; either version 2 of the License, or
4070 + * (at your option) any later version.
4072 + * A copy of the GNU General Public License can be found at
4073 + * http://www.gnu.org/
4075 + * Written by Gary R. Van Sickle <g.r.vansickle@worldnet.att.net>
4079 +// This is the implementation of the ThreeBarProgressPage class. It is a fairly generic
4080 +// progress indicator property page with three progress bars.
4083 +#include "commctrl.h"
4084 +#include "resource.h"
4086 +#include "dialog.h"
4089 +#include "propsheet.h"
4090 +#include "threebar.h"
4093 +ThreeBarProgressPage::Create ()
4095 + return PropertyPage::Create (IDD_INSTATUS);
4099 +ThreeBarProgressPage::OnInit ()
4101 + // Get HWNDs to the dialog controls
4102 + ins_action = GetDlgItem (IDC_INS_ACTION);
4103 + ins_pkgname = GetDlgItem (IDC_INS_PKG);
4104 + ins_filename = GetDlgItem (IDC_INS_FILE);
4106 + ins_pprogress = GetDlgItem (IDC_INS_PPROGRESS);
4107 + ins_iprogress = GetDlgItem (IDC_INS_IPROGRESS);
4108 + ins_diskfull = GetDlgItem (IDC_INS_DISKFULL);
4110 + ins_bl_package = GetDlgItem (IDC_INS_BL_PACKAGE);
4111 + ins_bl_total = GetDlgItem (IDC_INS_BL_TOTAL);
4112 + ins_bl_disk = GetDlgItem (IDC_INS_BL_DISK);
4116 +ThreeBarProgressPage::SetText1 (const TCHAR * t)
4118 + SetWindowText (ins_action, t);
4122 +ThreeBarProgressPage::SetText2 (const TCHAR * t)
4124 + SetWindowText (ins_pkgname, t);
4128 +ThreeBarProgressPage::SetText3 (const TCHAR * t)
4130 + SetWindowText (ins_filename, t);
4134 +ThreeBarProgressPage::SetBar1 (long progress, long max)
4136 + int percent = (int) (100.0 * ((double) progress) / (double) max);
4137 + SendMessage (ins_pprogress, PBM_SETPOS, (WPARAM) percent, 0);
4141 +ThreeBarProgressPage::SetBar2 (long progress, long max)
4143 + int percent = (int) (100.0 * ((double) progress) / (double) max);
4144 + SendMessage (ins_iprogress, PBM_SETPOS, (WPARAM) percent, 0);
4148 +ThreeBarProgressPage::SetBar3 (long progress, long max)
4150 + int percent = (int) (100.0 * ((double) progress) / (double) max);
4151 + SendMessage (ins_diskfull, PBM_SETPOS, (WPARAM) percent, 0);
4155 +ThreeBarProgressPage::EnableSingleBar (bool enable)
4157 + // Switch to/from single bar mode
4158 + ShowWindow (ins_bl_total, enable ? SW_HIDE : SW_SHOW);
4159 + ShowWindow (ins_bl_disk, enable ? SW_HIDE : SW_SHOW);
4160 + ShowWindow (ins_iprogress, enable ? SW_HIDE : SW_SHOW);
4161 + ShowWindow (ins_diskfull, enable ? SW_HIDE : SW_SHOW);
4165 +ThreeBarProgressPage::OnActivate ()
4167 + // Disable back and next buttons
4168 + GetOwner ()->SetButtons (0);
4170 + // Set all bars to 0
4177 + case WM_APP_START_SITE_INFO_DOWNLOAD:
4178 + case WM_APP_START_SETUP_INI_DOWNLOAD:
4179 + // For these tasks, show only a single progress bar.
4180 + EnableSingleBar ();
4183 + // Show the normal 3-bar view by default
4184 + EnableSingleBar (false);
4188 + Window::PostMessage (task);
4192 +ThreeBarProgressPage::OnMessageApp (UINT uMsg, WPARAM wParam, LPARAM lParam)
4196 + case WM_APP_START_DOWNLOAD:
4198 + // Start the package download thread.
4199 + do_download (GetInstance (), GetHWND ());
4202 + case WM_APP_DOWNLOAD_THREAD_COMPLETE:
4204 + if (lParam == IDD_S_INSTALL)
4206 + // Download is complete and we want to go on to the install.
4207 + Window::PostMessage (WM_APP_START_INSTALL);
4209 + else if (lParam != 0)
4211 + // Download failed for some reason, go back to site selection page
4212 + GetOwner ()->SetActivePageByID (lParam);
4216 + // Was a download-only, and is complete or failed.
4217 + GetOwner ()->PressButton (PSBTN_CANCEL);
4221 + case WM_APP_START_INSTALL:
4223 + // Start the install thread.
4224 + do_install (GetInstance (), GetHWND ());
4227 + case WM_APP_INSTALL_THREAD_COMPLETE:
4229 + // Re-enable and "Push" the Next button
4230 + GetOwner ()->SetButtons (PSWIZB_NEXT);
4231 + GetOwner ()->PressButton (PSBTN_NEXT);
4234 + case WM_APP_START_SITE_INFO_DOWNLOAD:
4236 + do_download_site_info (GetInstance (), GetHWND ());
4239 + case WM_APP_SITE_INFO_DOWNLOAD_COMPLETE:
4241 + GetOwner ()->SetActivePageByID (lParam);
4244 + case WM_APP_START_SETUP_INI_DOWNLOAD:
4246 + do_ini (GetInstance (), GetHWND ());
4249 + case WM_APP_SETUP_INI_DOWNLOAD_COMPLETE:
4251 + GetOwner ()->SetActivePageByID (lParam);
4264 ===================================================================
4265 RCS file: threebar.h
4267 --- /dev/null Tue May 5 13:32:27 1998
4268 +++ threebar.h Thu Dec 20 04:36:03 2001
4270 +#ifndef CINSTALL_THREEBAR_H
4271 +#define CINSTALL_THREEBAR_H
4274 + * Copyright (c) 2001, Gary R. Van Sickle.
4276 + * This program is free software; you can redistribute it and/or modify
4277 + * it under the terms of the GNU General Public License as published by
4278 + * the Free Software Foundation; either version 2 of the License, or
4279 + * (at your option) any later version.
4281 + * A copy of the GNU General Public License can be found at
4282 + * http://www.gnu.org/
4284 + * Written by Gary R. Van Sickle <g.r.vansickle@worldnet.att.net>
4288 +// This is the header for the ThreeBarProgressPage class. It is a fairly generic
4289 +// progress indicator property page with three progress bars.
4293 +#include "proppage.h"
4295 +#define WM_APP_START_DOWNLOAD WM_APP+0
4296 +#define WM_APP_DOWNLOAD_THREAD_COMPLETE WM_APP+1
4297 +#define WM_APP_START_INSTALL WM_APP+2
4298 +#define WM_APP_INSTALL_THREAD_COMPLETE WM_APP+3
4299 +#define WM_APP_START_SITE_INFO_DOWNLOAD WM_APP+4
4300 +#define WM_APP_SITE_INFO_DOWNLOAD_COMPLETE WM_APP+5
4301 +#define WM_APP_START_SETUP_INI_DOWNLOAD WM_APP+6
4302 +#define WM_APP_SETUP_INI_DOWNLOAD_COMPLETE WM_APP+7
4304 +class ThreeBarProgressPage:public PropertyPage
4309 + HWND ins_filename;
4310 + HWND ins_pprogress;
4311 + HWND ins_iprogress;
4312 + HWND ins_diskfull;
4313 + HWND ins_bl_package;
4314 + HWND ins_bl_total;
4319 + void EnableSingleBar (bool enable = true);
4322 + ThreeBarProgressPage ()
4325 + virtual ~ ThreeBarProgressPage ()
4331 + virtual void OnInit ();
4332 + virtual void OnActivate ();
4333 + virtual bool OnMessageApp (UINT uMsg, WPARAM wParam, LPARAM lParam);
4335 + void SetText1 (const TCHAR * t);
4336 + void SetText2 (const TCHAR * t);
4337 + void SetText3 (const TCHAR * t);
4339 + void SetBar1 (long progress, long max = 100);
4340 + void SetBar2 (long progress, long max = 100);
4341 + void SetBar3 (long progress, long max = 100);
4343 + void SetActivateTask (int t)
4350 +#endif // CINSTALL_THREEBAR_H
4352 ===================================================================
4355 --- /dev/null Tue May 5 13:32:27 1998
4356 +++ window.cc Thu Dec 20 04:36:03 2001
4359 + * Copyright (c) 2001, Gary R. Van Sickle.
4361 + * This program is free software; you can redistribute it and/or modify
4362 + * it under the terms of the GNU General Public License as published by
4363 + * the Free Software Foundation; either version 2 of the License, or
4364 + * (at your option) any later version.
4366 + * A copy of the GNU General Public License can be found at
4367 + * http://www.gnu.org/
4369 + * Written by Gary R. Van Sickle <g.r.vansickle@worldnet.att.net>
4373 +// This is the implementation of the Window class. It serves both as a window class
4374 +// in its own right and as a base class for other window-like classes (e.g. PropertyPage,
4377 +#include <windows.h>
4378 +#include "window.h"
4381 + Window::WindowClassAtom =
4384 + Window::AppInstance =
4387 +// FIXME: I know, this is brutal. Mutexing should at least make window creation threadsafe,
4388 +// but if somebody has any ideas as to how to get rid of it entirely, please tell me / do so.
4389 +struct REFLECTION_INFO
4401 + WindowHandle = NULL;
4407 + // FIXME: Maybe do some reference counting and do this Unregister
4408 + // when there are no more of us left. Not real critical unless
4409 + // we're in a DLL which we're not right now.
4410 + //UnregisterClass(WindowClassAtom, InstanceHandle);
4414 +Window::FirstWindowProcReflector (HWND hwnd, UINT uMsg, WPARAM wParam,
4417 + // Get our this pointer
4418 + REFLECTION_INFO *rip = &ReflectionInfo;
4420 + if (rip->FirstCall)
4422 + rip->FirstCall = false;
4424 + // Set the Window handle so the real WindowProc has one to work with.
4425 + rip->This->WindowHandle = hwnd;
4427 + // Set a backreference to this class instance in the HWND.
4428 + // FIXME: Should really be SetWindowLongPtr(), but it appears to
4429 + // not be defined yet.
4430 + SetWindowLong (hwnd, GWL_USERDATA, (LONG) rip->This);
4432 + // Set a new WindowProc now that we have the peliminaries done.
4433 + // Like subclassing, only not.
4434 + SetWindowLong (hwnd, GWL_WNDPROC, (LONG) & Window::WindowProcReflector);
4437 + return rip->This->WindowProc (uMsg, wParam, lParam);
4441 +Window::WindowProcReflector (HWND hwnd, UINT uMsg, WPARAM wParam,
4446 + // Get our this pointer
4447 + // FIXME: Should really be GetWindowLongPtr(), but it appears to
4448 + // not be defined yet.
4449 + This = (Window *) GetWindowLong (hwnd, GWL_USERDATA);
4451 + return This->WindowProc (uMsg, wParam, lParam);
4455 +Window::Create (Window * parent, DWORD Style)
4457 + // First register the window class, if we haven't already
4458 + if (RegisterWindowClass () == false)
4460 + // Registration failed
4464 + // Set up the reflection info, so that the Windows window can find us.
4465 + ReflectionInfo.This = this;
4466 + ReflectionInfo.FirstCall = true;
4470 + // Create the window instance
4471 + WindowHandle = CreateWindow ("MainWindowClass", //MAKEINTATOM(WindowClassAtom), // window class atom (name)
4472 + "Hello", // no title-bar string yet
4475 + // Default positions and size
4477 + CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT,
4480 + NULL ? (HWND) NULL : parent->GetHWND (),
4483 + // The application instance
4484 + GetInstance (), (LPVOID) NULL);
4486 + if (WindowHandle == NULL)
4496 +Window::RegisterWindowClass ()
4498 + if (WindowClassAtom == 0)
4500 + // We're not registered yet
4503 + wc.cbSize = sizeof (wc);
4504 + // Some sensible style defaults
4505 + wc.style = CS_DBLCLKS | CS_HREDRAW | CS_VREDRAW;
4506 + // Our default window procedure. This replaces itself
4507 + // on the first call with the simpler Window::WindowProcReflector().
4508 + wc.lpfnWndProc = Window::FirstWindowProcReflector;
4510 + wc.cbClsExtra = 0;
4511 + // One pointer to REFLECTION_INFO in the extra window instance bytes
4512 + wc.cbWndExtra = 4;
4513 + // The app instance
4514 + wc.hInstance = GetInstance ();
4515 + // Use a bunch of system defaults for the GUI elements
4517 + wc.hIconSm = NULL;
4518 + wc.hCursor = NULL;
4519 + wc.hbrBackground = (HBRUSH) (COLOR_BACKGROUND + 1);
4521 + wc.lpszMenuName = NULL;
4522 + // We'll get a little crazy here with the class name
4523 + wc.lpszClassName = "MainWindowClass";
4525 + // All set, try to register
4526 + WindowClassAtom = RegisterClassEx (&wc);
4528 + if (WindowClassAtom == 0)
4535 + // We're registered, or already were before the call,
4536 + // return success in either case.
4541 +Window::Show (int State)
4543 + ::ShowWindow (WindowHandle, State);
4547 +Window::CenterWindow ()
4549 + RECT WindowRect, ParentRect;
4550 + int WindowWidth, WindowHeight;
4553 + // Get the window rectangle
4554 + GetWindowRect (GetHWND (), &WindowRect);
4556 + if (GetParent () == NULL)
4558 + // Center on desktop window
4559 + GetWindowRect (GetDesktopWindow (), &ParentRect);
4563 + // Center on client area of parent
4564 + GetClientRect (GetParent ()->GetHWND (), &ParentRect);
4567 + WindowWidth = WindowRect.right - WindowRect.left;
4568 + WindowHeight = WindowRect.bottom - WindowRect.top;
4570 + // Find center of area we're centering on
4571 + p.x = (ParentRect.right - ParentRect.left) / 2;
4572 + p.y = (ParentRect.bottom - ParentRect.top) / 2;
4574 + // Convert that to screen coords
4575 + if (GetParent () == NULL)
4577 + ClientToScreen (GetDesktopWindow (), &p);
4581 + ClientToScreen (GetParent ()->GetHWND (), &p);
4584 + // Calculate new top left corner for window
4585 + p.x -= WindowWidth / 2;
4586 + p.y -= WindowHeight / 2;
4588 + // And finally move the window
4589 + MoveWindow (GetHWND (), p.x, p.y, WindowWidth, WindowHeight, TRUE);
4593 +Window::WindowProc (UINT uMsg, WPARAM wParam, LPARAM lParam)
4598 + return DefWindowProc (WindowHandle, uMsg, wParam, lParam);
4605 +Window::MessageLoop ()
4609 + while (GetMessage (&msg, NULL, 0, 0) != 0
4610 + && GetMessage (&msg, (HWND) NULL, 0, 0) != -1)
4612 + if (!IsWindow (WindowHandle) || !IsDialogMessage (WindowHandle, &msg))
4614 + TranslateMessage (&msg);
4615 + DispatchMessage (&msg);
4623 +Window::PostMessage (UINT uMsg, WPARAM wParam, LPARAM lParam)
4625 + ::PostMessage (GetHWND (), uMsg, wParam, lParam);
4628 ===================================================================
4631 --- /dev/null Tue May 5 13:32:27 1998
4632 +++ window.h Thu Dec 20 04:36:03 2001
4634 +#ifndef CINSTALL_WINDOW_H
4635 +#define CINSTALL_WINDOW_H
4638 + * Copyright (c) 2001, Gary R. Van Sickle.
4640 + * This program is free software; you can redistribute it and/or modify
4641 + * it under the terms of the GNU General Public License as published by
4642 + * the Free Software Foundation; either version 2 of the License, or
4643 + * (at your option) any later version.
4645 + * A copy of the GNU General Public License can be found at
4646 + * http://www.gnu.org/
4648 + * Written by Gary R. Van Sickle <g.r.vansickle@worldnet.att.net>
4652 +// This is the header for the Window class. It serves both as a window class
4653 +// in its own right and as a base class for other window-like classes (e.g. PropertyPage,
4656 +#include <windows.h>
4660 + static ATOM WindowClassAtom;
4661 + static HINSTANCE AppInstance;
4664 + bool RegisterWindowClass ();
4665 + static LRESULT CALLBACK FirstWindowProcReflector (HWND hwnd, UINT uMsg,
4668 + static LRESULT CALLBACK WindowProcReflector (HWND hwnd, UINT uMsg,
4669 + WPARAM wParam, LPARAM lParam);
4671 + HWND WindowHandle;
4676 + void SetHWND (HWND h)
4683 + virtual ~ Window ();
4685 + static void SetAppInstance (HINSTANCE h)
4690 + virtual LRESULT WindowProc (UINT uMsg, WPARAM wParam, LPARAM lParam);
4691 + virtual bool MessageLoop ();
4693 + virtual bool Create (Window * Parent = NULL,
4695 + WS_OVERLAPPEDWINDOW | WS_VISIBLE | WS_CLIPCHILDREN);
4696 + void Show (int State);
4698 + HWND GetHWND () const
4700 + return WindowHandle;
4702 + HINSTANCE GetInstance () const
4704 + return AppInstance;
4707 + Window *GetParent () const
4711 + HWND GetDlgItem (int id) const
4713 + return::GetDlgItem (GetHWND (), id);
4716 + void PostMessage (UINT uMsg, WPARAM wParam = 0, LPARAM lParam = 0);
4718 + virtual bool OnMessageApp (UINT uMsg, WPARAM wParam, LPARAM lParam)
4723 + // Center the window on the parent, or on screen if no parent.
4724 + void CenterWindow ();
4728 +#endif // CINSTALL_WINDOW_H