Index: desktop.cc =================================================================== RCS file: /cvs/cygwin-apps/setup/desktop.cc,v retrieving revision 2.34 diff -u -p -r2.34 desktop.cc --- desktop.cc 25 Nov 2002 22:12:08 -0000 2.34 +++ desktop.cc 19 Mar 2003 23:05:40 -0000 @@ -397,8 +397,6 @@ DesktopSetupPage::OnFinish () HWND h = GetHWND (); save_dialog (h); do_desktop_setup (); - NEXT (IDD_S_POSTINSTALL); - do_postinstall (GetInstance (), h); return true; } Index: install.cc =================================================================== RCS file: /cvs/cygwin-apps/setup/install.cc,v retrieving revision 2.60 diff -u -p -r2.60 install.cc --- install.cc 17 Mar 2003 22:23:33 -0000 2.60 +++ install.cc 19 Mar 2003 23:05:40 -0000 @@ -455,8 +455,6 @@ do_install_thread (HINSTANCE h, HWND own num_installs = 0, num_uninstalls = 0, num_replacements = 0; rebootneeded = false; - next_dialog = IDD_DESKTOP; - io_stream::mkpath_p (PATH_TO_DIR, String ("file://") + get_root_dir ()); for (i = 0; Installer::StandardDirs[i]; i++) @@ -634,7 +632,7 @@ do_install_reflector (void *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); + Progress.PostMessage (WM_APP_INSTALL_THREAD_COMPLETE, 0, IDD_S_POSTINSTALL); ExitThread (0); } Index: postinstall.cc =================================================================== RCS file: /cvs/cygwin-apps/setup/postinstall.cc,v retrieving revision 2.11 diff -u -p -r2.11 postinstall.cc --- postinstall.cc 18 Mar 2003 22:43:15 -0000 2.11 +++ postinstall.cc 19 Mar 2003 23:05:40 -0000 @@ -29,6 +29,13 @@ static const char *cvsid = #include "FilterVisitor.h" #include "package_db.h" #include "package_meta.h" +#include "resource.h" +#include "threebar.h" + +extern ThreeBarProgressPage Progress; + +static int numscr = 0; +static int s = 0; class RunFindVisitor : public FindVisitor { @@ -36,33 +43,115 @@ public: RunFindVisitor (){} virtual void visitFile(String const &basePath, const WIN32_FIND_DATA *theFile) { + Progress.SetText3 (theFile->cFileName); run_script ("/etc/postinstall/", theFile->cFileName); + ++s; + Progress.SetBar1 (s, numscr); } virtual ~ RunFindVisitor () {} protected: RunFindVisitor (RunFindVisitor const &); RunFindVisitor & operator= (RunFindVisitor const &); }; - -void -do_postinstall (HINSTANCE h, HWND owner) + +class CountFindVisitor : public FindVisitor { - next_dialog = 0; +public: + CountFindVisitor (){} + virtual void visitFile(String const &basePath, const WIN32_FIND_DATA *theFile) + { + ++numscr; + } + virtual ~ CountFindVisitor () {} +protected: + CountFindVisitor (CountFindVisitor const &); + CountFindVisitor & operator= (CountFindVisitor const &); +}; + +static void +do_postinstall_thread (HINSTANCE h, HWND owner) +{ + next_dialog = IDD_DESKTOP; + + Progress.SetText1 ("Running..."); + Progress.SetText2 (""); + Progress.SetText3 (""); + Progress.SetBar1 (0, 1); + Progress.SetBar2 (0, 1); + init_run_script (); SetCurrentDirectory (get_root_dir ().cstr_oneuse()); packagedb db; + // Count the packages + int numpkg = 1; PackageDBConnectedIterator i = db.connectedBegin (); while (i != db.connectedEnd ()) { + ++numpkg; + ++i; + } + int k = 0; + i = db.connectedBegin (); + while (i != db.connectedEnd ()) + { packagemeta & pkg = **i; if (pkg.installed) - for (std::vector