Commit 1787bd64 authored by Hans Leidekker's avatar Hans Leidekker Committed by Alexandre Julliard

appwiz.cpl: Read more application attributes from the registry.

parent 48f10834
...@@ -67,6 +67,12 @@ typedef struct APPINFO ...@@ -67,6 +67,12 @@ typedef struct APPINFO
LPWSTR publisher; LPWSTR publisher;
LPWSTR version; LPWSTR version;
LPWSTR contact;
LPWSTR helplink;
LPWSTR helptelephone;
LPWSTR readme;
LPWSTR urlupdateinfo;
LPWSTR comments;
HKEY regroot; HKEY regroot;
WCHAR regkey[MAX_STRING_LEN]; WCHAR regkey[MAX_STRING_LEN];
...@@ -84,21 +90,17 @@ static const WCHAR openW[] = {'o','p','e','n',0}; ...@@ -84,21 +90,17 @@ static const WCHAR openW[] = {'o','p','e','n',0};
static const WCHAR BackSlashW[] = { '\\', 0 }; static const WCHAR BackSlashW[] = { '\\', 0 };
static const WCHAR DisplayNameW[] = {'D','i','s','p','l','a','y','N','a','m','e',0}; static const WCHAR DisplayNameW[] = {'D','i','s','p','l','a','y','N','a','m','e',0};
static const WCHAR DisplayIconW[] = {'D','i','s','p','l','a','y','I','c','o','n',0}; static const WCHAR DisplayIconW[] = {'D','i','s','p','l','a','y','I','c','o','n',0};
static const WCHAR DisplayVersionW[] = {'D','i','s','p','l','a','y','V','e','r', static const WCHAR DisplayVersionW[] = {'D','i','s','p','l','a','y','V','e','r','s','i','o','n',0};
's','i','o','n',0};
static const WCHAR PublisherW[] = {'P','u','b','l','i','s','h','e','r',0}; static const WCHAR PublisherW[] = {'P','u','b','l','i','s','h','e','r',0};
static const WCHAR ContactW[] = {'C','o','n','t','a','c','t',0}; static const WCHAR ContactW[] = {'C','o','n','t','a','c','t',0};
static const WCHAR HelpLinkW[] = {'H','e','l','p','L','i','n','k',0}; static const WCHAR HelpLinkW[] = {'H','e','l','p','L','i','n','k',0};
static const WCHAR HelpTelephoneW[] = {'H','e','l','p','T','e','l','e','p','h', static const WCHAR HelpTelephoneW[] = {'H','e','l','p','T','e','l','e','p','h','o','n','e',0};
'o','n','e',0};
static const WCHAR ModifyPathW[] = {'M','o','d','i','f','y','P','a','t','h',0}; static const WCHAR ModifyPathW[] = {'M','o','d','i','f','y','P','a','t','h',0};
static const WCHAR NoModifyW[] = {'N','o','M','o','d','i','f','y',0}; static const WCHAR NoModifyW[] = {'N','o','M','o','d','i','f','y',0};
static const WCHAR ReadmeW[] = {'R','e','a','d','m','e',0}; static const WCHAR ReadmeW[] = {'R','e','a','d','m','e',0};
static const WCHAR URLUpdateInfoW[] = {'U','R','L','U','p','d','a','t','e','I', static const WCHAR URLUpdateInfoW[] = {'U','R','L','U','p','d','a','t','e','I','n','f','o',0};
'n','f','o',0};
static const WCHAR CommentsW[] = {'C','o','m','m','e','n','t','s',0}; static const WCHAR CommentsW[] = {'C','o','m','m','e','n','t','s',0};
static const WCHAR UninstallCommandlineW[] = {'U','n','i','n','s','t','a','l','l', static const WCHAR UninstallCommandlineW[] = {'U','n','i','n','s','t','a','l','l','S','t','r','i','n','g',0};
'S','t','r','i','n','g',0};
static const WCHAR WindowsInstallerW[] = {'W','i','n','d','o','w','s','I','n','s','t','a','l','l','e','r',0}; static const WCHAR WindowsInstallerW[] = {'W','i','n','d','o','w','s','I','n','s','t','a','l','l','e','r',0};
static const WCHAR SystemComponentW[] = {'S','y','s','t','e','m','C','o','m','p','o','n','e','n','t',0}; static const WCHAR SystemComponentW[] = {'S','y','s','t','e','m','C','o','m','p','o','n','e','n','t',0};
...@@ -139,9 +141,27 @@ static void FreeAppInfo(APPINFO *info) ...@@ -139,9 +141,27 @@ static void FreeAppInfo(APPINFO *info)
HeapFree(GetProcessHeap(), 0, info->icon); HeapFree(GetProcessHeap(), 0, info->icon);
HeapFree(GetProcessHeap(), 0, info->publisher); HeapFree(GetProcessHeap(), 0, info->publisher);
HeapFree(GetProcessHeap(), 0, info->version); HeapFree(GetProcessHeap(), 0, info->version);
HeapFree(GetProcessHeap(), 0, info->contact);
HeapFree(GetProcessHeap(), 0, info->helplink);
HeapFree(GetProcessHeap(), 0, info->helptelephone);
HeapFree(GetProcessHeap(), 0, info->readme);
HeapFree(GetProcessHeap(), 0, info->urlupdateinfo);
HeapFree(GetProcessHeap(), 0, info->comments);
HeapFree(GetProcessHeap(), 0, info); HeapFree(GetProcessHeap(), 0, info);
} }
static WCHAR *get_reg_str(HKEY hkey, const WCHAR *value)
{
DWORD len, type;
WCHAR *ret = NULL;
if (!RegQueryValueExW(hkey, value, NULL, &type, NULL, &len) && type == REG_SZ)
{
if (!(ret = HeapAlloc(GetProcessHeap(), 0, len))) return NULL;
RegQueryValueExW(hkey, value, 0, 0, (BYTE *)ret, &len);
}
return ret;
}
/****************************************************************************** /******************************************************************************
* Name : ReadApplicationsFromRegistry * Name : ReadApplicationsFromRegistry
* Description: Creates a linked list of uninstallable applications from the * Description: Creates a linked list of uninstallable applications from the
...@@ -238,30 +258,14 @@ static BOOL ReadApplicationsFromRegistry(HKEY root) ...@@ -238,30 +258,14 @@ static BOOL ReadApplicationsFromRegistry(HKEY root)
} }
} }
/* publisher, version */ info->publisher = get_reg_str(hkeyApp, PublisherW);
if (RegQueryValueExW(hkeyApp, PublisherW, 0, 0, NULL, &displen) == info->version = get_reg_str(hkeyApp, DisplayVersionW);
ERROR_SUCCESS) info->contact = get_reg_str(hkeyApp, ContactW);
{ info->helplink = get_reg_str(hkeyApp, HelpLinkW);
info->publisher = HeapAlloc(GetProcessHeap(), 0, displen); info->helptelephone = get_reg_str(hkeyApp, HelpTelephoneW);
info->readme = get_reg_str(hkeyApp, ReadmeW);
if (!info->publisher) info->urlupdateinfo = get_reg_str(hkeyApp, URLUpdateInfoW);
goto err; info->comments = get_reg_str(hkeyApp, CommentsW);
RegQueryValueExW(hkeyApp, PublisherW, 0, 0, (LPBYTE)info->publisher,
&displen);
}
if (RegQueryValueExW(hkeyApp, DisplayVersionW, 0, 0, NULL, &displen) ==
ERROR_SUCCESS)
{
info->version = HeapAlloc(GetProcessHeap(), 0, displen);
if (!info->version)
goto err;
RegQueryValueExW(hkeyApp, DisplayVersionW, 0, 0, (LPBYTE)info->version,
&displen);
}
/* Check if NoModify is set */ /* Check if NoModify is set */
dwType = REG_DWORD; dwType = REG_DWORD;
...@@ -616,28 +620,16 @@ static INT_PTR CALLBACK SupportInfoDlgProc(HWND hWnd, UINT msg, WPARAM wParam, L ...@@ -616,28 +620,16 @@ static INT_PTR CALLBACK SupportInfoDlgProc(HWND hWnd, UINT msg, WPARAM wParam, L
RegOpenKeyExW(iter->regroot, key, 0, KEY_READ, &hkey); RegOpenKeyExW(iter->regroot, key, 0, KEY_READ, &hkey);
/* Load our "not specified" string */ /* Load our "not specified" string */
LoadStringW(hInst, IDS_NOT_SPECIFIED, notfound, LoadStringW(hInst, IDS_NOT_SPECIFIED, notfound, ARRAY_SIZE(notfound));
ARRAY_SIZE(notfound));
SetInfoDialogText(NULL, iter->publisher, notfound, hWnd, IDC_INFO_PUBLISHER);
/* Update the data for items already read into the structure */ SetInfoDialogText(NULL, iter->version, notfound, hWnd, IDC_INFO_VERSION);
SetInfoDialogText(NULL, iter->publisher, notfound, hWnd, SetInfoDialogText(hkey, iter->contact, notfound, hWnd, IDC_INFO_CONTACT);
IDC_INFO_PUBLISHER); SetInfoDialogText(hkey, iter->helplink, notfound, hWnd, IDC_INFO_SUPPORT);
SetInfoDialogText(NULL, iter->version, notfound, hWnd, SetInfoDialogText(hkey, iter->helptelephone, notfound, hWnd, IDC_INFO_PHONE);
IDC_INFO_VERSION); SetInfoDialogText(hkey, iter->readme, notfound, hWnd, IDC_INFO_README);
SetInfoDialogText(hkey, iter->urlupdateinfo, notfound, hWnd, IDC_INFO_UPDATES);
/* And now update the data for those items in the registry */ SetInfoDialogText(hkey, iter->comments, notfound, hWnd, IDC_INFO_COMMENTS);
SetInfoDialogText(hkey, ContactW, notfound, hWnd,
IDC_INFO_CONTACT);
SetInfoDialogText(hkey, HelpLinkW, notfound, hWnd,
IDC_INFO_SUPPORT);
SetInfoDialogText(hkey, HelpTelephoneW, notfound, hWnd,
IDC_INFO_PHONE);
SetInfoDialogText(hkey, ReadmeW, notfound, hWnd,
IDC_INFO_README);
SetInfoDialogText(hkey, URLUpdateInfoW, notfound, hWnd,
IDC_INFO_UPDATES);
SetInfoDialogText(hkey, CommentsW, notfound, hWnd,
IDC_INFO_COMMENTS);
/* Update the main label with the app name */ /* Update the main label with the app name */
if (GetWindowTextW(GetDlgItem(hWnd, IDC_INFO_LABEL), oldtitle, if (GetWindowTextW(GetDlgItem(hWnd, IDC_INFO_LABEL), oldtitle,
......
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