diff --git a/dlls/msi/install.c b/dlls/msi/install.c index b4f365e2da75fa66d80921a98901af957c60c81a..2d0a3654180bd9a6a7339924dc3f3f069ba60b65 100644 --- a/dlls/msi/install.c +++ b/dlls/msi/install.c @@ -544,7 +544,28 @@ UINT WINAPI MsiSetTargetPathW(MSIHANDLE hInstall, LPCWSTR szFolder, package = msihandle2msiinfo(hInstall, MSIHANDLETYPE_PACKAGE); if (!package) - return ERROR_INVALID_HANDLE; + { + HRESULT hr; + IWineMsiRemotePackage *remote_package; + + remote_package = (IWineMsiRemotePackage *)msi_get_remote( hInstall ); + if (!remote_package) + return ERROR_INVALID_HANDLE; + + hr = IWineMsiRemotePackage_SetTargetPath( remote_package, (BSTR *)szFolder, (BSTR *)szFolderPath ); + + IWineMsiRemotePackage_Release( remote_package ); + + if (FAILED(hr)) + { + if (HRESULT_FACILITY(hr) == FACILITY_WIN32) + return HRESULT_CODE(hr); + + return ERROR_FUNCTION_FAILED; + } + + return ERROR_SUCCESS; + } ret = MSI_SetTargetPathW( package, szFolder, szFolderPath ); msiobj_release( &package->hdr ); diff --git a/dlls/msi/msiserver.idl b/dlls/msi/msiserver.idl index 8baa167c473dc11f1284f211c51d1234b1fdc95b..36ccc7c7ab07b29eea6cd1e09fe785c2ba6581cb 100644 --- a/dlls/msi/msiserver.idl +++ b/dlls/msi/msiserver.idl @@ -43,6 +43,7 @@ interface IWineMsiRemotePackage : IUnknown HRESULT DoAction( [in] BSTR *action ); HRESULT Sequence( [in] BSTR *table, [in] int sequence ); HRESULT GetTargetPath( [in] BSTR *folder, [out] BSTR *value, [out] DWORD *size ); + HRESULT SetTargetPath( [in] BSTR *folder, [in] BSTR *value ); HRESULT GetSourcePath( [in] BSTR *folder, [out] BSTR *value, [out] DWORD *size ); } diff --git a/dlls/msi/package.c b/dlls/msi/package.c index 1b83e56c634514906073c152841087e07f9453f5..62fa702454f780ef70be54b6a89cdd806c6d71c4 100644 --- a/dlls/msi/package.c +++ b/dlls/msi/package.c @@ -1597,6 +1597,13 @@ HRESULT WINAPI mrp_GetTargetPath( IWineMsiRemotePackage *iface, BSTR *folder, BS return HRESULT_FROM_WIN32(r); } +HRESULT WINAPI mrp_SetTargetPath( IWineMsiRemotePackage *iface, BSTR *folder, BSTR *value) +{ + msi_remote_package_impl* This = mrp_from_IWineMsiRemotePackage( iface ); + UINT r = MsiSetTargetPathW(This->package, (LPWSTR)folder, (LPWSTR)value); + return HRESULT_FROM_WIN32(r); +} + HRESULT WINAPI mrp_GetSourcePath( IWineMsiRemotePackage *iface, BSTR *folder, BSTR *value, DWORD *size ) { msi_remote_package_impl* This = mrp_from_IWineMsiRemotePackage( iface ); @@ -1617,6 +1624,7 @@ static const IWineMsiRemotePackageVtbl msi_remote_package_vtbl = mrp_DoAction, mrp_Sequence, mrp_GetTargetPath, + mrp_SetTargetPath, mrp_GetSourcePath, };