root/lang/c/AutoUpdater/trunk/recipes/extracter/7za/7za.h @ 37982

Revision 37982, 0.9 kB (checked in by saturday06, 4 years ago)

tsuadsfsd

  • Property svn:executable set to *
RevLine 
[37982]1extern const size_t AUI_ARCHIVER_BYTES;
2extern const char AUI_ARCHIVER_DATA[];
3
4AU_Result AUI_Extract(AUI_Context* context) {
5    AU_Result r;
6    FILE* f = NULL;
7
8    r = E(AU_ERROR_SYSTEM);
9
10    _tfopen_s(&f, context->extracter_file_path, _T("wb"));
11    if (!f) {
12        return r;
13    }
14    fwrite(AUI_ARCHIVER_DATA, AUI_ARCHIVER_BYTES, 1, f);
15    fclose(f);
16
17    {
18        STARTUPINFO si;
19        PROCESS_INFORMATION pi;
20        TCHAR command[] = _T("extracter.exe x -y -oextracted archive_file");
21        memset(&si, 0, sizeof(si));
22        si.cb = sizeof(si);
23        memset(&pi, 0, sizeof(pi));
24        CreateProcess(context->extracter_file_path, command, NULL, NULL, FALSE, 0, NULL, context->temp_dir_path, &si, &pi);
25        WaitForSingleObject(pi.hProcess, INFINITE);
26                CloseHandle(pi.hThread);
27                CloseHandle(pi.hProcess);
28    }
29    return AUI_SUCCESS;
30}
31
Note: See TracBrowser for help on using the browser.