Commit 72e279bd authored by James Hawkins's avatar James Hawkins Committed by Alexandre Julliard

advpack: Implement the DelDirs command.

parent 4df23731
......@@ -60,6 +60,7 @@ typedef HRESULT (*iterate_fields_func)(HINF hinf, PCWSTR field, void *arg);
static const WCHAR CheckAdminRights[] = {
'C','h','e','c','k','A','d','m','i','n','R','i','g','h','t','s',0
};
static const WCHAR DelDirs[] = {'D','e','l','D','i','r','s',0};
static const WCHAR PerUserInstall[] = {'P','e','r','U','s','e','r','I','n','s','t','a','l','l',0};
static const WCHAR RegisterOCXs[] = {'R','e','g','i','s','t','e','r','O','C','X','s',0};
static const WCHAR RunPreSetupCommands[] = {
......@@ -70,6 +71,29 @@ static const WCHAR RunPostSetupCommands[] = {
};
/* Advanced INF callbacks */
static HRESULT del_dirs_callback(HINF hinf, PCWSTR field, void *arg)
{
INFCONTEXT context;
HRESULT hr = S_OK;
DWORD size;
BOOL ok = SetupFindFirstLineW(hinf, field, NULL, &context);
for (; ok; ok = SetupFindNextLine(&context, &context))
{
WCHAR directory[MAX_INF_STRING_LENGTH];
if (!SetupGetLineTextW(&context, NULL, NULL, NULL, directory,
MAX_INF_STRING_LENGTH, &size))
continue;
if (DelNodeW(directory, 0))
hr = E_FAIL;
}
return hr;
}
static HRESULT per_user_install_callback(HINF hinf, PCWSTR field, void *arg)
{
PERUSERSECTIONW per_user;
......@@ -340,6 +364,11 @@ static HRESULT adv_install(ADVInfo *info)
if (hr != S_OK)
return hr;
hr = iterate_section_fields(info->hinf, info->install_sec,
DelDirs, del_dirs_callback, info);
if (hr != S_OK)
return hr;
return hr;
}
......
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