【发布时间】: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