如何编写引导EXE,它会启动MSIEXEC.EXE,然后等待其完成

|| 我正在尝试安装我的ActiveX插件,该插件打包在cab文件中的nsi中,但是遇到了问题。 日志是
Code Download Error: (hr = 80070005) Access is denied.

ERR: Run Setup Hook: Failed Error Code:(hr) = 80070005, processing: msiexec.exe /package \"%EXTRACT_DIR%\\TempR.msi\"
我认为与此相同: http://social.msdn.microsoft.com/Forums/zh-CN/ieextensiondevelopment/thread/3d355fb6-8d6a-4177-98c2-a25665510727/ 我想尝试那里建议的解决方案,但不知道如何   创建一个小的引导程序EXE,   除了启动MSIEXEC.EXE外什么都不做   然后等待其完成。 有人可以提供帮助吗? 谢谢!!     
已邀请:
        看一下dotNetInstaller-预写的bootstrapper程序,它执行的功能远远超出您的需求,但可以完全满足您的要求。     
        这是一个简单的包装程序,它调用msiexec.exe来安静地安装在第一个命令行参数中传递的msi。 它是作为Visual C ++命令行应用程序编写的:
// InstallMSI.cpp : Defines the entry point for the console application.
//
#include \"stdafx.h\"
#include <Windows.h>
#include <string>

int wmain(int argc, wchar_t* argv[])
{
if(argc < 2) {
    printf(\"Usage: installmsi.exe <full path to msi file>\\n\\n\");
    printf(\"Package will be installed using msiexec.exe with the /qn (quiet install) flags.\\n\");
    return 1;
}

std::wstring args;
args = L\"msiexec.exe /i \\\"\";
args += argv[1];
args += L\"\\\" /qn\";

PROCESS_INFORMATION pi;
STARTUPINFO si;

ZeroMemory(&si, sizeof(si));
si.cb = sizeof(si);

ZeroMemory(&pi, sizeof(pi));

if(!CreateProcess(NULL, (LPWSTR)args.c_str(),
    NULL, NULL, TRUE, NULL, NULL, NULL, &si, &pi)) {
        printf(\"CreateProcess failed (%d).\\n\", GetLastError());
        return 2;
}

WaitForSingleObject( pi.hProcess, INFINITE );

CloseHandle(pi.hProcess);
CloseHandle(pi.hThread);

return 0;
}
希望能有所帮助。     

要回复问题请先登录注册