Let's see if this approach is more satisfactory... +2003-07-29 Max Bowsher <[EMAIL PROTECTED]> + + * ini.cc (do_ini_thread): Return bool. + (do_ini_thread_reflector): Put returned bool in lParam. + * threebar.cc (WM_APP_SETUP_INI_DOWNLOAD_COMPLETE): Rework for new + meaning of lParam. +
Index: ini.cc =================================================================== RCS file: /home/max/cvsmirror/cygwin-apps-cvs/setup/ini.cc,v retrieving revision 2.35 diff -u -p -r2.35 ini.cc --- ini.cc 5 Jul 2002 05:17:21 -0000 2.35 +++ ini.cc 29 Jul 2003 13:17:34 -0000 @@ -203,7 +203,7 @@ do_remote_ini (HWND owner) return ini_count; } -static void +static bool do_ini_thread (HINSTANCE h, HWND owner) { size_t ini_count = 0; @@ -213,10 +213,7 @@ do_ini_thread (HINSTANCE h, HWND owner) ini_count = do_remote_ini (owner); if (ini_count == 0) - { - next_dialog = source == IDC_SOURCE_CWD ? IDD_S_FROM_CWD : IDD_SITE; - return; - } + return false; if (get_root_dir ().cstr_oneuse()) { @@ -266,7 +263,7 @@ do_ini_thread (HINSTANCE h, HWND owner) note (owner, IDS_OLD_SETUP_VERSION, version, setup_version.cstr_oneuse()); } - next_dialog = IDD_CHOOSE; + return true; } static DWORD WINAPI @@ -275,10 +272,10 @@ do_ini_thread_reflector(void* p) HANDLE *context; context = (HANDLE*)p; - do_ini_thread((HINSTANCE)context[0], (HWND)context[1]); + bool succeeded = 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); + Progress.PostMessage(WM_APP_SETUP_INI_DOWNLOAD_COMPLETE, 0, succeeded); ExitThread(0); } Index: threebar.cc =================================================================== RCS file: /home/max/cvsmirror/cygwin-apps-cvs/setup/threebar.cc,v retrieving revision 2.5 diff -u -p -r2.5 threebar.cc --- threebar.cc 25 Mar 2003 20:57:13 -0000 2.5 +++ threebar.cc 29 Jul 2003 13:33:23 -0000 @@ -206,14 +206,23 @@ bool } case WM_APP_SETUP_INI_DOWNLOAD_COMPLETE: { - if (lParam == IDD_S_FROM_CWD) + if (lParam) { - // There isn't actually a dialog template named this - do_fromcwd (GetInstance (), GetHWND ()); + GetOwner ()->SetActivePageByID (lParam); } else { - GetOwner ()->SetActivePageByID (lParam); + if (source == IDC_SOURCE_CWD) + { + // There was a setup.ini file (as found by do_fromcwd), + // but it had vanished by the time we came to read it. + exit(100); + } + else + { + // Download failed, try another site. + GetOwner ()->SetActivePageByID (IDD_SITE); + } } break; }