C++'s “system” without wait (Win32)

后端 未结 3 1090
忘掉有多难
忘掉有多难 2021-01-14 21:34

I have got a program which checks if there\'s a version update on the server. Now I have to do something like

if(update_avail) {
    system(\"updater.exe\");         


        
3条回答
  •  灰色年华
    2021-01-14 22:17

    Use CreateProcess(), it runs asynchronously. Then you would only have to ensure that updater.exe can write to the original EXE, which you can do by waiting or retrying until the original process has ended. (With a grace interval of course.)

提交回复
热议问题