ui_progress(package,2,file->FileSize,0,0);
file->state = msifs_skipped;
}
+ else
+ file->Component->Action = INSTALLSTATE_LOCAL;
}
}
{
UINT gle;
- TRACE("Copying %s to %s\n", debugstr_w(source),
- debugstr_w(file->TargetPath));
+ TRACE("Copying %s to %s\n", debugstr_w(source), debugstr_w(file->TargetPath));
gle = copy_file(file, source);
if (gle == ERROR_SUCCESS)
GetTempFileNameW(szBackSlash, szMsi, 0, tmpfileW);
len = strlenW(file->TargetPath) + strlenW(tmpfileW) + 1;
- if (!(pathW = HeapAlloc(GetProcessHeap(), 0, len * sizeof(WCHAR))))
+ if (!(pathW = msi_alloc(len * sizeof(WCHAR))))
return ERROR_OUTOFMEMORY;
strcpyW(pathW, file->TargetPath);
gle = GetLastError();
WARN("failed to schedule rename operation: %d)\n", gle);
}
- HeapFree(GetProcessHeap(), 0, pathW);
+ msi_free(pathW);
}
return gle;
}
-static BOOL check_dest_hash_matches(MSIFILE *file)
-{
- MSIFILEHASHINFO hash;
- UINT r;
-
- if (!file->hash.dwFileHashInfoSize)
- return FALSE;
-
- hash.dwFileHashInfoSize = sizeof(MSIFILEHASHINFO);
- r = MsiGetFileHashW(file->TargetPath, 0, &hash);
- if (r != ERROR_SUCCESS)
- return FALSE;
-
- return !memcmp(&hash, &file->hash, sizeof(MSIFILEHASHINFO));
-}
-
static BOOL installfiles_cb(MSIPACKAGE *package, LPCWSTR file, DWORD action,
LPWSTR *path, DWORD *attrs, PVOID user)
{
static MSIFILE *f = NULL;
+ MSIMEDIAINFO *mi = user;
if (action == MSICABEXTRACT_BEGINEXTRACT)
{
return FALSE;
}
- if (f->state != msifs_missing && f->state != msifs_overwrite)
- {
- TRACE("Skipping extraction of %s\n", debugstr_w(file));
+ if (f->disk_id != mi->disk_id || (f->state != msifs_missing && f->state != msifs_overwrite))
return FALSE;
- }
msi_file_update_ui(package, f, szInstallFiles);
if (file->state != msifs_missing && !mi->is_continuous && file->state != msifs_overwrite)
continue;
- if (check_dest_hash_matches(file))
- {
- TRACE("File hashes match, not overwriting\n");
- continue;
- }
-
- if (MsiGetFileVersionW(file->TargetPath, NULL, NULL, NULL, NULL) == ERROR_SUCCESS &&
- msi_compare_file_version(file) >= 0)
- {
- TRACE("Destination file version greater, not overwriting\n");
- continue;
- }
-
if (file->Sequence > mi->last_sequence || mi->is_continuous ||
(file->IsCompressed && !mi->is_extracted))
{
rc = ready_media(package, file, mi);
if (rc != ERROR_SUCCESS)
{
- ERR("Failed to ready media\n");
+ ERR("Failed to ready media for %s\n", debugstr_w(file->File));
break;
}
data.mi = mi;
data.package = package;
data.cb = installfiles_cb;
- data.user = NULL;
+ data.user = mi;
if (file->IsCompressed &&
!msi_cabextract(package, mi, &data))
{
ERR("Failed to extract cabinet: %s\n", debugstr_w(mi->cabinet));
- rc = ERROR_FUNCTION_FAILED;
+ rc = ERROR_INSTALL_FAILURE;
break;
}
}
}
else if (file->state != msifs_installed)
{
- ERR("compressed file wasn't extracted (%s)\n",
- debugstr_w(file->TargetPath));
+ ERR("compressed file wasn't installed (%s)\n", debugstr_w(file->TargetPath));
rc = ERROR_INSTALL_FAILURE;
break;
}
sourcename = MSI_RecordGetString(rec, 3);
options = MSI_RecordGetInteger(rec, 7);
- sourcedir = msi_dup_property(package, MSI_RecordGetString(rec, 5));
+ sourcedir = msi_dup_property(package->db, MSI_RecordGetString(rec, 5));
if (!sourcedir)
goto done;
- destdir = msi_dup_property(package, MSI_RecordGetString(rec, 6));
+ destdir = msi_dup_property(package->db, MSI_RecordGetString(rec, 6));
if (!destdir)
goto done;
if (!dst_path)
{
/* try a property */
- dst_path = msi_dup_property( package, dst_key );
+ dst_path = msi_dup_property( package->db, dst_key );
if (!dst_path)
{
FIXME("Unable to get destination folder, try AppSearch properties\n");
UINT install_mode;
LPWSTR dir = NULL, path = NULL;
DWORD size;
- UINT r;
+ UINT ret = ERROR_SUCCESS;
component = MSI_RecordGetString(row, 2);
filename = MSI_RecordGetString(row, 3);
return ERROR_SUCCESS;
}
- dir = msi_dup_property(package, dirprop);
+ dir = msi_dup_property(package->db, dirprop);
if (!dir)
return ERROR_OUTOFMEMORY;
path = msi_alloc(size * sizeof(WCHAR));
if (!path)
{
- r = ERROR_OUTOFMEMORY;
+ ret = ERROR_OUTOFMEMORY;
goto done;
}
msi_free(path);
msi_free(dir);
- return ERROR_SUCCESS;
+ return ret;
}
UINT ACTION_RemoveFiles( MSIPACKAGE *package )