1

我正在尝试安装我的 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/en-US/ieextensiondevelopment/thread/3d355fb6-8d6a-4177-98c2-a25665510727/

我想尝试那里建议的解决方案,但不知道如何

创建一个小的引导程序 EXE,它只会启动 MSIEXEC.EXE,然后等待其完成。

有人可以提供任何帮助吗?

谢谢!!

4

2 回答 2

1

这是一个简单的包装器,它调用 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;
}

希望有帮助。

于 2013-04-25T17:00:19.740 回答
0

看看dotNetInstaller - 预先编写的引导程序,它的功能远远超出您的需要,但可以完全按照您的要求完成。

于 2011-06-16T00:39:56.153 回答