James Hawkins : advpack: Implement the DelDirs command.
Alexandre Julliard
julliard at wine.codeweavers.com
Fri May 5 12:11:11 CDT 2006
Module: wine
Branch: refs/heads/master
Commit: 72e279bd364e5e4044a64ace8a1405af7d58e88a
URL: http://source.winehq.org/git/?p=wine.git;a=commit;h=72e279bd364e5e4044a64ace8a1405af7d58e88a
Author: James Hawkins <truiken at gmail.com>
Date: Fri Apr 28 20:09:08 2006 -0500
advpack: Implement the DelDirs command.
---
dlls/advpack/install.c | 29 +++++++++++++++++++++++++++++
1 files changed, 29 insertions(+), 0 deletions(-)
diff --git a/dlls/advpack/install.c b/dlls/advpack/install.c
index 2901093..c65a7e2 100644
--- a/dlls/advpack/install.c
+++ b/dlls/advpack/install.c
@@ -60,6 +60,7 @@ typedef HRESULT (*iterate_fields_func)(H
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;
}
More information about the wine-cvs
mailing list