? chooser.cc
? chooser.h
? cistring.cc
? cistring.h
? desktop.h
? localdir.h
? net.h
? proppage.cc
? proppage.h
? propsheet.cc
? propsheet.h
? res.aps
? source.h
? splash.h
? threebar.cc
? threebar.h
? window.cc
? window.h
Index: Makefile.in
===================================================================
RCS file: /cvs/src/src/winsup/cinstall/Makefile.in,v
retrieving revision 2.38
diff -p -u -r2.38 Makefile.in
--- Makefile.in	2001/12/03 22:22:08	2.38
+++ Makefile.in	2001/12/19 10:59:47
@@ -65,7 +65,7 @@ libkernel32	:= $(w32api_lib)/libkernel32
 ALL_DEP_LDLIBS	:= $(ZLIB) $(BZ2LIB) $(w32api_lib)/libole32.a $(w32api_lib)/libwsock32.a \
 		$(w32api_lib)/libnetapi32.a $(w32api_lib)/libadvapi32.a \
 		$(w32api_lib)/libuuid.a $(libkernel32) $(w32api_lib)/libuser32.a \
-		$(libmingw32)
+		$(w32api_lib)/libcomctl32.a $(libmingw32)
 
 ALL_LDLIBS	:= ${patsubst $(mingw_build)/lib%.a,-l%,\
 	      ${patsubst $(w32api_lib)/lib%.a,-l%,\
@@ -86,6 +86,8 @@ OBJS = \
 	autoload.o \
 	category.o \
 	choose.o \
+	chooser.o \
+	cistring.o \
 	compress.o \
 	compress_bz.o \
 	compress_gz.o \
@@ -128,6 +130,8 @@ OBJS = \
 	package_source.o \
 	package_version.o \
 	postinstall.o \
+	proppage.o \
+	propsheet.o \
 	res.o \
 	rfc1738.o \
 	root.o \
@@ -137,7 +141,9 @@ OBJS = \
 	source.o \
 	splash.o \
 	state.o \
+	threebar.o \
 	version.o \
+	window.o \
 	$E
 
 .SUFFIXES:
Index: choose.cc
===================================================================
RCS file: /cvs/src/src/winsup/cinstall/choose.cc,v
retrieving revision 2.78
diff -p -u -r2.78 choose.cc
--- choose.cc	2001/12/03 22:22:08	2.78
+++ choose.cc	2001/12/19 10:59:50
@@ -1132,6 +1132,7 @@ create_listview (HWND dlg, RECT * r)
 		       (HMENU) MAKEINTRESOURCE (IDC_CHOOSE_LIST),
 		       hinstance, 0);
   ShowWindow (lv, SW_SHOW);
+
   HDC dc = GetDC (lv);
   sysfont = GetStockObject (DEFAULT_GUI_FONT);
   SelectObject (dc, sysfont);
@@ -1256,6 +1257,7 @@ dialog_proc (HWND h, UINT message, WPARA
       r.top += 2;
       r.bottom -= 2;
       create_listview (h, &r);
+
 #if 0
       load_dialog (h);
 #endif
@@ -1360,7 +1362,7 @@ scan_downloaded_files ()
 }
 
 void
-do_choose (HINSTANCE h)
+do_choose (HINSTANCE h, HWND owner)
 {
   int rv;
 
@@ -1384,9 +1386,9 @@ do_choose (HINSTANCE h)
   set_existence ();
   fill_missing_category ();
 
-  rv = DialogBox (h, MAKEINTRESOURCE (IDD_CHOOSE), 0, dialog_proc);
+  rv = DialogBox (h, MAKEINTRESOURCE (IDD_CHOOSE), owner, dialog_proc);
   if (rv == -1)
-    fatal (IDS_DIALOG_FAILED);
+    fatal (owner, IDS_DIALOG_FAILED);
 
   log (LOG_BABBLE, "Chooser results...");
   packagedb db;
@@ -1471,3 +1473,4 @@ do_choose (HINSTANCE h)
 #endif
     }
 }
+
Index: desktop.cc
===================================================================
RCS file: /cvs/src/src/winsup/cinstall/desktop.cc,v
retrieving revision 2.18
diff -p -u -r2.18 desktop.cc
--- desktop.cc	2001/11/29 09:52:32	2.18
+++ desktop.cc	2001/12/19 10:59:51
@@ -48,6 +48,8 @@ static const char *cvsid =
 #include "package_meta.h"
 #include "package_version.h"
 
+#include "desktop.h"
+
 static OSVERSIONINFO verinfo;
 
 /* Lines starting with '@' are conditionals - include 'N' for NT,
@@ -444,56 +446,44 @@ dialog_cmd (HWND h, int id, HWND hwndctl
       save_dialog (h);
       check_if_enable_next (h);
       break;
-
-    case IDOK:
-      save_dialog (h);
-      do_desktop_setup ();
-      NEXT (IDD_S_POSTINSTALL);
-      break;
-
-    case IDC_BACK:
-      save_dialog (h);
-      NEXT (IDD_CHOOSE);
-      break;
-
-    case IDCANCEL:
-      NEXT (0);
-      break;
     }
   return 0;
 }
 
-static BOOL CALLBACK
-dialog_proc (HWND h, UINT message, WPARAM wParam, LPARAM lParam)
+bool DesktopSetupPage::Create()
 {
-  switch (message)
-    {
-    case WM_INITDIALOG:
-      load_dialog (h);
-      return FALSE;
-    case WM_COMMAND:
-      return HANDLE_WM_COMMAND (h, wParam, lParam, dialog_cmd);
-    }
-  return FALSE;
+	return PropertyPage::Create(NULL, dialog_cmd, IDD_DESKTOP);
 }
 
-void
-do_desktop (HINSTANCE h)
+void DesktopSetupPage::OnInit()
 {
-  CoInitialize (NULL);
-
-  verinfo.dwOSVersionInfoSize = sizeof (verinfo);
-  GetVersionEx (&verinfo);
+	// FIXME: This CoInitialize() feels like it could be moved to startup in main.cc.
+	CoInitialize (NULL);
+	verinfo.dwOSVersionInfoSize = sizeof (verinfo);
+	GetVersionEx (&verinfo);
+	root_desktop =
+		check_desktop ("Cygwin", backslash (cygpath ("/cygwin.bat", 0)));
+	root_menu =
+		check_startmenu ("Cygwin Bash Shell",
+			 backslash (cygpath ("/cygwin.bat", 0)));
+	load_dialog (GetHWND());
+}
 
-  root_desktop =
-    check_desktop ("Cygwin", backslash (cygpath ("/cygwin.bat", 0)));
-  root_menu =
-    check_startmenu ("Cygwin Bash Shell",
-		     backslash (cygpath ("/cygwin.bat", 0)));
+long DesktopSetupPage::OnBack()
+{
+	HWND h = GetHWND();
+    save_dialog (h);
+    NEXT (IDD_CHOOSE);
+	return IDD_CHOOSER;
+}
 
-  int rv = 0;
+bool DesktopSetupPage::OnFinish()
+{
+	HWND h = GetHWND();
+	save_dialog (h);
+	do_desktop_setup ();
+	NEXT (IDD_S_POSTINSTALL);
+	do_postinstall(GetInstance(), h);
 
-  rv = DialogBox (h, MAKEINTRESOURCE (IDD_DESKTOP), 0, dialog_proc);
-  if (rv == -1)
-    fatal (IDS_DIALOG_FAILED);
+	return true;
 }
Index: dialog.h
===================================================================
RCS file: /cvs/src/src/winsup/cinstall/dialog.h,v
retrieving revision 2.4
diff -p -u -r2.4 dialog.h
--- dialog.h	2001/11/13 01:49:31	2.4
+++ dialog.h	2001/12/19 10:59:52
@@ -22,7 +22,7 @@ extern int next_dialog;
 /* either "nothing to do" or "setup complete" or something like that */
 extern int exit_msg;
 
-#define D(x) void x(HINSTANCE _h)
+#define D(x) void x(HINSTANCE _h, HWND owner)
 
 /* prototypes for all the do_* functions (most called by main.cc) */
 
Index: download.cc
===================================================================
RCS file: /cvs/src/src/winsup/cinstall/download.cc,v
retrieving revision 2.17
diff -p -u -r2.17 download.cc
--- download.cc	2001/12/02 03:25:11	2.17
+++ download.cc	2001/12/19 10:59:52
@@ -25,6 +25,7 @@ static const char *cvsid =
 
 #include <stdio.h>
 #include <unistd.h>
+#include <process.h>
 
 #include "resource.h"
 #include "msg.h"
@@ -47,6 +48,9 @@ static const char *cvsid =
 
 #include "rfc1738.h"
 
+#include "threebar.h"
+extern ThreeBarProgressPage Progress;
+
 /* 0 on failure
  */
 static int
@@ -95,7 +99,7 @@ check_for_cached (packagesource & pkgsou
 
 /* download a file from a mirror site to the local cache. */
 static int
-download_one (packagesource & pkgsource)
+download_one (packagesource & pkgsource, HWND owner)
 {
   if (check_for_cached (pkgsource) && source != IDC_SOURCE_DOWNLOAD)
     return 0;
@@ -113,7 +117,7 @@ download_one (packagesource & pkgsource)
       if (get_url_to_file
 	  (concat
 	   (pkgsource.sites[n]->key, "/", pkgsource.Canonical (), 0),
-	   concat (local, ".tmp", 0), pkgsource.size))
+	   concat (local, ".tmp", 0), pkgsource.size, owner))
 	{
 	  /* FIXME: note new source ? */
 	  continue;
@@ -146,8 +150,8 @@ download_one (packagesource & pkgsource)
   return 1;
 }
 
-void
-do_download (HINSTANCE h)
+static void
+do_download_thread (HINSTANCE h, HWND owner)
 {
   int errors = 0;
   total_download_bytes = 0;
@@ -162,11 +166,11 @@ do_download (HINSTANCE h)
 	packageversion *version = pkg->desired;
 	if (!
 	    (check_for_cached (version->bin)
-	     && source != IDC_SOURCE_DOWNLOAD))
+	     && source != IDC_SOURCE_DOWNLOAD) && pkg->desired->binpicked)
 	  total_download_bytes += version->bin.size;
 	if (!
 	    (check_for_cached (version->src)
-	     && source != IDC_SOURCE_DOWNLOAD))
+	     && source != IDC_SOURCE_DOWNLOAD) && pkg->desired->srcpicked)
 	  total_download_bytes += version->src.size;
       }
 
@@ -180,9 +184,9 @@ do_download (HINSTANCE h)
 	int e = 0;
 	packageversion *version = pkg->desired;
 	if (version->binpicked)
-	  e += download_one (version->bin);
+	  e += download_one (version->bin, owner);
 	if (version->srcpicked)
-	  e += download_one (version->src);
+	  e += download_one (version->src, owner);
 	errors += e;
 #if 0
 	if (e)
@@ -190,11 +194,9 @@ do_download (HINSTANCE h)
 #endif
       }
 
-  dismiss_url_status_dialog ();
-
   if (errors)
     {
-      if (yesno (IDS_DOWNLOAD_INCOMPLETE) == IDYES)
+      if (yesno (owner, IDS_DOWNLOAD_INCOMPLETE) == IDYES)
 	{
 	  next_dialog = IDD_SITE;
 	  return;
@@ -211,4 +213,29 @@ do_download (HINSTANCE h)
     }
   else
     next_dialog = IDD_S_INSTALL;
+}
+
+static void
+do_download_reflector(void* p)
+{
+	HANDLE *context;
+	context = (HANDLE*)p;
+
+	do_download_thread((HINSTANCE)context[0], (HWND)context[1]);
+
+	// Tell the progress page that we're done downloading
+	Progress.PostMessage(WM_APP_DOWNLOAD_THREAD_COMPLETE, 0, next_dialog);
+
+	_endthread();
+}
+
+static HANDLE context[2];
+
+void
+do_download (HINSTANCE h, HWND owner)
+{
+	context[0] = h;
+	context[1] = owner;
+
+	_beginthread(do_download_reflector, 0, context);
 }
Index: fromcwd.cc
===================================================================
RCS file: /cvs/src/src/winsup/cinstall/fromcwd.cc,v
retrieving revision 2.15
diff -p -u -r2.15 fromcwd.cc
--- fromcwd.cc	2001/12/03 22:22:09	2.15
+++ fromcwd.cc	2001/12/19 10:59:52
@@ -118,7 +118,7 @@ check_ini (char *path, unsigned int fsiz
 }
 
 void
-do_fromcwd (HINSTANCE h)
+do_fromcwd (HINSTANCE h, HWND owner)
 {
   found_ini = true;
   find (".", check_ini);
Index: geturl.cc
===================================================================
RCS file: /cvs/src/src/winsup/cinstall/geturl.cc,v
retrieving revision 2.15
diff -p -u -r2.15 geturl.cc
--- geturl.cc	2001/12/02 03:25:11	2.15
+++ geturl.cc	2001/12/19 10:59:53
@@ -43,119 +43,33 @@ static const char *cvsid =
 #include "diskfull.h"
 #include "mount.h"
 
-static HWND gw_dialog = 0;
-static HWND gw_url = 0;
-static HWND gw_rate = 0;
-static HWND gw_progress = 0;
-static HWND gw_pprogress = 0;
-static HWND gw_iprogress = 0;
-static HWND gw_progress_text = 0;
-static HWND gw_pprogress_text = 0;
-static HWND gw_iprogress_text = 0;
-static HANDLE init_event;
+#include "threebar.h"
+extern ThreeBarProgressPage Progress;
+
 static int max_bytes = 0;
 static int is_local_install = 0;
 
 int total_download_bytes = 0;
 int total_download_bytes_sofar = 0;
 
-static BOOL
-dialog_cmd (HWND h, int id, HWND hwndctl, UINT code)
-{
-  switch (id)
-    {
-    case IDCANCEL:
-      exit_setup (0);
-    }
-  return 0;
-}
-
-static BOOL CALLBACK
-dialog_proc (HWND h, UINT message, WPARAM wParam, LPARAM lParam)
-{
-  switch (message)
-    {
-    case WM_INITDIALOG:
-      gw_dialog = h;
-      gw_url = GetDlgItem (h, IDC_DLS_URL);
-      gw_rate = GetDlgItem (h, IDC_DLS_RATE);
-      gw_progress = GetDlgItem (h, IDC_DLS_PROGRESS);
-      gw_pprogress = GetDlgItem (h, IDC_DLS_PPROGRESS);
-      gw_iprogress = GetDlgItem (h, IDC_DLS_IPROGRESS);
-      gw_progress_text = GetDlgItem (h, IDC_DLS_PROGRESS_TEXT);
-      gw_pprogress_text = GetDlgItem (h, IDC_DLS_PPROGRESS_TEXT);
-      gw_iprogress_text = GetDlgItem (h, IDC_DLS_IPROGRESS_TEXT);
-      SetEvent (init_event);
-      return TRUE;
-    case WM_COMMAND:
-      return HANDLE_WM_COMMAND (h, wParam, lParam, dialog_cmd);
-    }
-  return FALSE;
-}
-
-static WINAPI DWORD
-dialog (void *)
-{
-  MSG m;
-  HWND local_gw_dialog =
-    CreateDialog (hinstance, MAKEINTRESOURCE (IDD_DLSTATUS),
-		  0, dialog_proc);
-  ShowWindow (local_gw_dialog, SW_SHOWNORMAL);
-  UpdateWindow (local_gw_dialog);
-  while (GetMessage (&m, 0, 0, 0) > 0)
-    {
-      TranslateMessage (&m);
-      DispatchMessage (&m);
-    }
-  return 0;
-}
-
 static DWORD start_tics;
 
 static void
-init_dialog (char const *url, int length)
+init_dialog (char const *url, int length, HWND owner)
 {
   if (is_local_install)
     return;
-  if (gw_dialog == 0)
-    {
-      DWORD tid;
-      HANDLE thread;
-      init_event = CreateEvent (0, 0, 0, 0);
-      thread = CreateThread (0, 0, dialog, 0, 0, &tid);
-      WaitForSingleObject (init_event, 1000);
-      CloseHandle (init_event);
-      SendMessage (gw_progress, PBM_SETRANGE, 0, MAKELPARAM (0, 100));
-      SendMessage (gw_pprogress, PBM_SETRANGE, 0, MAKELPARAM (0, 100));
-      SendMessage (gw_iprogress, PBM_SETRANGE, 0, MAKELPARAM (0, 100));
-    }
+
   char const *sl = url;
   char const *cp;
   for (cp = url; *cp; cp++)
     if (*cp == '/' || *cp == '\\' || *cp == ':')
       sl = cp + 1;
   max_bytes = length;
-  SetWindowText (gw_url, sl);
-  SetWindowText (gw_rate, "Connecting...");
-  SendMessage (gw_progress, PBM_SETPOS, (WPARAM) 0, 0);
-  ShowWindow (gw_progress, (length > 0) ? SW_SHOW : SW_HIDE);
-  if (length > 0)
-    SetWindowText (gw_progress_text, "Package");
-  else
-    SetWindowText (gw_progress_text, "       ");
-  ShowWindow (gw_pprogress, (total_download_bytes > 0) ? SW_SHOW : SW_HIDE);
-  if (total_download_bytes > 0)
-    {
-      SetWindowText (gw_pprogress_text, "Total");
-      SetWindowText (gw_iprogress_text, "Disk");
-    }
-  else
-    {
-      SetWindowText (gw_pprogress_text, "     ");
-      SetWindowText (gw_iprogress_text, "    ");
-    }
-  ShowWindow (gw_iprogress, (total_download_bytes > 0) ? SW_SHOW : SW_HIDE);
-  ShowWindow (gw_dialog, SW_SHOWNORMAL);
+  Progress.SetText1("Downloading...");
+  Progress.SetText2(sl);
+  Progress.SetText3("Connecting...");
+  Progress.SetBar1(0);
   start_tics = GetTickCount ();
 }
 
@@ -166,7 +80,7 @@ progress (int bytes)
   if (is_local_install)
     return;
   static char buf[100];
-  int kbps;
+  double kbps;
   static unsigned int last_tics = 0;
   DWORD tics = GetTickCount ();
   if (tics == start_tics)	// to prevent division by zero
@@ -175,36 +89,30 @@ progress (int bytes)
     return;
   last_tics = tics;
 
-  kbps = bytes / (tics - start_tics);
-  ShowWindow (gw_progress, (max_bytes > 0) ? SW_SHOW : SW_HIDE);
-  ShowWindow (gw_pprogress, (total_download_bytes > 0) ? SW_SHOW : SW_HIDE);
-  ShowWindow (gw_iprogress, (total_download_bytes > 0) ? SW_SHOW : SW_HIDE);
-  if (max_bytes > 100)
-    {
-      int perc = bytes / (max_bytes / 100);
-      SendMessage (gw_progress, PBM_SETPOS, (WPARAM) perc, 0);
-      sprintf (buf, "%3d %%  (%dk/%dk)  %d kb/s\n",
+  kbps = ((double)bytes) / (double)(tics - start_tics);
+  if (max_bytes > 0)
+    {
+      int perc = (int)(100.0 * ((double)bytes) / (double)max_bytes);
+      Progress.SetBar1(bytes, max_bytes);
+      sprintf (buf, "%3d %%  (%dk/%dk)  %2.1f kb/s\n",
 	       perc, bytes / 1000, max_bytes / 1000, kbps);
       if (total_download_bytes > 0)
 	{
-	  int totalperc =
-	    (total_download_bytes_sofar +
-	     bytes) / (total_download_bytes / 100);
-	  SendMessage (gw_pprogress, PBM_SETPOS, (WPARAM) totalperc, 0);
+      Progress.SetBar2(total_download_bytes_sofar + bytes, total_download_bytes);
 	}
     }
   else
-    sprintf (buf, "%d  %d kb/s\n", bytes, kbps);
+    sprintf (buf, "%d  %2.1f kb/s\n", bytes, kbps);
 
-  SetWindowText (gw_rate, buf);
+  Progress.SetText3(buf);
 }
 
 io_stream *
-get_url_to_membuf (char const *_url)
+get_url_to_membuf (char const *_url, HWND owner)
 {
-  log (LOG_BABBLE, "get_url_to_membuf %s", _url);
+	log (LOG_BABBLE, "get_url_to_membuf %s", _url);
   is_local_install = (source == IDC_SOURCE_CWD);
-  init_dialog (_url, 0);
+  init_dialog (_url, 0, owner);
   NetIO *n = NetIO::open (_url);
   if (!n || !n->ok ())
     {
@@ -254,9 +162,9 @@ get_url_to_membuf (char const *_url)
 }
 
 char *
-get_url_to_string (char const *_url)
+get_url_to_string (char const *_url, HWND owner)
 {
-  io_stream *stream = get_url_to_membuf (_url);
+  io_stream *stream = get_url_to_membuf (_url, owner);
   if (!stream)
     return 0;
   size_t bytes = stream->get_size ();
@@ -283,15 +191,15 @@ get_url_to_string (char const *_url)
 
 int
 get_url_to_file (char *_url, char *_filename, int expected_length,
-		 BOOL allow_ftp_auth)
+		 HWND owner, BOOL allow_ftp_auth)
 {
   log (LOG_BABBLE, "get_url_to_file %s %s", _url, _filename);
   if (total_download_bytes > 0)
     {
       int df = diskfull (get_root_dir ());
-      SendMessage (gw_iprogress, PBM_SETPOS, (WPARAM) df, 0);
+	  Progress.SetBar3(df);
     }
-  init_dialog (_url, expected_length);
+  init_dialog (_url, expected_length, owner);
 
   remove (_filename);		/* but ignore errors */
 
@@ -309,7 +217,7 @@ get_url_to_file (char *_url, char *_file
       const char *err = strerror (errno);
       if (!err)
 	err = "(unknown error)";
-      fatal (IDS_ERR_OPEN_WRITE, _filename, err);
+      fatal (owner, IDS_ERR_OPEN_WRITE, _filename, err);
     }
 
   if (n->file_size)
@@ -338,15 +246,16 @@ get_url_to_file (char *_url, char *_file
   if (total_download_bytes > 0)
     {
       int df = diskfull (get_root_dir ());
-      SendMessage (gw_iprogress, PBM_SETPOS, (WPARAM) df, 0);
+	  Progress.SetBar3(df);
     }
 
   return 0;
 }
 
+// FIXME: I think this can go now, I don't think anything calls it.
 void
 dismiss_url_status_dialog ()
 {
-  if (!is_local_install)
-    ShowWindow (gw_dialog, SW_HIDE);
+  //if (!is_local_install)
+    //ShowWindow (gw_dialog, SW_HIDE);
 }
Index: geturl.h
===================================================================
RCS file: /cvs/src/src/winsup/cinstall/geturl.h,v
retrieving revision 2.4
diff -p -u -r2.4 geturl.h
--- geturl.h	2001/12/02 03:25:11	2.4
+++ geturl.h	2001/12/19 10:59:53
@@ -21,8 +21,8 @@ extern int total_download_bytes_sofar;
 
 class io_stream;
 
-io_stream *get_url_to_membuf (char const *);
-char *get_url_to_string (char const *);
+io_stream *get_url_to_membuf (char const *, HWND owner);
+char *get_url_to_string (char const *, HWND owner);
 int get_url_to_file (char *_url, char *_filename, int expected_size,
-		     BOOL allow_ftp_auth = FALSE);
+		     HWND owner, BOOL allow_ftp_auth = FALSE);
 void dismiss_url_status_dialog ();
Index: ini.cc
===================================================================
RCS file: /cvs/src/src/winsup/cinstall/ini.cc,v
retrieving revision 2.15
diff -p -u -r2.15 ini.cc
--- ini.cc	2001/12/03 22:22:09	2.15
+++ ini.cc	2001/12/19 10:59:53
@@ -28,6 +28,7 @@ static const char *cvsid =
 #include <stdio.h>
 #include <stdlib.h>
 #include <stdarg.h>
+#include <process.h>
 
 #include "ini.h"
 #include "resource.h"
@@ -45,6 +46,9 @@ static const char *cvsid =
 
 #include "io_stream.h"
 
+#include "threebar.h"
+extern ThreeBarProgressPage Progress;
+
 unsigned int setup_timestamp = 0;
 char *setup_version = 0;
 
@@ -64,7 +68,7 @@ find_routine (char *path, unsigned int f
   io_stream *ini_file = io_stream::open (concat ("file://", local_dir,"/", path, 0), "rb");
   if (!ini_file)
     {
-    note (IDS_SETUPINI_MISSING, path);
+    note (NULL, IDS_SETUPINI_MISSING, path);
     return;
     }
 
@@ -83,7 +87,7 @@ find_routine (char *path, unsigned int f
 }
 
 static int
-do_local_ini ()
+do_local_ini (HWND owner)
 {
   local_ini = 0;
   find (local_dir, find_routine);
@@ -91,18 +95,19 @@ do_local_ini ()
 }
 
 static int
-do_remote_ini ()
+do_remote_ini (HWND owner)
 {
   size_t ini_count = 0;
+  
   for (size_t n = 1; n <= site_list.number (); n++)
     {
       io_stream *ini_file =
-	get_url_to_membuf (concat (site_list[n]->url, "/setup.ini", 0));
+	get_url_to_membuf (concat (site_list[n]->url, "/setup.ini", 0), owner);
       dismiss_url_status_dialog ();
 
       if (!ini_file)
 	{
-	  note (IDS_SETUPINI_MISSING, site_list[n]->url);
+	  note (owner, IDS_SETUPINI_MISSING, site_list[n]->url);
 	  continue;
 	}
 
@@ -139,14 +144,14 @@ do_remote_ini ()
   return ini_count;
 }
 
-void
-do_ini (HINSTANCE h)
+static void
+do_ini_thread (HINSTANCE h, HWND owner)
 {
   size_t ini_count = 0;
   if (source == IDC_SOURCE_CWD)
-    ini_count = do_local_ini ();
+    ini_count = do_local_ini (owner);
   else
-    ini_count = do_remote_ini ();
+    ini_count = do_remote_ini (owner);
 
   if (ini_count == 0)
     {
@@ -171,7 +176,7 @@ do_ini (HINSTANCE h)
 	  if (old_timestamp && setup_timestamp
 	      && (old_timestamp > setup_timestamp))
 	    {
-	      int yn = yesno (IDS_OLD_SETUPINI);
+	      int yn = yesno (owner, IDS_OLD_SETUPINI);
 	      if (yn == IDNO)
 		exit_setup (1);
 	    }
@@ -197,11 +202,37 @@ do_ini (HINSTANCE h)
       char *ini_version = canonicalize_version (setup_version);
       char *our_version = canonicalize_version (version);
       if (strcmp (our_version, ini_version) < 0)
-	note (IDS_OLD_SETUP_VERSION, version, setup_version);
+	note (owner, IDS_OLD_SETUP_VERSION, version, setup_version);
     }
 
-  next_dialog = IDD_CHOOSE;
+  next_dialog = IDD_CHOOSER;
 }
+
+static void
+do_ini_thread_reflector(void* p)
+{
+	HANDLE *context;
+	context = (HANDLE*)p;
+
+	do_ini_thread((HINSTANCE)context[0], (HWND)context[1]);
+
+	// Tell the progress page that we're done downloading
+	Progress.PostMessage(WM_APP_SETUP_INI_DOWNLOAD_COMPLETE, 0, next_dialog);
+
+	_endthread();
+}
+
+static HANDLE context[2];
+
+void
+do_ini (HINSTANCE h, HWND owner)
+{
+	context[0] = h;
+	context[1] = owner;
+
+	_beginthread(do_ini_thread_reflector, 0, context);
+}
+
 
 extern int yylineno;
 
Index: iniparse.y
===================================================================
RCS file: /cvs/src/src/winsup/cinstall/iniparse.y,v
retrieving revision 2.20
diff -p -u -r2.20 iniparse.y
--- iniparse.y	2001/12/02 03:25:11	2.20
+++ iniparse.y	2001/12/19 10:59:53
@@ -94,7 +94,7 @@ lines
 simple_line
  : VERSION STRING		{ cpv->set_canonical_version ($2); 
    				  add_correct_version ();}
- | SDESC STRING			{ cpv->set_sdesc ($2); }
+ | SDESC STRING			{ cp->sdesc = $2; cpv->set_sdesc ($2); }
  | LDESC STRING			{ cpv->set_ldesc ($2); }
  | CATEGORY categories
  | REQUIRES requires
@@ -148,7 +148,7 @@ categories
 void
 add_correct_version()
 {
-    int merged = 0;
+	int merged = 0;
     for (size_t n = 1; !merged && n <= cp->versions.number (); n++)
       if (!strcasecmp(cp->versions[n]->Canonical_version(), cpv->Canonical_version()))
       {
Index: install.cc
===================================================================
RCS file: /cvs/src/src/winsup/cinstall/install.cc,v
retrieving revision 2.30
diff -p -u -r2.30 install.cc
--- install.cc	2001/11/29 09:52:33	2.30
+++ install.cc	2001/12/19 10:59:55
@@ -33,6 +33,8 @@ static const char *cvsid =
 #include <sys/types.h>
 #include <sys/stat.h>
 #include <errno.h>
+#include <process.h>
+
 #include "zlib/zlib.h"
 
 #include "resource.h"
@@ -61,110 +63,32 @@ static const char *cvsid =
 
 #include "port.h"
 
-static HWND ins_dialog = 0;
-static HWND ins_action = 0;
-static HWND ins_pkgname = 0;
-static HWND ins_filename = 0;
-static HWND ins_pprogress = 0;
-static HWND ins_iprogress = 0;
-static HWND ins_diskfull = 0;
-static HANDLE init_event;
+#include "threebar.h"
+extern ThreeBarProgressPage Progress;
 
 static int total_bytes = 0;
 static int total_bytes_sofar = 0;
 static int package_bytes = 0;
 
-static bool
-dialog_cmd (HWND h, int id, HWND hwndctl, UINT code)
-{
-  switch (id)
-    {
-    case IDCANCEL:
-      exit_setup (1);
-    }
-  return 0;
-}
-
-static BOOL CALLBACK
-dialog_proc (HWND h, UINT message, WPARAM wParam, LPARAM lParam)
-{
-  switch (message)
-    {
-    case WM_INITDIALOG:
-      ins_dialog = h;
-      ins_action = GetDlgItem (h, IDC_INS_ACTION);
-      ins_pkgname = GetDlgItem (h, IDC_INS_PKG);
-      ins_filename = GetDlgItem (h, IDC_INS_FILE);
-      ins_pprogress = GetDlgItem (h, IDC_INS_PPROGRESS);
-      ins_iprogress = GetDlgItem (h, IDC_INS_IPROGRESS);
-      ins_diskfull = GetDlgItem (h, IDC_INS_DISKFULL);
-      SetEvent (init_event);
-      return TRUE;
-    case WM_COMMAND:
-      return HANDLE_WM_COMMAND (h, wParam, lParam, dialog_cmd);
-    }
-  return FALSE;
-}
-
-static WINAPI DWORD
-dialog (void *)
-{
-  int rv = 0;
-  MSG m;
-  HWND ins_dialog = CreateDialog (hinstance, MAKEINTRESOURCE (IDD_INSTATUS),
-				  0, dialog_proc);
-  if (ins_dialog == 0)
-    fatal ("create dialog");
-  ShowWindow (ins_dialog, SW_SHOWNORMAL);
-  UpdateWindow (ins_dialog);
-  while (GetMessage (&m, 0, 0, 0) > 0)
-    {
-      TranslateMessage (&m);
-      DispatchMessage (&m);
-    }
-  return rv;
-}
-
 static void
 init_dialog ()
 {
-  if (ins_dialog == 0)
-    {
-      DWORD tid;
-      HANDLE thread;
-      init_event = CreateEvent (0, 0, 0, 0);
-      thread = CreateThread (0, 0, dialog, 0, 0, &tid);
-      WaitForSingleObject (init_event, 10000);
-      CloseHandle (init_event);
-      SendMessage (ins_pprogress, PBM_SETRANGE, 0, MAKELPARAM (0, 100));
-      SendMessage (ins_iprogress, PBM_SETRANGE, 0, MAKELPARAM (0, 100));
-      SendMessage (ins_diskfull, PBM_SETRANGE, 0, MAKELPARAM (0, 100));
-    }
-
-  SetWindowText (ins_pkgname, "");
-  SetWindowText (ins_filename, "");
-  SendMessage (ins_pprogress, PBM_SETPOS, (WPARAM) 0, 0);
-  SendMessage (ins_iprogress, PBM_SETPOS, (WPARAM) 0, 0);
-  SendMessage (ins_diskfull, PBM_SETPOS, (WPARAM) 0, 0);
-  ShowWindow (ins_dialog, SW_SHOWNORMAL);
+  Progress.SetText2("");
+  Progress.SetText3("");
 }
 
 static void
 progress (int bytes)
 {
-  int perc;
-
-  if (package_bytes > 100)
-    {
-      perc = bytes / (package_bytes / 100);
-      SendMessage (ins_pprogress, PBM_SETPOS, (WPARAM) perc, 0);
-    }
+  if(package_bytes > 0)
+  {
+	Progress.SetBar1(bytes, package_bytes);
+  }
 
-  if (total_bytes > 100)
-    {
-      perc = (total_bytes_sofar + bytes) / (total_bytes / 100);
-      SendMessage (ins_iprogress, PBM_SETPOS, (WPARAM) perc, 0);
-    }
+  if(total_bytes > 0)
+  {
+    Progress.SetBar2(total_bytes_sofar + bytes, total_bytes);
+  }
 }
 
 static const char *standard_dirs[] = {
@@ -194,9 +118,9 @@ uninstall_one (packagemeta * pkgm)
 {
   if (pkgm)
     {
-      SetWindowText (ins_pkgname, pkgm->name);
-      SetWindowText (ins_action, "Uninstalling...");
-      log (0, "Uninstalling %s", pkgm->name);
+	  Progress.SetText1("Uninstalling...");
+	  Progress.SetText2(pkgm->name);
+     log (0, "Uninstalling %s", pkgm->name);
       pkgm->uninstall ();
       num_uninstalls++;
     }
@@ -210,10 +134,10 @@ install_one_source (packagemeta & pkgm, 
 		    char const *prefix, package_type_t type)
 {
   int errors = 0;
-  SetWindowText (ins_pkgname, source.Base ());
+  Progress.SetText2(source.Base ());
   if (!io_stream::exists (source.Cached ()))
     {
-      note (IDS_ERR_OPEN_READ, source.Cached (), "No such file");
+      note (NULL, IDS_ERR_OPEN_READ, source.Cached (), "No such file");
       return 1;
     }
   io_stream *lst = 0;
@@ -235,7 +159,7 @@ install_one_source (packagemeta & pkgm, 
 
   char msg[64];
   strcpy (msg, "Installing");
-  SetWindowText (ins_action, msg);
+  Progress.SetText1(msg);
   log (0, "%s%s", msg, source.Cached ());
   io_stream *tmp = io_stream::open (source.Cached (), "rb");
   archive *thefile = 0;
@@ -257,7 +181,7 @@ install_one_source (packagemeta & pkgm, 
 	    lst->write (concat (fn, "\n", 0), strlen (fn) + 1);
 
 	  /* FIXME: concat leaks memory */
-	  SetWindowText (ins_filename, concat (prefix, fn, 0));
+	  Progress.SetText3(concat (prefix, fn, 0));
 	  log (LOG_BABBLE, "Installing file %s%s", prefix, fn);
 	  if (archive::extract_file (thefile, prefix) != 0)
 	    {
@@ -277,7 +201,7 @@ install_one_source (packagemeta & pkgm, 
   progress (0);
 
   int df = diskfull (get_root_dir ());
-  SendMessage (ins_diskfull, PBM_SETPOS, (WPARAM) df, 0);
+  Progress.SetBar3(df);
 
   if (lst)
     delete lst;
@@ -378,8 +302,8 @@ check_for_old_cygwin ()
   return;
 }
 
-void
-do_install (HINSTANCE h)
+static void
+do_install_thread (HINSTANCE h, HWND owner)
 {
   int i;
   int errors = 0;
@@ -401,15 +325,13 @@ do_install (HINSTANCE h)
   io_stream *utmp = io_stream::open ("cygfile:///var/run/utmp", "wb");
   delete utmp;
 
-  dismiss_url_status_dialog ();
-
   init_dialog ();
 
   total_bytes = 0;
   total_bytes_sofar = 0;
 
   int df = diskfull (get_root_dir ());
-  SendMessage (ins_diskfull, PBM_SETPOS, (WPARAM) df, 0);
+  Progress.SetBar3(df);
 
   int istext = (root_text == IDC_ROOT_TEXT) ? 1 : 0;
   int issystem = (root_scope == IDC_ROOT_SYSTEM) ? 1 : 0;
@@ -451,15 +373,13 @@ do_install (HINSTANCE h)
 	}
     }				// end of big package loop
 
-  ShowWindow (ins_dialog, SW_HIDE);
-
   int temperr;
   if ((temperr = db.flush ()))
     {
       const char *err = strerror (temperr);
       if (!err)
 	err = "(unknown error)";
-      fatal (IDS_ERR_OPEN_WRITE, err);
+      fatal (owner, IDS_ERR_OPEN_WRITE, err);
     }
 
   if (!errors)
@@ -479,4 +399,29 @@ do_install (HINSTANCE h)
     exit_msg = IDS_INSTALL_INCOMPLETE;
   else
     exit_msg = IDS_INSTALL_COMPLETE;
+}
+
+static void
+do_install_reflector(void* p)
+{
+	HANDLE *context;
+	context = (HANDLE*)p;
+
+	do_install_thread((HINSTANCE)context[0], (HWND)context[1]);
+
+	// Tell the progress page that we're done downloading
+	Progress.PostMessage(WM_APP_INSTALL_THREAD_COMPLETE, next_dialog);
+
+	_endthread();
+}
+
+static HANDLE context[2];
+
+void
+do_install (HINSTANCE h, HWND owner)
+{
+	context[0] = h;
+	context[1] = owner;
+
+	_beginthread(do_install_reflector, 0, context);
 }
Index: localdir.cc
===================================================================
RCS file: /cvs/src/src/winsup/cinstall/localdir.cc,v
retrieving revision 2.5
diff -p -u -r2.5 localdir.cc
--- localdir.cc	2001/11/14 00:11:35	2.5
+++ localdir.cc	2001/12/19 10:59:55
@@ -39,6 +39,8 @@ static const char *cvsid =
 #include "mkdir.h"
 #include "io_stream.h"
 
+#include "localdir.h"
+
 void
 save_local_dir ()
 {
@@ -129,6 +131,7 @@ dialog_cmd (HWND h, int id, HWND hwndctl
       browse (h);
       break;
 
+#if 0
     case IDOK:
       save_dialog (h);
       save_local_dir ();
@@ -150,7 +153,7 @@ dialog_cmd (HWND h, int id, HWND hwndctl
 	    }
 	}
       else
-	note (IDS_ERR_CHDIR, local_dir);
+	note (h, IDS_ERR_CHDIR, local_dir);
 
       break;
 
@@ -174,10 +177,12 @@ dialog_cmd (HWND h, int id, HWND hwndctl
     case IDCANCEL:
       NEXT (0);
       break;
+#endif
     }
   return 0;
 }
 
+#if 0
 static BOOL CALLBACK
 dialog_proc (HWND h, UINT message, WPARAM wParam, LPARAM lParam)
 {
@@ -191,11 +196,13 @@ dialog_proc (HWND h, UINT message, WPARA
     }
   return FALSE;
 }
+#endif
 
 extern char cwd[_MAX_PATH];
 
+#if 0
 void
-do_local_dir (HINSTANCE h)
+do_local_dir (HINSTANCE h, HWND owner)
 {
   static int inited = 0;
   if (!inited)
@@ -219,9 +226,76 @@ do_local_dir (HINSTANCE h)
     }
 
   int rv = 0;
-  rv = DialogBox (h, MAKEINTRESOURCE (IDD_LOCAL_DIR), 0, dialog_proc);
+  rv = DialogBox (h, MAKEINTRESOURCE (IDD_LOCAL_DIR), owner, dialog_proc);
   if (rv == -1)
-    fatal (IDS_DIALOG_FAILED);
+    fatal (owner, IDS_DIALOG_FAILED);
 
   log (0, "Selected local directory: %s", local_dir);
+}
+#endif
+
+////
+
+bool LocalDirPage::Create()
+{
+	return PropertyPage::Create(NULL, dialog_cmd, IDD_LOCAL_DIR);
+}
+
+void LocalDirPage::OnInit()
+{
+  static int inited = 0;
+	  if (!inited)
+		{
+		  io_stream *f =
+		io_stream::open ("cygfile:///etc/setup/last-cache", "rt");
+		  if (!f)
+		f = io_stream::open ("file://last-cache", "rt");
+		  if (f)
+		{
+		  char localdir[1000];
+		  char *fg_ret = f->gets (localdir, 1000);
+		  delete f;
+		  if (fg_ret)
+			{
+			  free (local_dir);
+			  local_dir = strdup (localdir);
+			}
+		}
+		  inited = 1;
+		}
+}
+
+void LocalDirPage::OnActivate()
+{
+  load_dialog (GetHWND());
+}
+
+long LocalDirPage::OnNext()
+{
+  HWND h = GetHWND();
+
+  save_dialog (h);
+  save_local_dir ();
+  if (SetCurrentDirectoryA (local_dir))
+  {
+	if (source == IDC_SOURCE_CWD)
+	{
+	  return IDD_S_FROM_CWD;
+	}
+  }
+  else
+  note (h, IDS_ERR_CHDIR, local_dir);
+
+  return 0;
+}
+
+long LocalDirPage::OnBack()
+{
+	save_dialog (GetHWND());
+    if(source == IDC_SOURCE_DOWNLOAD)
+	{
+		// Downloading only, skip the unix root page
+		return IDD_SOURCE;
+	}
+	return 0;
 }
Index: log.cc
===================================================================
RCS file: /cvs/src/src/winsup/cinstall/log.cc,v
retrieving revision 2.5
diff -p -u -r2.5 log.cc
--- log.cc	2001/11/13 01:49:32	2.5
+++ log.cc	2001/12/19 10:59:55
@@ -86,7 +86,7 @@ log_save (int babble, const char *filena
   FILE *f = fopen (filename, append ? "at" : "wt");
   if (!f)
     {
-      fatal (IDS_NOLOGFILE, filename);
+      fatal (NULL, IDS_NOLOGFILE, filename);
       return;
     }
 
@@ -115,7 +115,7 @@ exit_setup (int exit_code)
   been_here = 1;
 
   if (exit_msg)
-    note (exit_msg);
+    note (NULL, exit_msg);
 
   log (LOG_TIMESTAMP, "Ending cygwin install");
 
Index: main.cc
===================================================================
RCS file: /cvs/src/src/winsup/cinstall/main.cc,v
retrieving revision 2.9
diff -p -u -r2.9 main.cc
--- main.cc	2001/11/13 01:49:32	2.9
+++ main.cc	2001/12/19 10:59:56
@@ -29,6 +29,7 @@ static const char *cvsid =
 #endif
 
 #include "win32.h"
+#include <commctrl.h>
 
 #include <stdio.h>
 #include <stdlib.h>
@@ -42,7 +43,19 @@ static const char *cvsid =
 #include "version.h"
 
 #include "port.h"
+#include "proppage.h"
+#include "propsheet.h"
 
+// Page class headers
+#include "splash.h"
+#include "source.h"
+#include "localdir.h"
+#include "net.h"
+#include "site.h"
+#include "chooser.h"
+#include "threebar.h"
+#include "desktop.h"
+
 int next_dialog;
 int exit_msg = 0;
 
@@ -123,6 +136,12 @@ out:
   FreeSid (sid);
 }
 
+extern BOOL CALLBACK
+root_dialog_proc (HWND h, UINT message, WPARAM wParam, LPARAM lParam);
+
+// Other threads talk to this page, so we need to have it externable.
+ThreeBarProgressPage Progress;
+
 int WINAPI
 WinMain (HINSTANCE h,
 	 HINSTANCE hPrevInstance, LPSTR command_line, int cmd_show)
@@ -133,6 +152,16 @@ WinMain (HINSTANCE h,
 
   log (LOG_TIMESTAMP, "Starting cygwin install, version %s", version);
 
+  SplashPage Splash;
+  SourcePage Source;
+  PropertyPage Root;
+  LocalDirPage LocalDir;
+  NetPage Net;
+  SitePage Site;
+  ChooserPage Chooser;
+  DesktopSetupPage Desktop;
+  PropSheet MainWindow;
+
   char cwd[_MAX_PATH];
   GetCurrentDirectory (sizeof (cwd), cwd);
   local_dir = strdup (cwd);
@@ -150,58 +179,95 @@ WinMain (HINSTANCE h,
   if (iswinnt)
     set_default_dacl ();
 
+  // Initialize common controls
+  InitCommonControls();
+
+  // Init window class lib
+  Window::SetAppInstance(h);
+
+  // Create pages
+  Splash.Create();
+  Source.Create();
+  Root.Create(root_dialog_proc, IDD_ROOT);
+  LocalDir.Create();
+  Net.Create();
+  Site.Create();
+  Chooser.Create();
+  Progress.Create();
+  Desktop.Create();
+
+  // Add pages to sheet
+  MainWindow.AddPage(&Splash);
+  MainWindow.AddPage(&Source);
+  MainWindow.AddPage(&Root);
+  MainWindow.AddPage(&LocalDir);
+  MainWindow.AddPage(&Net);
+  MainWindow.AddPage(&Site);
+  MainWindow.AddPage(&Chooser);
+  MainWindow.AddPage(&Progress);
+  MainWindow.AddPage(&Desktop);
+
+  // Create the PropSheet main window
+  MainWindow.Create();
+  //MainWindow.Show(SW_SHOWNORMAL);
+
+#if 0
+  HWND owner = NULL;
+
   while (next_dialog)
     {
       switch (next_dialog)
 	{
 	case IDD_SPLASH:
-	  do_splash (h);
+	  do_splash (h, owner);
 	  break;
 	case IDD_SOURCE:
-	  do_source (h);
+	  do_source (h, owner);
 	  break;
 	case IDD_LOCAL_DIR:
-	  do_local_dir (h);
+	  do_local_dir (h, owner);
 	  break;
 	case IDD_ROOT:
-	  do_root (h);
+	  do_root (h, owner);
 	  break;
 	case IDD_NET:
-	  do_net (h);
+	  do_net (h, owner);
 	  break;
 	case IDD_SITE:
-	  do_site (h);
+	  do_site (h, owner);
 	  break;
 	case IDD_OTHER_URL:
-	  do_other (h);
+	  do_other (h, owner);
 	  break;
 	case IDD_S_LOAD_INI:
-	  do_ini (h);
+	  do_ini (h, owner);
 	  break;
 	case IDD_S_FROM_CWD:
-	  do_fromcwd (h);
+	  do_fromcwd (h, owner);
 	  break;
 	case IDD_CHOOSE:
-	  do_choose (h);
+	  do_choose (h, owner);
 	  break;
 	case IDD_S_DOWNLOAD:
-	  do_download (h);
+	  do_download (h, owner);
 	  break;
 	case IDD_S_INSTALL:
-	  do_install (h);
+	  do_install (h, owner);
 	  break;
 	case IDD_DESKTOP:
-	  do_desktop (h);
+	  do_desktop (h, owner);
 	  break;
 	case IDD_S_POSTINSTALL:
-	  do_postinstall (h);
+	  do_postinstall (h, owner);
 	  break;
 
 	default:
 	  next_dialog = 0;
 	  break;
 	}
+
     }
+#endif
 
   exit_setup (0);
   /* Keep gcc happy :} */
Index: msg.cc
===================================================================
RCS file: /cvs/src/src/winsup/cinstall/msg.cc,v
retrieving revision 2.2
diff -p -u -r2.2 msg.cc
--- msg.cc	2001/11/13 01:49:32	2.2
+++ msg.cc	2001/12/19 10:59:56
@@ -38,7 +38,7 @@ msg (const char *fmt, ...)
 }
 
 static int
-mbox (const char *name, int type, int id, va_list args)
+mbox (HWND owner, const char *name, int type, int id, va_list args)
 {
   char buf[1000], fmt[1000];
 
@@ -47,30 +47,30 @@ mbox (const char *name, int type, int id
 
   vsprintf (buf, fmt, args);
   log (0, "mbox %s: %s", name, buf);
-  return MessageBox (0, buf, "Cygwin Setup", type | MB_TOPMOST);
+  return MessageBox (owner, buf, "Cygwin Setup", type /*| MB_TOPMOST*/);
 }
 
 void
-note (int id, ...)
+note (HWND owner, int id, ...)
 {
   va_list args;
   va_start (args, id);
-  mbox ("note", 0, id, args);
+  mbox (owner, "note", 0, id, args);
 }
 
 void
-fatal (int id, ...)
+fatal (HWND owner, int id, ...)
 {
   va_list args;
   va_start (args, id);
-  mbox ("fatal", 0, id, args);
+  mbox (owner, "fatal", 0, id, args);
   exit_setup (1);
 }
 
 int
-yesno (int id, ...)
+yesno (HWND owner, int id, ...)
 {
   va_list args;
   va_start (args, id);
-  return mbox ("yesno", MB_YESNO, id, args);
+  return mbox (owner, "yesno", MB_YESNO, id, args);
 }
Index: msg.h
===================================================================
RCS file: /cvs/src/src/winsup/cinstall/msg.h,v
retrieving revision 2.1
diff -p -u -r2.1 msg.h
--- msg.h	2001/11/13 01:49:32	2.1
+++ msg.h	2001/12/19 10:59:56
@@ -23,11 +23,11 @@ void msg (const char *fmt, ...);
    is interpreted like printf.  The program exits when the user
    presses OK. */
 
-void fatal (int id, ...);
+void fatal (HWND owner, int id, ...);
 
 /* Similar, but the program continues when the user presses OK */
 
-void note (int id, ...);
+void note (HWND owner, int id, ...);
 
 /* returns IDYES or IDNO, otherwise same as note() */
-int yesno (int id, ...);
+int yesno (HWND owner, int id, ...);
Index: net.cc
===================================================================
RCS file: /cvs/src/src/winsup/cinstall/net.cc,v
retrieving revision 2.7
diff -p -u -r2.7 net.cc
--- net.cc	2001/11/13 01:49:32	2.7
+++ net.cc	2001/12/19 10:59:56
@@ -30,6 +30,11 @@ static const char *cvsid =
 #include "msg.h"
 #include "log.h"
 
+#include "net.h"
+
+#include "threebar.h"
+extern ThreeBarProgressPage Progress;
+
 static int rb[] = { IDC_NET_IE5, IDC_NET_DIRECT, IDC_NET_PROXY, 0 };
 
 static void
@@ -85,6 +90,7 @@ dialog_cmd (HWND h, int id, HWND hwndctl
       check_if_enable_next (h);
       break;
 
+#if 0
     case IDOK:
       save_dialog (h);
       switch (source)
@@ -110,16 +116,19 @@ dialog_cmd (HWND h, int id, HWND hwndctl
     case IDCANCEL:
       NEXT (0);
       break;
+#endif
     }
   return 0;
 }
 
+#if 0
 static BOOL CALLBACK
 dialog_proc (HWND h, UINT message, WPARAM wParam, LPARAM lParam)
 {
   switch (message)
     {
     case WM_INITDIALOG:
+  net_method = IDC_NET_DIRECT;
       load_dialog (h);
 
       // Check to see if any radio buttons are selected. If not, select a default.
@@ -139,16 +148,60 @@ dialog_proc (HWND h, UINT message, WPARA
 }
 
 void
-do_net (HINSTANCE h)
+do_net (HINSTANCE h, HWND owner)
 {
   int rv = 0;
 
-  net_method = IDC_NET_DIRECT;
-  rv = DialogBox (h, MAKEINTRESOURCE (IDD_NET), 0, dialog_proc);
+  rv = DialogBox (h, MAKEINTRESOURCE (IDD_NET), owner, dialog_proc);
   if (rv == -1)
-    fatal (IDS_DIALOG_FAILED);
+    fatal (owner, IDS_DIALOG_FAILED);
 
   log (0, "net: %s",
        (net_method == IDC_NET_IE5) ? "IE5" :
        (net_method == IDC_NET_DIRECT) ? "Direct" : "Proxy");
+}
+#endif
+
+/////////////////////////////////
+
+bool NetPage::Create()
+{
+	return PropertyPage::Create(NULL, dialog_cmd, IDD_NET);
+}
+
+void NetPage::OnInit()
+{
+	HWND h = GetHWND();
+	
+	net_method = IDC_NET_DIRECT;
+	load_dialog (h);
+
+	// Check to see if any radio buttons are selected. If not, select a default.
+	if (
+	(!SendMessage (GetDlgItem (IDC_NET_IE5), BM_GETCHECK, 0, 0) ==
+		BST_CHECKED)
+	&& (!SendMessage (GetDlgItem (IDC_NET_PROXY), BM_GETCHECK, 0, 0)
+	  == BST_CHECKED))
+	{
+		SendMessage (GetDlgItem (IDC_NET_DIRECT), BM_CLICK, 0, 0);
+	}
+}
+
+void NetPage::OnDeactivate()
+{
+	//save_dialog (h);
+}
+
+long NetPage::OnNext()
+{
+	save_dialog (GetHWND());
+
+	Progress.SetActivateTask(WM_APP_START_SITE_INFO_DOWNLOAD);
+	return IDD_INSTATUS;
+}
+
+long NetPage::OnBack()
+{
+	save_dialog (GetHWND());
+	return 0;
 }
Index: netio.cc
===================================================================
RCS file: /cvs/src/src/winsup/cinstall/netio.cc,v
retrieving revision 2.5
diff -p -u -r2.5 netio.cc
--- netio.cc	2001/12/02 03:25:11	2.5
+++ netio.cc	2001/12/19 10:59:57
@@ -229,29 +229,29 @@ auth_proc (HWND h, UINT message, WPARAM 
 }
 
 static int
-auth_common (HINSTANCE h, int id)
+auth_common (HINSTANCE h, int id, HWND owner)
 {
-  return DialogBox (h, MAKEINTRESOURCE (id), 0, auth_proc);
+  return DialogBox (h, MAKEINTRESOURCE (id), owner, auth_proc);
 }
 
 int
-NetIO::get_auth ()
+NetIO::get_auth (HWND owner)
 {
   user = &net_user;
   passwd = &net_passwd;
-  return auth_common (hinstance, IDD_NET_AUTH);
+  return auth_common (hinstance, IDD_NET_AUTH, owner);
 }
 
 int
-NetIO::get_proxy_auth ()
+NetIO::get_proxy_auth (HWND owner)
 {
   user = &net_proxy_user;
   passwd = &net_proxy_passwd;
-  return auth_common (hinstance, IDD_PROXY_AUTH);
+  return auth_common (hinstance, IDD_PROXY_AUTH, owner);
 }
 
 int
-NetIO::get_ftp_auth ()
+NetIO::get_ftp_auth (HWND owner)
 {
   if (net_ftp_user)
     {
@@ -267,5 +267,5 @@ NetIO::get_ftp_auth ()
     return IDCANCEL;
   user = &net_ftp_user;
   passwd = &net_ftp_passwd;
-  return auth_common (hinstance, IDD_FTP_AUTH);
+  return auth_common (hinstance, IDD_FTP_AUTH, owner);
 }
Index: netio.h
===================================================================
RCS file: /cvs/src/src/winsup/cinstall/netio.h,v
retrieving revision 2.4
diff -p -u -r2.4 netio.h
--- netio.h	2001/12/02 03:25:11	2.4
+++ netio.h	2001/12/19 10:59:57
@@ -50,7 +50,7 @@ public:
   /* Helper functions for http/ftp protocols.  Both return nonzero for
      "cancel", zero for "ok".  They set net_proxy_user, etc, in
      state.h */
-  int get_auth ();
-  int get_proxy_auth ();
-  int get_ftp_auth ();
+  int get_auth (HWND owner);
+  int get_proxy_auth (HWND owner);
+  int get_ftp_auth (HWND owner);
 };
Index: nio-file.cc
===================================================================
RCS file: /cvs/src/src/winsup/cinstall/nio-file.cc,v
retrieving revision 2.4
diff -p -u -r2.4 nio-file.cc
--- nio-file.cc	2001/12/02 03:25:11	2.4
+++ nio-file.cc	2001/12/19 10:59:57
@@ -45,7 +45,7 @@ NetIO (Purl)
       const char *err = strerror (errno);
       if (!err)
 	err = "(unknown error)";
-      note (IDS_ERR_OPEN_READ, path, err);
+      note (NULL, IDS_ERR_OPEN_READ, path, err);
     }
 }
 
Index: nio-ftp.cc
===================================================================
RCS file: /cvs/src/src/winsup/cinstall/nio-ftp.cc,v
retrieving revision 2.8
diff -p -u -r2.8 nio-ftp.cc
--- nio-ftp.cc	2001/12/02 03:25:11	2.8
+++ nio-ftp.cc	2001/12/19 10:59:57
@@ -95,7 +95,7 @@ NetIO_FTP::NetIO_FTP (char const *Purl, 
 	}
       if (code == 530)		/* Authentication failed, retry */
 	{
-	  get_ftp_auth ();
+	  get_ftp_auth (NULL);
 	  if (net_ftp_user && net_ftp_passwd)
 	    goto auth_retry;
 	}
Index: nio-http.cc
===================================================================
RCS file: /cvs/src/src/winsup/cinstall/nio-http.cc,v
retrieving revision 2.9
diff -p -u -r2.9 nio-http.cc
--- nio-http.cc	2001/12/02 03:25:11	2.9
+++ nio-http.cc	2001/12/19 11:00:01
@@ -148,14 +148,14 @@ retry_get:
     }
   if (code == 401)		/* authorization required */
     {
-      get_auth ();
+      get_auth (NULL);
       delete
 	s;
       goto retry_get;
     }
   if (code == 407)		/* proxy authorization required */
     {
-      get_proxy_auth ();
+      get_proxy_auth (NULL);
       delete
 	s;
       goto retry_get;
@@ -163,7 +163,7 @@ retry_get:
   if (code == 500		/* ftp authentication through proxy required */
       && net_method == IDC_NET_PROXY && !strncmp (url, "ftp://", 6))
     {
-      get_ftp_auth ();
+      get_ftp_auth (NULL);
       if (net_ftp_user && net_ftp_passwd)
 	{
 	  delete
Index: nio-ie5.cc
===================================================================
RCS file: /cvs/src/src/winsup/cinstall/nio-ie5.cc,v
retrieving revision 2.4
diff -p -u -r2.4 nio-ie5.cc
--- nio-ie5.cc	2001/12/02 03:25:11	2.4
+++ nio-ie5.cc	2001/12/19 11:00:01
@@ -44,7 +44,7 @@ NetIO (_url)
       HINSTANCE h = LoadLibrary ("wininet.dll");
       if (!h)
 	{
-	  note (IDS_WININET);
+	  note (NULL, IDS_WININET);
 	  connection = 0;
 	  return;
 	}
@@ -112,14 +112,14 @@ try_again:
 	  if (type == 401)	/* authorization required */
 	    {
 	      flush_io ();
-	      get_auth ();
+	      get_auth (NULL);
 	      resend = 1;
 	      goto try_again;
 	    }
 	  else if (type == 407)	/* proxy authorization required */
 	    {
 	      flush_io ();
-	      get_proxy_auth ();
+	      get_proxy_auth (NULL);
 	      resend = 1;
 	      goto try_again;
 	    }
Index: other.cc
===================================================================
RCS file: /cvs/src/src/winsup/cinstall/other.cc,v
retrieving revision 2.3
diff -p -u -r2.3 other.cc
--- other.cc	2001/12/03 22:22:09	2.3
+++ other.cc	2001/12/19 11:00:01
@@ -103,12 +103,12 @@ dialog_proc (HWND h, UINT message, WPARA
 }
 
 void
-do_other (HINSTANCE h)
+do_other (HINSTANCE h, HWND owner)
 {
   int rv = 0;
-  rv = DialogBox (h, MAKEINTRESOURCE (IDD_OTHER_URL), 0, dialog_proc);
+  rv = DialogBox (h, MAKEINTRESOURCE (IDD_OTHER_URL), owner, dialog_proc);
   if (rv == -1)
-    fatal (IDS_DIALOG_FAILED);
+    fatal (owner, IDS_DIALOG_FAILED);
 
   log (0, "site: %s", other_url);
 }
Index: package_db.cc
===================================================================
RCS file: /cvs/src/src/winsup/cinstall/package_db.cc,v
retrieving revision 2.11
diff -p -u -r2.11 package_db.cc
--- package_db.cc	2001/12/03 22:52:01	2.11
+++ package_db.cc	2001/12/19 11:00:02
@@ -22,7 +22,6 @@
 static const char *cvsid =
   "\n%%% $Id: package_db.cc,v 2.11 2001/12/03 22:52:01 rbcollins Exp $\n";
 #endif
-
 #include <stdio.h>
 #include <stdlib.h>
 #include <unistd.h>
Index: package_meta.cc
===================================================================
RCS file: /cvs/src/src/winsup/cinstall/package_meta.cc,v
retrieving revision 2.7
diff -p -u -r2.7 package_meta.cc
--- package_meta.cc	2001/12/02 03:25:11	2.7
+++ package_meta.cc	2001/12/19 11:00:02
@@ -151,5 +151,6 @@ packagemeta::add_category (Category & ca
 char const *
 packagemeta::SDesc ()
 {
-  return versions[1]->SDesc ();
+  //return versions[1]->SDesc ();
+	return sdesc;
 };
Index: package_meta.h
===================================================================
RCS file: /cvs/src/src/winsup/cinstall/package_meta.h,v
retrieving revision 2.7
diff -p -u -r2.7 package_meta.h
--- package_meta.h	2001/12/02 03:25:11	2.7
+++ package_meta.h	2001/12/19 11:00:03
@@ -85,6 +85,7 @@ public:
   char *installed_from;
   /* SDesc is global in theory, across all package versions. 
      LDesc is not: it can be different per version */
+  char *sdesc;
   char const *SDesc ();
   /* what categories does this package belong in. Note that if multiple versions
    * of a package disagree.... the first one read in will take precedence.
Index: postinstall.cc
===================================================================
RCS file: /cvs/src/src/winsup/cinstall/postinstall.cc,v
retrieving revision 2.4
diff -p -u -r2.4 postinstall.cc
--- postinstall.cc	2001/11/13 01:49:32	2.4
+++ postinstall.cc	2001/12/19 11:00:03
@@ -98,7 +98,7 @@ static const char *shells[] = {
 };
 
 void
-do_postinstall (HINSTANCE h)
+do_postinstall (HINSTANCE h, HWND owner)
 {
   next_dialog = 0;
   int i;
Index: res.rc
===================================================================
RCS file: /cvs/src/src/winsup/cinstall/res.rc,v
retrieving revision 2.31
diff -p -u -r2.31 res.rc
--- res.rc	2001/12/03 22:22:09	2.31
+++ res.rc	2001/12/19 11:00:04
@@ -29,7 +29,7 @@ LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_U
 //
 
 IDD_SOURCE DIALOG DISCARDABLE  0, 0, 215, 95
-STYLE DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU
+STYLE DS_MODALFRAME | DS_CENTER | WS_CHILD | WS_CAPTION | WS_SYSMENU
 CAPTION "Cygwin Setup"
 FONT 8, "MS Sans Serif"
 BEGIN
@@ -40,26 +40,21 @@ BEGIN
                     BS_AUTORADIOBUTTON,55,30,89,10
     CONTROL         "Install from &Local Directory",IDC_SOURCE_CWD,"Button",
                     BS_AUTORADIOBUTTON,55,45,99,10
-    DEFPUSHBUTTON   "&Next -->",IDOK,100,75,45,15
-    PUSHBUTTON      "Cancel",IDCANCEL,165,75,45,15
 END
 
-IDD_LOCAL_DIR DIALOG DISCARDABLE  0, 0, 215, 95
-STYLE DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU
+IDD_LOCAL_DIR DIALOG DISCARDABLE  0, 0, 227, 94
+STYLE DS_MODALFRAME | DS_CENTER | WS_CHILD | WS_CAPTION | WS_SYSMENU
 CAPTION "Cygwin Setup"
 FONT 8, "MS Sans Serif"
 BEGIN
     ICON            IDI_CYGWIN,IDC_STATIC,5,5,20,20
-    PUSHBUTTON      "B&rowse...",IDC_LOCAL_DIR_BROWSE,150,10,34,14
+    PUSHBUTTON      "B&rowse...",IDC_LOCAL_DIR_BROWSE,185,30,34,14
     LTEXT           "Local Package &Directory",IDC_STATIC,55,15,85,11
-    EDITTEXT        IDC_LOCAL_DIR,55,25,127,12,ES_AUTOHSCROLL
-    DEFPUSHBUTTON   "&Next -->",IDOK,100,75,45,15
-    PUSHBUTTON      "Cancel",IDCANCEL,165,75,45,15
-    PUSHBUTTON      "<-- &Back",IDC_BACK,55,75,45,15
+    EDITTEXT        IDC_LOCAL_DIR,55,30,127,15,ES_AUTOHSCROLL
 END
 
 IDD_ROOT DIALOG DISCARDABLE  0, 0, 215, 95
-STYLE DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU
+STYLE DS_MODALFRAME | DS_CENTER | WS_CHILD | WS_CAPTION | WS_SYSMENU
 CAPTION "Cygwin Setup"
 FONT 8, "MS Sans Serif"
 BEGIN
@@ -77,23 +72,17 @@ BEGIN
                     WS_GROUP,125,60,25,8
     CONTROL         "Just &Me",IDC_ROOT_USER,"Button",BS_AUTORADIOBUTTON,160,
                     60,50,8
-    DEFPUSHBUTTON   "&Next -->",IDOK,100,75,45,15
-    PUSHBUTTON      "Cancel",IDCANCEL,165,75,45,15
-    PUSHBUTTON      "<-- &Back",IDC_BACK,55,75,45,15
 END
 
-IDD_SITE DIALOG DISCARDABLE  0, 0, 222, 206
-STYLE DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU
+IDD_SITE DIALOG DISCARDABLE  0, 0, 247, 94
+STYLE DS_MODALFRAME | DS_CENTER | WS_CHILD | WS_CAPTION | WS_SYSMENU
 CAPTION "Cygwin Setup"
 FONT 8, "MS Sans Serif"
 BEGIN
     ICON            IDI_CYGWIN,IDC_STATIC,5,5,20,20
-    LTEXT           "Select Download &Sites",IDC_STATIC,55,5,135,11
-    LISTBOX         IDC_URL_LIST,55,20,160,155,LBS_NOINTEGRALHEIGHT | 
-    		    LBS_EXTENDEDSEL | WS_VSCROLL | WS_HSCROLL | WS_TABSTOP
-    DEFPUSHBUTTON   "&Next -->",IDOK,105,185,45,15
-    PUSHBUTTON      "Cancel",IDCANCEL,170,185,45,15
-    PUSHBUTTON      "<-- &Back",IDC_BACK,60,185,45,15
+    LTEXT           "Select Download &Site",IDC_STATIC,55,5,135,11
+    LISTBOX         IDC_URL_LIST,55,20,185,65,LBS_NOINTEGRALHEIGHT | 
+                    LBS_EXTENDEDSEL | WS_VSCROLL | WS_HSCROLL | WS_TABSTOP
 END
 
 IDD_OTHER_URL DIALOG DISCARDABLE  0, 0, 215, 95
@@ -109,32 +98,31 @@ BEGIN
     PUSHBUTTON      "<-- &Back",IDC_BACK,55,75,45,15
 END
 
-IDD_NET DIALOGEX 0, 0, 215, 95
-STYLE DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU
+IDD_NET DIALOG DISCARDABLE  0, 0, 247, 106
+STYLE DS_MODALFRAME | DS_CENTER | WS_CHILD | WS_CAPTION | WS_SYSMENU
 CAPTION "Cygwin Setup"
 FONT 8, "MS Sans Serif"
 BEGIN
-    ICON            IDI_CYGWIN,IDC_STATIC,5,5,20,20
     CONTROL         "&Direct Connection",IDC_NET_DIRECT,"Button",
-                    BS_AUTORADIOBUTTON,55,10,73,10
+                    BS_AUTORADIOBUTTON | WS_GROUP | WS_TABSTOP,55,10,73,10
     CONTROL         "Use &IE5 Settings",IDC_NET_IE5,"Button",
-                    BS_AUTORADIOBUTTON,55,25,69,10
+                    BS_AUTORADIOBUTTON | WS_TABSTOP,55,25,69,10
     CONTROL         "Use HTTP/FTP &Proxy:",IDC_NET_PROXY,"Button",
-                    BS_AUTORADIOBUTTON,55,40,88,10
-    LTEXT           "Proxy &Host",IDC_STATIC,10,55,50,15,SS_CENTERIMAGE,
-                    WS_EX_RIGHT
-    EDITTEXT        IDC_PROXY_HOST,65,55,80,12,ES_AUTOHSCROLL | WS_DISABLED
-    LTEXT           "Por&t",IDC_STATIC,155,55,20,15,SS_CENTERIMAGE,
-                    WS_EX_RIGHT
-    EDITTEXT        IDC_PROXY_PORT,180,55,30,12,ES_AUTOHSCROLL | WS_DISABLED
-    DEFPUSHBUTTON   "&Next -->",IDOK,100,75,45,15
-    PUSHBUTTON      "Cancel",IDCANCEL,165,75,45,15
-    PUSHBUTTON      "<-- &Back",IDC_BACK,55,75,45,15
+                    BS_AUTORADIOBUTTON | WS_TABSTOP,55,40,88,10
+    EDITTEXT        IDC_PROXY_HOST,115,60,120,12,ES_AUTOHSCROLL | 
+                    WS_DISABLED | WS_GROUP
+    EDITTEXT        IDC_PROXY_PORT,115,80,30,12,ES_AUTOHSCROLL | WS_DISABLED
+    GROUPBOX        "",IDC_STATIC,55,50,185,50
+    ICON            IDI_CYGWIN,IDC_STATIC,5,5,21,20
+    RTEXT           "Proxy &Host",IDC_STATIC,60,60,50,12,SS_CENTERIMAGE | 
+                    NOT WS_GROUP
+    RTEXT           "Por&t",IDC_STATIC,80,80,30,12,SS_CENTERIMAGE | NOT 
+                    WS_GROUP
 END
 
 IDD_DLSTATUS DIALOG DISCARDABLE  0, 0, 215, 95
-STYLE DS_MODALFRAME | DS_SETFOREGROUND | DS_CENTER | WS_POPUP | WS_VISIBLE | 
-    WS_CAPTION | WS_SYSMENU
+STYLE DS_MODALFRAME | DS_CENTER | WS_CHILD | WS_VISIBLE | WS_CAPTION | 
+    WS_SYSMENU
 CAPTION "Cygwin Setup"
 FONT 8, "MS Sans Serif"
 BEGIN
@@ -154,26 +142,25 @@ BEGIN
     RTEXT           "Disk",IDC_DLS_IPROGRESS_TEXT,5,60,45,8
 END
 
-IDD_INSTATUS DIALOG DISCARDABLE  0, 0, 215, 95
-STYLE DS_MODALFRAME | DS_SETFOREGROUND | DS_CENTER | WS_POPUP | WS_VISIBLE | 
-    WS_CAPTION | WS_SYSMENU
+IDD_INSTATUS DIALOG DISCARDABLE  0, 0, 252, 94
+STYLE DS_MODALFRAME | DS_CENTER | WS_CHILD | WS_VISIBLE | WS_CAPTION | 
+    WS_SYSMENU
 CAPTION "Cygwin Setup"
 FONT 8, "MS Sans Serif"
 BEGIN
-    ICON            IDI_CYGWIN,IDC_STATIC,5,5,20,20
-    PUSHBUTTON      "Cancel",IDCANCEL,165,75,45,15
+    ICON            IDI_CYGWIN,IDC_STATIC,5,5,21,20
     LTEXT           "Installing...",IDC_INS_ACTION,55,5,135,8
     LTEXT           "(PKG)",IDC_INS_PKG,55,15,150,8
     LTEXT           "(FILE)",IDC_INS_FILE,55,25,155,8
     CONTROL         "Progress1",IDC_INS_DISKFULL,"msctls_progress32",
-                    PBS_SMOOTH | WS_BORDER,55,60,155,10
+                    PBS_SMOOTH | WS_BORDER,90,60,155,10
     CONTROL         "Progress1",IDC_INS_IPROGRESS,"msctls_progress32",
-                    PBS_SMOOTH | WS_BORDER,55,50,155,10
+                    PBS_SMOOTH | WS_BORDER,90,50,155,10
     CONTROL         "Progress1",IDC_INS_PPROGRESS,"msctls_progress32",
-                    PBS_SMOOTH | WS_BORDER,55,40,155,10
-    RTEXT           "Package",IDC_STATIC,5,40,45,8
-    RTEXT           "Total",IDC_STATIC,10,50,40,8
-    RTEXT           "Disk",IDC_STATIC,5,60,45,8
+                    PBS_SMOOTH | WS_BORDER,90,40,155,10
+    RTEXT           "Package",IDC_INS_BL_PACKAGE,40,40,45,8
+    RTEXT           "Total",IDC_INS_BL_TOTAL,45,50,40,8
+    RTEXT           "Disk",IDC_INS_BL_DISK,40,60,45,8
 END
 
 IDD_PROXY_AUTH DIALOG DISCARDABLE  0, 0, 215, 95
@@ -210,8 +197,9 @@ BEGIN
     PUSHBUTTON      "Cancel",IDCANCEL,165,75,45,15
 END
 
-IDD_SPLASH DIALOG DISCARDABLE  0, 0, 215, 95
-STYLE DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU
+IDD_SPLASH DIALOG DISCARDABLE  0, 0, 216, 94
+STYLE DS_MODALFRAME | DS_3DLOOK | DS_CENTER | WS_CHILD | WS_VISIBLE | 
+    WS_CAPTION | WS_SYSMENU
 CAPTION "Cygwin Setup"
 FONT 8, "MS Sans Serif"
 BEGIN
@@ -223,17 +211,15 @@ BEGIN
                     8
     LTEXT           "http://sources.redhat.com/cygwin/",IDC_STATIC,55,50,112,
                     8
-    DEFPUSHBUTTON   "&Next -->",IDOK,100,75,45,15
-    PUSHBUTTON      "Cancel",IDCANCEL,165,75,45,15
 END
 
-IDD_CHOOSE DIALOG DISCARDABLE  0, 0, 429, 266
-STYLE DS_MODALFRAME | DS_3DLOOK | DS_CENTER | WS_POPUP | WS_CAPTION | 
+IDD_CHOOSE DIALOG DISCARDABLE  0, 0, 430, 266
+STYLE DS_MODALFRAME | DS_3DLOOK | DS_CENTER | WS_CHILD | WS_CAPTION | 
     WS_SYSMENU
 CAPTION "Cygwin Setup"
 FONT 8, "MS Sans Serif"
 BEGIN
-    ICON            IDI_CYGWIN,IDC_STATIC,0,2,21,20
+    ICON            IDI_CYGWIN,IDC_STATIC,0,2,20,20
     LTEXT           "Select packages to install",IDC_CHOOSE_INST_TEXT,125,5,
                     99,8
     CONTROL         "",IDC_LISTVIEW_POS,"Static",SS_BLACKFRAME | NOT 
@@ -255,7 +241,8 @@ BEGIN
 END
 
 IDD_DESKTOP DIALOG DISCARDABLE  0, 0, 215, 95
-STYLE DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU
+STYLE DS_MODALFRAME | DS_3DLOOK | DS_CENTER | WS_CHILD | WS_VISIBLE | 
+    WS_CAPTION | WS_SYSMENU
 CAPTION "Cygwin Setup"
 FONT 8, "MS Sans Serif"
 BEGIN
@@ -264,12 +251,9 @@ BEGIN
                     BS_AUTOCHECKBOX,55,25,100,8
     CONTROL         "Add to &Start Menu",IDC_ROOT_MENU,"Button",
                     BS_AUTOCHECKBOX,55,40,100,8
-    DEFPUSHBUTTON   "&Next -->",IDOK,100,75,45,15
-    PUSHBUTTON      "Cancel",IDCANCEL,165,75,45,15
-    PUSHBUTTON      "<-- &Back",IDC_BACK,55,75,45,15
 END
 
-IDD_FTP_AUTH DIALOGEX 0, 0, 215, 95
+IDD_FTP_AUTH DIALOG DISCARDABLE  0, 0, 215, 95
 STYLE DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU
 CAPTION "Cygwin Setup"
 FONT 8, "MS Sans Serif"
@@ -286,6 +270,15 @@ BEGIN
     PUSHBUTTON      "Cancel",IDCANCEL,165,75,45,15
 END
 
+IDD_CHOOSER DIALOG DISCARDABLE  0, 0, 186, 90
+STYLE DS_MODALFRAME | DS_3DLOOK | WS_CHILD | WS_VISIBLE | WS_CAPTION | 
+    WS_SYSMENU
+CAPTION "Cygwin Setup"
+FONT 8, "MS Sans Serif"
+BEGIN
+    LTEXT           "Don't look here",IDC_STATIC,25,38,134,8
+END
+
 
 #ifdef APSTUDIO_INVOKED
 /////////////////////////////////////////////////////////////////////////////
@@ -339,9 +332,21 @@ CYGWIN.ICON             FILE    DISCARDA
 #ifdef APSTUDIO_INVOKED
 GUIDELINES DESIGNINFO DISCARDABLE 
 BEGIN
+    IDD_LOCAL_DIR, DIALOG
+    BEGIN
+        RIGHTMARGIN, 215
+    END
+
+    IDD_SITE, DIALOG
+    BEGIN
+        RIGHTMARGIN, 215
+        BOTTOMMARGIN, 93
+    END
+
     IDD_NET, DIALOG
     BEGIN
-        BOTTOMMARGIN, 49
+        RIGHTMARGIN, 215
+        BOTTOMMARGIN, 60
     END
 
     IDD_PROXY_AUTH, DIALOG
@@ -354,10 +359,23 @@ BEGIN
         BOTTOMMARGIN, 49
     END
 
+    IDD_CHOOSE, DIALOG
+    BEGIN
+        RIGHTMARGIN, 429
+    END
+
     IDD_FTP_AUTH, DIALOG
     BEGIN
         BOTTOMMARGIN, 49
     END
+
+    IDD_CHOOSER, DIALOG
+    BEGIN
+        LEFTMARGIN, 7
+        RIGHTMARGIN, 179
+        TOPMARGIN, 7
+        BOTTOMMARGIN, 83
+    END
 END
 #endif    // APSTUDIO_INVOKED
 
@@ -409,6 +427,7 @@ BEGIN
     IDS_DOWNLOAD_FAILED     "Unable to download %s"
     IDS_DOWNLOAD_INCOMPLETE "Download Incomplete.  Try again?"
     IDS_INSTALL_INCOMPLETE  "Installation incomplete.  Check /setup.log.full for details"
+    IDS_VERSION_INFO        "Setup.exe version %1"
 END
 
 #endif    // English (U.S.) resources
Index: resource.h
===================================================================
RCS file: /cvs/src/src/winsup/cinstall/resource.h,v
retrieving revision 2.12
diff -p -u -r2.12 resource.h
--- resource.h	2001/06/30 01:37:55	2.12
+++ resource.h	2001/12/19 11:00:04
@@ -27,6 +27,7 @@
 #define IDS_DOWNLOAD_FAILED             25
 #define IDS_DOWNLOAD_INCOMPLETE         26
 #define IDS_INSTALL_INCOMPLETE          27
+#define IDS_VERSION_INFO                28
 #define IDD_ROOT                        101
 #define IDD_SOURCE                      102
 #define IDD_OTHER_URL                   103
@@ -53,6 +54,7 @@
 #define IDB_CHECK_NO                    124
 #define IDB_CHECK_NA                    125
 #define IDD_FTP_AUTH                    126
+#define IDD_CHOOSER                     127
 #define IDC_SOURCE_DOWNLOAD             1000
 #define IDC_SOURCE_NETINST              1001
 #define IDC_SOURCE_CWD                  1002
@@ -99,8 +101,11 @@
 #define IDC_DLS_PROGRESS_TEXT           1047
 #define IDC_DLS_PPROGRESS_TEXT          1048
 #define IDC_DLS_IPROGRESS_TEXT          1049
-#define IDC_CHOOSE_INST_TEXT      1050
+#define IDC_CHOOSE_INST_TEXT            1050
 #define IDC_CHOOSE_VIEWCAPTION          1051
+#define IDC_INS_BL_PACKAGE              1052
+#define IDC_INS_BL_TOTAL                1053
+#define IDC_INS_BL_DISK                 1054
 #define IDC_STATIC                      -1
 
 // Next default values for new objects
@@ -109,9 +114,9 @@
 #ifndef APSTUDIO_READONLY_SYMBOLS
 #define _APS_NO_MFC                     1
 #define _APS_3D_CONTROLS                     1
-#define _APS_NEXT_RESOURCE_VALUE        127
+#define _APS_NEXT_RESOURCE_VALUE        128
 #define _APS_NEXT_COMMAND_VALUE         40003
-#define _APS_NEXT_CONTROL_VALUE         1052
+#define _APS_NEXT_CONTROL_VALUE         1055
 #define _APS_NEXT_SYMED_VALUE           101
 #endif
 #endif
Index: root.cc
===================================================================
RCS file: /cvs/src/src/winsup/cinstall/root.cc,v
retrieving revision 2.7
diff -p -u -r2.7 root.cc
--- root.cc	2001/11/13 01:49:32	2.7
+++ root.cc	2001/12/19 11:00:05
@@ -149,16 +149,16 @@ dialog_cmd (HWND h, int id, HWND hwndctl
 
       if (!directory_is_absolute ())
 	{
-	  note (IDS_ROOT_ABSOLUTE);
+	  note (h, IDS_ROOT_ABSOLUTE);
 	  break;
 	}
 
       if (directory_is_rootdir ())
-	if (IDNO == yesno (IDS_ROOT_SLASH))
+	if (IDNO == yesno (h, IDS_ROOT_SLASH))
 	  break;
 
       if (directory_has_spaces ())
-	if (IDNO == yesno (IDS_ROOT_SPACE))
+	if (IDNO == yesno (h, IDS_ROOT_SPACE))
 	  break;
 
       NEXT (IDD_LOCAL_DIR);
@@ -176,8 +176,8 @@ dialog_cmd (HWND h, int id, HWND hwndctl
   return 0;
 }
 
-static BOOL CALLBACK
-dialog_proc (HWND h, UINT message, WPARAM wParam, LPARAM lParam)
+BOOL CALLBACK
+root_dialog_proc (HWND h, UINT message, WPARAM wParam, LPARAM lParam)
 {
   switch (message)
     {
@@ -190,17 +190,19 @@ dialog_proc (HWND h, UINT message, WPARA
   return FALSE;
 }
 
+#if 0
 void
-do_root (HINSTANCE h)
+do_root (HINSTANCE h, HWND owner)
 {
   int rv = 0;
   if (!get_root_dir ())
     read_mounts ();
-  rv = DialogBox (h, MAKEINTRESOURCE (IDD_ROOT), 0, dialog_proc);
+  rv = DialogBox (h, MAKEINTRESOURCE (IDD_ROOT), owner, root_dialog_proc);
   if (rv == -1)
-    fatal (IDS_DIALOG_FAILED);
+    fatal (owner, IDS_DIALOG_FAILED);
 
   log (0, "root: %s %s %s", get_root_dir (),
        (root_text == IDC_ROOT_TEXT) ? "text" : "binary",
        (root_scope == IDC_ROOT_USER) ? "user" : "system");
 }
+#endif
Index: site.cc
===================================================================
RCS file: /cvs/src/src/winsup/cinstall/site.cc,v
retrieving revision 2.10
diff -p -u -r2.10 site.cc
--- site.cc	2001/12/03 22:22:09	2.10
+++ site.cc	2001/12/19 11:00:06
@@ -25,6 +25,7 @@ static const char *cvsid =
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
+#include <process.h>
 
 #include "dialog.h"
 #include "resource.h"
@@ -38,6 +39,12 @@ static const char *cvsid =
 
 #include "port.h"
 
+#include "site.h"
+#include "propsheet.h"
+
+#include "threebar.h"
+extern ThreeBarProgressPage Progress;
+
 #define NO_IDX (-1)
 #define OTHER_IDX (-2)
 
@@ -101,7 +108,12 @@ load_dialog (HWND h)
       int index = SendMessage (listbox, LB_FINDSTRING, (WPARAM) - 1,
 			       (LPARAM) site_list[n]->displayed_url);
       if (index != LB_ERR)
-	SendMessage (listbox, LB_SELITEMRANGE, TRUE, (index << 16) | index);
+	  {
+        // Highlight the selected item
+	    SendMessage (listbox, LB_SELITEMRANGE, TRUE, (index << 16) | index);
+        // Make sure it's fully visible
+		SendMessage (listbox, LB_SETCARETINDEX, index, FALSE);
+	  }
     }
   check_if_enable_next (h);
 }
@@ -168,15 +180,16 @@ dialog_cmd (HWND h, int id, HWND hwndctl
       check_if_enable_next (h);
       break;
 
+#if 0
     case IDOK:
       save_dialog (h);
       if (mirror_idx == OTHER_IDX)
-	NEXT (IDD_OTHER_URL);
+	    NEXT (IDD_OTHER_URL);
       else
-	{
-	  save_site_url ();
-	  NEXT (IDD_S_LOAD_INI);
-	}
+	    {
+	      save_site_url ();
+	      NEXT (IDD_S_LOAD_INI);
+	    }
       break;
 
     case IDC_BACK:
@@ -186,11 +199,13 @@ dialog_cmd (HWND h, int id, HWND hwndctl
 
     case IDCANCEL:
       NEXT (0);
-      break;
-    }
+	break;
+#endif
+  }
   return 0;
 }
 
+#if 0
 static BOOL CALLBACK
 dialog_proc (HWND h, UINT message, WPARAM wParam, LPARAM lParam)
 {
@@ -216,14 +231,16 @@ dialog_proc (HWND h, UINT message, WPARA
     }
   return FALSE;
 }
+#endif
 
 static int
-get_site_list (HINSTANCE h)
+get_site_list (HINSTANCE h, HWND owner)
 {
   char mirror_url[1000];
+
   if (LoadString (h, IDS_MIRROR_LST, mirror_url, sizeof (mirror_url)) <= 0)
     return 1;
-  char *mirrors = get_url_to_string (mirror_url);
+  char *mirrors = get_url_to_string (mirror_url, owner);
   dismiss_url_status_dialog ();
   if (!mirrors)
     return 1;
@@ -320,13 +337,14 @@ get_saved_sites ()
 
 }
 
+#if 0
 void
-do_site (HINSTANCE h)
+do_site (HINSTANCE h, HWND owner)
 {
   int rv = 0;
 
   if (all_site_list.number () == 0)
-    if (get_site_list (h))
+    if (get_site_list (h, owner))
       {
 	NEXT (IDD_NET);
 	return;
@@ -334,10 +352,105 @@ do_site (HINSTANCE h)
 
   get_saved_sites ();
 
-  rv = DialogBox (h, MAKEINTRESOURCE (IDD_SITE), 0, dialog_proc);
+  rv = DialogBox (h, MAKEINTRESOURCE (IDD_SITE), owner, dialog_proc);
   if (rv == -1)
-    fatal (IDS_DIALOG_FAILED);
+    fatal (owner, IDS_DIALOG_FAILED);
 
   for (size_t n = 1; n <= site_list.number (); n++)
     log (0, "site: %s", site_list[n]->url);
+}
+#endif
+
+/////////////////////
+
+static void do_download_site_info_thread(void *p)
+{
+	HANDLE *context;
+	HINSTANCE hinst;
+	HWND h;
+	context = (HANDLE*)p;
+	
+	hinst = (HINSTANCE)(context[0]);
+	h = (HWND)(context[1]);
+
+	if (all_site_list.number () == 0)
+	{
+		if (get_site_list (hinst, h))
+		{
+			// Error: Couldn't download the site info.  Go back to the Net setup page.
+			NEXT (IDD_NET);
+			return;
+		}
+	}
+
+	// Everything worked, go to the site select page
+	NEXT(IDD_SITE);
+
+	// Tell the progress page that we're done downloading
+	Progress.PostMessage(WM_APP_SITE_INFO_DOWNLOAD_COMPLETE, 0, next_dialog);
+
+	_endthread();
+}
+
+static HANDLE context[2];
+
+void
+do_download_site_info (HINSTANCE hinst, HWND owner)
+{
+
+	context[0] = hinst;
+	context[1] = owner;
+
+	_beginthread(do_download_site_info_thread, 0, context);
+
+}
+
+bool SitePage::Create()
+{
+	return PropertyPage::Create(NULL, dialog_cmd, IDD_SITE);
+}
+
+void SitePage::OnInit()
+{
+  HWND h = GetHWND();
+  int j;
+  HWND listbox;
+
+  get_saved_sites ();
+
+  listbox = GetDlgItem (IDC_URL_LIST);
+  for (size_t i = 1; i <= all_site_list.number (); i++)
+	{
+	  j =
+	    SendMessage (listbox, LB_ADDSTRING, 0,
+			 (LPARAM) all_site_list[i]->displayed_url);
+	  SendMessage (listbox, LB_SETITEMDATA, j, i);
+	}
+  j = SendMessage (listbox, LB_ADDSTRING, 0, (LPARAM) "Other URL");
+  SendMessage (listbox, LB_SETITEMDATA, j, OTHER_IDX);
+  load_dialog (h);
+}
+
+long SitePage::OnNext()
+{
+  HWND h = GetHWND();
+  
+  save_dialog (h);
+  if (mirror_idx == OTHER_IDX)
+	NEXT (IDD_OTHER_URL);
+  else
+	{
+	  save_site_url ();
+	  NEXT (IDD_S_LOAD_INI);
+
+    for (size_t n = 1; n <= site_list.number (); n++)
+      log (0, "site: %s", site_list[n]->url);
+      
+    Progress.SetActivateTask(WM_APP_START_SETUP_INI_DOWNLOAD);
+	return IDD_INSTATUS;
+
+do_choose(GetInstance(), h);
+	}
+
+  return 0;
 }
Index: site.h
===================================================================
RCS file: /cvs/src/src/winsup/cinstall/site.h,v
retrieving revision 2.1
diff -p -u -r2.1 site.h
--- site.h	2001/12/03 22:22:09	2.1
+++ site.h	2001/12/19 11:00:06
@@ -17,8 +17,25 @@
 #define _SITE_H_
 
 /* required to parse this file */
-#include <strings.h>
+#include <string.h>
+#include <stdlib.h>
 #include "list.h"
+
+#include "proppage.h"
+
+class SitePage : public PropertyPage
+{
+public:
+	SitePage() {};
+	virtual ~SitePage() {};
+
+	bool Create();
+	
+	void OnInit();
+	long OnNext();
+};
+
+void do_download_site_info (HINSTANCE h, HWND owner);
 
 class site_list_type
 {
Index: source.cc
===================================================================
RCS file: /cvs/src/src/winsup/cinstall/source.cc,v
retrieving revision 2.8
diff -p -u -r2.8 source.cc
--- source.cc	2001/11/14 00:11:35	2.8
+++ source.cc	2001/12/19 11:00:06
@@ -30,6 +30,8 @@ static const char *cvsid =
 #include "msg.h"
 #include "log.h"
 
+#include "source.h"
+
 static int rb[] =
   { IDC_SOURCE_NETINST, IDC_SOURCE_DOWNLOAD, IDC_SOURCE_CWD, 0 };
 
@@ -57,65 +59,57 @@ dialog_cmd (HWND h, int id, HWND hwndctl
       save_dialog (h);
       break;
 
-    case IDOK:
-      save_dialog (h);
-      if (source == IDC_SOURCE_DOWNLOAD)
-	NEXT (IDD_LOCAL_DIR);
-      else
-	NEXT (IDD_ROOT);
-      break;
-
-    case IDC_BACK:
-      save_dialog (h);
-      NEXT (0);
-      break;
-
-    case IDCANCEL:
-      NEXT (0);
-      break;
-
     default:
       break;
     }
   return 0;
 }
 
-static BOOL CALLBACK
-dialog_proc (HWND h, UINT message, WPARAM wParam, LPARAM lParam)
+bool SourcePage::Create()
 {
-  switch (message)
-    {
-    case WM_INITDIALOG:
-      load_dialog (h);
-      // Check to see if any radio buttons are selected. If not, select a default.
-      if (
-	  (!SendMessage
-	   (GetDlgItem (h, IDC_SOURCE_DOWNLOAD), BM_GETCHECK, 0,
+	return PropertyPage::Create(NULL, dialog_cmd, IDD_SOURCE);
+}
+
+void SourcePage::OnActivate()
+{
+  if (!source)
+    source = IDC_SOURCE_NETINST;
+  load_dialog (GetHWND());
+  // Check to see if any radio buttons are selected. If not, select a default.
+  if (
+    (!SendMessage
+	(GetDlgItem (IDC_SOURCE_DOWNLOAD), BM_GETCHECK, 0,
 	    0) == BST_CHECKED)
-	  && (!SendMessage (GetDlgItem (h, IDC_SOURCE_CWD), BM_GETCHECK, 0, 0)
+	  && (!SendMessage (GetDlgItem (IDC_SOURCE_CWD), BM_GETCHECK, 0, 0)
 	      == BST_CHECKED))
 	{
-	  SendMessage (GetDlgItem (h, IDC_SOURCE_NETINST), BM_SETCHECK,
+	  SendMessage (GetDlgItem (IDC_SOURCE_NETINST), BM_SETCHECK,
 		       BST_CHECKED, 0);
 	}
-      return FALSE;
-    case WM_COMMAND:
-      return HANDLE_WM_COMMAND (h, wParam, lParam, dialog_cmd);
-    }
-  return FALSE;
 }
 
-void
-do_source (HINSTANCE h)
+long SourcePage::OnNext()
 {
-  int rv = 0;
-  /* source = IDC_SOURCE_CWD; */
-  if (!source)
-    source = IDC_SOURCE_NETINST;
-  rv = DialogBox (h, MAKEINTRESOURCE (IDD_SOURCE), 0, dialog_proc);
-  if (rv == -1)
-    fatal (IDS_DIALOG_FAILED);
+  HWND h = GetHWND();
 
+  save_dialog (h);
+  if (source == IDC_SOURCE_DOWNLOAD)
+  {
+	  // If all we're doing is downloading,skip the root directory page
+    return IDD_LOCAL_DIR;
+  }
+
+  return 0;
+}
+
+long SourcePage::OnBack()
+{
+  save_dialog (GetHWND());
+  return 0;
+}
+
+void SourcePage::OnDeactivate()
+{
   log (0, "source: %s",
        (source == IDC_SOURCE_DOWNLOAD) ? "download" :
        (source == IDC_SOURCE_NETINST) ? "network install" : "from cwd");
Index: splash.cc
===================================================================
RCS file: /cvs/src/src/winsup/cinstall/splash.cc,v
retrieving revision 2.6
diff -p -u -r2.6 splash.cc
--- splash.cc	2001/11/13 01:49:32	2.6
+++ splash.cc	2001/12/19 11:00:06
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, Red Hat, Inc.
+ * Copyright (c) 2001, Gary R. Van Sickle.
  *
  *     This program is free software; you can redistribute it and/or modify
  *     it under the terms of the GNU General Public License as published by
@@ -9,71 +9,29 @@
  *     A copy of the GNU General Public License can be found at
  *     http://www.gnu.org/
  *
- * Written by DJ Delorie <dj@cygnus.com>
+ * Written by Gary R. Van Sickle <g.r.vansickle@worldnet.att.net>
  *
  */
 
-/* The purpose of this file is to display the program name, version,
-   copyright notice, and project URL. */
+// This is the implementation of the SplashPage class.  Since the splash page
+// has little to do, there's not much here.
 
-#if 0
-static const char *cvsid =
-  "\n%%% $Id: splash.cc,v 2.6 2001/11/13 01:49:32 rbcollins Exp $\n";
-#endif
-
-#include "win32.h"
 #include <stdio.h>
-#include "dialog.h"
-#include "resource.h"
-#include "msg.h"
 #include "version.h"
+#include "resource.h"
+#include "cistring.h"
+#include "splash.h"
 
-static void
-load_dialog (HWND h)
+bool SplashPage::Create()
 {
-  char buffer[100];
-  HWND v = GetDlgItem (h, IDC_VERSION);
-  sprintf (buffer, "Setup.exe version %s",
-	   version[0] ? version : "[unknown]");
-  SetWindowText (v, buffer);
+  return PropertyPage::Create(IDD_SPLASH);
 }
 
-static BOOL
-dialog_cmd (HWND h, int id, HWND hwndctl, UINT code)
+void SplashPage::OnInit()
 {
-  switch (id)
-    {
-
-    case IDOK:
-      NEXT (IDD_SOURCE);
-      break;
-
-    case IDCANCEL:
-      NEXT (0);
-      break;
-    }
-  return 0;
-}
+  cistring ver;
 
-static BOOL CALLBACK
-dialog_proc (HWND h, UINT message, WPARAM wParam, LPARAM lParam)
-{
-  switch (message)
-    {
-    case WM_INITDIALOG:
-      load_dialog (h);
-      return TRUE;
-    case WM_COMMAND:
-      return HANDLE_WM_COMMAND (h, wParam, lParam, dialog_cmd);
-    }
-  return FALSE;
-}
+  ver.Format(IDS_VERSION_INFO, version[0] ? version : "[unknown]");
 
-void
-do_splash (HINSTANCE h)
-{
-  int rv = 0;
-  rv = DialogBox (h, MAKEINTRESOURCE (IDD_SPLASH), 0, dialog_proc);
-  if (rv == -1)
-    fatal (IDS_DIALOG_FAILED);
+  SetWindowText (GetDlgItem(IDC_VERSION), ver.c_str());
 }
