Skip to content

Commit

Permalink
增加遍历并执行属性exec标记为1的功能
Browse files Browse the repository at this point in the history
  • Loading branch information
wkingnet committed Mar 11, 2024
1 parent 0b11df8 commit 698e938
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions Updater/Updater.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -555,6 +555,14 @@ void AutoUpdate::start_update(HWND hListview, const vector<XML_FILE>& xml_files)
if (all_done) {
cout << "更新完成\n";
MessageBox(g_hDialogUpdater, L"更新完成,程序退出", L"自动更新", MB_ICONINFORMATION | MB_OK);

// 遍历解析的xml数据exec属性,如果为1则执行
for (const auto& [path, exec, unzip, overwrite, size, CRC32] : xml_files) {
if (std::wcscmp(exec.c_str(), L"1") == 0) {
ShellExecute(nullptr, _T("open"), (exe_path + path).data(), nullptr, nullptr, SW_SHOWNORMAL);
}
}

exit(0); // NOLINT(concurrency-mt-unsafe)
}
else {
Expand Down

0 comments on commit 698e938

Please sign in to comment.