【问题标题】:Change the installation path with msi API使用 msi API 更改安装路径
【发布时间】:2015-06-11 07:15:45
【问题描述】:

我正在尝试使用这些代码行手动设置安装路径,

MSIHANDLE msiHandle;
UINT openPackageExitCode = MsiOpenPackage(LR"(path to .msi file)", &msiHandle);
LPCTSTR newPath = LR"(C:\test\)";
UINT changePathResult = MsiSetTargetPath(msiHandle, L"INSTALLDIR", newPath);
MsiCloseHandle(msiHandle);

但是,我收到一条错误消息,上面写着ERROR_DIRECTORY

如何使用这种方法更改安装路径?

【问题讨论】:

  • 我会确保在 CostFinalize 之后调用此自定义操作。在此之前,Directory 表尚未处理。

标签: c deployment installation windows-installer


【解决方案1】:

CostFinalize 操作解决了我的问题之后,在自定义操作中调用MsiSetTargetPath

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-12-31
    • 1970-01-01
    • 1970-01-01
    • 2017-05-29
    • 1970-01-01
    相关资源
    最近更新 更多