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 20 Mar 2003 21:41:09 -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 20 Mar 2003 21:41:09 -0000 @@ -455,7 +455,7 @@ do_install_thread (HINSTANCE h, HWND own num_installs = 0, num_uninstalls = 0, num_replacements = 0; rebootneeded = false; - next_dialog = IDD_DESKTOP; + next_dialog = IDD_S_POSTINSTALL; io_stream::mkpath_p (PATH_TO_DIR, String ("file://") + get_root_dir ()); Index: postinstall.cc =================================================================== RCS file: /cvs/cygwin-apps/setup/postinstall.cc,v retrieving revision 2.12 diff -u -p -r2.12 postinstall.cc --- postinstall.cc 20 Mar 2003 10:02:51 -0000 2.12 +++ postinstall.cc 20 Mar 2003 21:41:09 -0000 @@ -29,40 +29,117 @@ static const char *cvsid = #include "FilterVisitor.h" #include "package_db.h" #include "package_meta.h" +#include "resource.h" +#include "threebar.h" + +extern ThreeBarProgressPage Progress; class RunFindVisitor : public FindVisitor { public: - RunFindVisitor (){} + RunFindVisitor (std::vector *scripts) : _scripts(scripts) {} virtual void visitFile(String const &basePath, const WIN32_FIND_DATA *theFile) { - run_script ("/etc/postinstall/", theFile->cFileName, TRUE); + _scripts->push_back(String("/etc/postinstall/")+theFile->cFileName); } virtual ~ RunFindVisitor () {} protected: RunFindVisitor (RunFindVisitor const &); RunFindVisitor & operator= (RunFindVisitor const &); +private: + std::vector *_scripts; }; - -void -do_postinstall (HINSTANCE h, HWND owner) + +static void +do_postinstall_thread (HINSTANCE h, HWND owner) { - next_dialog = 0; + 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; + std::vector packages; PackageDBConnectedIterator i = db.connectedBegin (); while (i != db.connectedEnd ()) { packagemeta & pkg = **i; if (pkg.installed) - for (std::vector