void InstallerWindow::DownloadError(const std::wstring& error) { SetStatus(L""); ShowError(error); RecordError(); m_download_started = false; m_download_cancelled = false; }
int InstallerWindow::ExecOnThread() { try { auto_any<htmlayout::dom::element *, html_disabled> btn_install(& button_install); htmlayout::queue::push(new html_set_attribute_task(& button_install, "disabled", L"disabled"), HtmlWindow::s_hwnd); auto_any<htmlayout::dom::element *, html_disabled> btn_skip(& button_skip); htmlayout::queue::push(new html_set_attribute_task(& button_skip, "disabled", L"disabled"), HtmlWindow::s_hwnd); ClearError(); ClearProgress(); InstallConfiguration * p_configuration = reinterpret_cast<InstallConfiguration *>(get(m_configuration)); CHECK_BOOL(p_configuration != NULL, L"Invalid configuration"); if (RestartElevated()) { OnCancel(); return 0; } Components components = p_configuration->GetSupportedComponents( InstallerSession::Instance->lcidtype, InstallerSession::Instance->sequence); SetProgressTotal(components.size() * 2); int rc = components.Exec(this); InstallerUI::AfterInstall(rc); return 0; } catch(std::exception& ex) { LOG(L"*** Failed to install one or more components: " << DVLib::string2wstring(ex.what())); ShowError(DVLib::string2wstring(ex.what())); RecordError(); } catch(...) { LOG(L"*** Failed to install one or more components"); ShowError(TEXT("Failed to install one or more components")); RecordError(); } return 0; }
//*********************************************************************** int CParser::GetNextToken() // return next token in the script //*********************************************************************** { if (!m_lpScript) return I_EOF; int i; int wWordLen, wLen; pCParseToken pToken; LPSTR pWord; if (wWordLen = GetNextWord()) { pWord = m_lpScript; // the word it just located m_lpScript += wWordLen; // just after this word for (i=0; (pToken = &TokenList[i]) && pToken->GetID(); i++) { LPSTR lpToken = pToken->GetToken(); wLen = pToken->GetTokenLen(); if ((wWordLen == wLen) && (_fstrnicmp(lpToken, pWord, wLen) == 0)) { BOOL bResult = TRUE; for (int q=0; bResult && q<pToken->GetParams(); q++) bResult = GetNextNum(&m_Params[q]); if (!bResult) RecordError(pToken, ERR_INSUF); return bResult ? pToken->GetID() : NULL; // found one. } } // cannot find that command char command[100]; command[0] = 0; lstrcpyn(command, pWord, wWordLen+1); CParseToken Dummy((LPSTR)command, 0, 0); RecordError(&Dummy, ERR_UNKNOWN); return NULL; } // no more words in the script return I_EOF; }
void InstallerWindow::OnCancel() { RecordError(-2); if (m_download_started) { m_download_cancelled = true; } else { Stop(); } }