| 362 | |
| 363 | |
| 364 | InstallStatus Plugin::runSteps(InstallStepContainer steps, tstring& basePath, TiXmlElement* forGpup, |
| 365 | std::function<void(const TCHAR*)> setStatus, |
| 366 | std::function<void(const int)> stepProgress, |
| 367 | std::function<void()> stepComplete, |
| 368 | const ModuleInfo* moduleInfo, |
| 369 | VariableHandler* variableHandler, |
| 370 | CancelToken& cancelToken) |
| 371 | { |
| 372 | InstallStatus status = INSTALL_SUCCESS; |
| 373 | |
| 374 | InstallStepContainer::iterator stepIterator = steps.begin(); |
| 375 | |
| 376 | variableHandler->setVariable(_T("PLUGINFILENAME"), getFilename().c_str()); |
| 377 | |
| 378 | StepStatus stepStatus; |
| 379 | |
| 380 | while (stepIterator != steps.end()) |
| 381 | { |
| 382 | |
| 383 | if (variableHandler) |
| 384 | (*stepIterator)->replaceVariables(variableHandler); |
| 385 | |
| 386 | stepStatus = (*stepIterator)->perform(basePath, forGpup, setStatus, stepProgress, moduleInfo, cancelToken); |
| 387 | |
| 388 | switch(stepStatus) |
| 389 | { |
| 390 | case STEPSTATUS_FAIL: |
| 391 | // Stop processing |
| 392 | return INSTALL_FAIL; |
| 393 | |
| 394 | case STEPSTATUS_NEEDGPUP: |
| 395 | status = INSTALL_NEEDRESTART; |
| 396 | break; |
| 397 | } |
| 398 | stepComplete(); |
| 399 | ++stepIterator; |
| 400 | } |
| 401 | |
| 402 | |
| 403 | return status; |
| 404 | } |
| 405 | |
| 406 | |
| 407 |
nothing calls this directly
no test coverage detected