Commit 621b0405 authored by Hans Leidekker's avatar Hans Leidekker Committed by Alexandre Julliard

msi: Don't create a temporary copy of the package.

There's no need for it now that we open the package in transacted mode.
parent 0f67869d
......@@ -4857,19 +4857,6 @@ static UINT ACTION_RegisterProduct(MSIPACKAGE *package)
if (rc != ERROR_SUCCESS)
goto done;
if (!msi_get_property_int( package->db, szInstalled, 0 ))
{
msi_reg_set_val_str( props, INSTALLPROPERTY_LOCALPACKAGEW, package->localfile );
if (!CopyFileW( package->PackagePath, package->localfile, FALSE ))
{
rc = GetLastError();
ERR("Unable to copy package %u\n", rc);
goto done;
}
}
msi_free( package->localfile );
package->localfile = NULL;
rc = msi_publish_install_properties(package, hkey);
if (rc != ERROR_SUCCESS)
goto done;
......@@ -4890,6 +4877,8 @@ static UINT ACTION_RegisterProduct(MSIPACKAGE *package)
}
msi_free( upgrade_code );
}
msi_reg_set_val_str( props, INSTALLPROPERTY_LOCALPACKAGEW, package->localfile );
package->delete_on_close = FALSE;
done:
uirow = MSI_CreateRecord( 1 );
......@@ -4951,12 +4940,8 @@ static UINT msi_unpublish_product( MSIPACKAGE *package, const WCHAR *remove )
MSIREG_DeleteUserDataPatchKey(patch->patchcode, package->Context);
/* FIXME: remove local patch package if this is the last product */
}
TRACE("removing local package %s\n", debugstr_w(package->localfile));
DeleteFileW( package->localfile );
msi_free( package->localfile );
package->localfile = NULL;
package->delete_on_close = TRUE;
return ERROR_SUCCESS;
}
......@@ -7394,15 +7379,6 @@ UINT MSI_InstallPackage( MSIPACKAGE *package, LPCWSTR szPackagePath,
msi_adjust_privilege_properties( package );
msi_set_context( package );
if (msi_get_property_int( package->db, szInstalled, 0 ))
{
HKEY hkey;
DeleteFileW( package->localfile );
msi_free( package->localfile );
MSIREG_OpenInstallProps( package->ProductCode, package->Context, NULL, &hkey, FALSE );
package->localfile = msi_reg_get_val_str( hkey, INSTALLPROPERTY_LOCALPACKAGEW );
RegCloseKey( hkey );
}
if (msi_get_property_int( package->db, szDisableRollback, 0 ))
{
TRACE("disabling rollback\n");
......
......@@ -49,7 +49,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(msi);
static const WCHAR installerW[] = {'\\','I','n','s','t','a','l','l','e','r',0};
static UINT msi_locate_product(LPCWSTR szProduct, MSIINSTALLCONTEXT *context)
UINT msi_locate_product(LPCWSTR szProduct, MSIINSTALLCONTEXT *context)
{
HKEY hkey = NULL;
......
......@@ -383,6 +383,7 @@ typedef struct tagMSIPACKAGE
LPWSTR PackagePath;
LPWSTR ProductCode;
LPWSTR localfile;
BOOL delete_on_close;
UINT CurrentInstallState;
msi_dialog *dialog;
......@@ -894,7 +895,7 @@ extern UINT MSIREG_DeleteClassesUpgradeCodesKey(LPCWSTR szUpgradeCode) DECLSPEC_
extern UINT MSIREG_OpenClassesUpgradeCodesKey(LPCWSTR szUpgradeCode, HKEY* key, BOOL create) DECLSPEC_HIDDEN;
extern UINT MSIREG_DeleteLocalClassesProductKey(LPCWSTR szProductCode) DECLSPEC_HIDDEN;
extern UINT MSIREG_DeleteLocalClassesFeaturesKey(LPCWSTR szProductCode) DECLSPEC_HIDDEN;
extern UINT msi_locate_product(LPCWSTR szProduct, MSIINSTALLCONTEXT *context) DECLSPEC_HIDDEN;
extern LPWSTR msi_reg_get_val_str( HKEY hkey, LPCWSTR name ) DECLSPEC_HIDDEN;
extern BOOL msi_reg_get_val_dword( HKEY hkey, LPCWSTR name, DWORD *val) DECLSPEC_HIDDEN;
......@@ -1012,7 +1013,7 @@ extern BOOL msi_action_is_unique(const MSIPACKAGE *, const WCHAR *) DECLSPEC_HID
extern WCHAR *msi_build_error_string(MSIPACKAGE *, UINT, DWORD, ...) DECLSPEC_HIDDEN;
extern UINT msi_set_last_used_source(LPCWSTR product, LPCWSTR usersid,
MSIINSTALLCONTEXT context, DWORD options, LPCWSTR value) DECLSPEC_HIDDEN;
extern UINT msi_get_local_package_name(LPWSTR path, LPCWSTR suffix) DECLSPEC_HIDDEN;
extern UINT msi_create_empty_local_file(LPWSTR path, LPCWSTR suffix) DECLSPEC_HIDDEN;
extern UINT msi_set_sourcedir_props(MSIPACKAGE *package, BOOL replace) DECLSPEC_HIDDEN;
extern MSIASSEMBLY *msi_load_assembly(MSIPACKAGE *, MSICOMPONENT *) DECLSPEC_HIDDEN;
extern UINT msi_install_assembly(MSIPACKAGE *, MSICOMPONENT *) DECLSPEC_HIDDEN;
......
......@@ -630,7 +630,7 @@ static UINT msi_apply_patch_package( MSIPACKAGE *package, const WCHAR *file )
if ( r != ERROR_SUCCESS )
goto done;
r = msi_get_local_package_name( localfile, dotmsp );
r = msi_create_empty_local_file( localfile, dotmsp );
if ( r != ERROR_SUCCESS )
goto done;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment