msi: Enable cab compression and delete any resulting cabs using SHFileOperation

Alexandre Julliard julliard at winehq.org
Fri Dec 15 11:00:33 CST 2006


"James Hawkins" <truiken at gmail.com> writes:

> +static void delete_cab_files(void)
> +{
> +    SHFILEOPSTRUCT shfl;
> +    CHAR path[MAX_PATH];
> +
> +    lstrcpyA(path, CURR_DIR);
> +    lstrcatA(path, "\\*.cab\0");
> +
> +    shfl.hwnd = NULL;
> +    shfl.wFunc = FO_DELETE;
> +    shfl.pFrom = (LPCSTR)path;
> +    shfl.pTo = NULL;
> +    shfl.fFlags = FOF_FILESONLY | FOF_NOCONFIRMATION | FOF_NORECURSION | FOF_SILENT;
> +
> +    SHFileOperation(&shfl);
> +}

If you are going to delete files with wildcards, you need to create a
temp dir and do everything inside it, otherwise you risk deleting
files that are not part of the test.

-- 
Alexandre Julliard
julliard at winehq.org



More information about the wine-devel mailing list