From 07253473d40d431ef43555ad0ff4139f4cc819c2 Mon Sep 17 00:00:00 2001 From: Juan Lang Date: Wed, 19 Jul 2006 10:42:50 -0700 Subject: [PATCH] msi: Implement ACTION_AppSearchIni. --- dlls/msi/appsearch.c | 40 ++++++++++++++++++++++++++++++++++------ 1 file changed, 34 insertions(+), 6 deletions(-) diff --git a/dlls/msi/appsearch.c b/dlls/msi/appsearch.c index 83f8e5b171b..598965ea877 100644 --- a/dlls/msi/appsearch.c +++ b/dlls/msi/appsearch.c @@ -444,7 +444,9 @@ static UINT ACTION_AppSearchIni(MSIPACKAGE *package, LPWSTR *appValue, if (rc == ERROR_SUCCESS) { MSIRECORD *row = 0; - LPWSTR fileName; + LPWSTR fileName, section, key; + int field, type; + WCHAR buf[MAX_PATH]; rc = MSI_ViewExecute(view, 0); if (rc != ERROR_SUCCESS) @@ -460,11 +462,37 @@ static UINT ACTION_AppSearchIni(MSIPACKAGE *package, LPWSTR *appValue, goto end; } - /* get file name */ - fileName = msi_dup_record_field(row,2); - FIXME("AppSearch unimplemented for IniLocator (ini file name %s)\n", - debugstr_w(fileName)); - msi_free( fileName); + fileName = msi_dup_record_field(row, 2); + section = msi_dup_record_field(row, 3); + key = msi_dup_record_field(row, 4); + if ((field = MSI_RecordGetInteger(row, 5)) == MSI_NULL_INTEGER) + field = 0; + if ((type = MSI_RecordGetInteger(row, 6)) == MSI_NULL_INTEGER) + type = 0; + + GetPrivateProfileStringW(section, key, NULL, buf, + sizeof(buf) / sizeof(WCHAR), fileName); + if (buf[0]) + { + switch (type & 0x0f) + { + case msidbLocatorTypeDirectory: + FIXME("unimplemented for type Directory (dir: %s)\n", + debugstr_w(buf)); + break; + case msidbLocatorTypeFileName: + FIXME("unimplemented for type File (file: %s)\n", + debugstr_w(buf)); + break; + case msidbLocatorTypeRawValue: + *appValue = strdupW(buf); + break; + } + } + + msi_free(fileName); + msi_free(section); + msi_free(key); end: if (row)