appwiz.cpl: Use wide-char string literals.
Signed-off-by: Michael Stefaniuc <mstefani@winehq.org> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
d55bc24001
commit
dcf7a1f69e
|
@ -109,14 +109,9 @@ static LPWSTR url = NULL;
|
||||||
static IBinding *dwl_binding;
|
static IBinding *dwl_binding;
|
||||||
static WCHAR *msi_file;
|
static WCHAR *msi_file;
|
||||||
|
|
||||||
static const WCHAR winehomedirW[] = {'W','I','N','E','H','O','M','E','D','I','R',0};
|
|
||||||
static const WCHAR winedatadirW[] = {'W','I','N','E','D','A','T','A','D','I','R',0};
|
|
||||||
static const WCHAR winebuilddirW[] = {'W','I','N','E','B','U','I','L','D','D','I','R',0};
|
|
||||||
|
|
||||||
extern const char * CDECL wine_get_version(void);
|
extern const char * CDECL wine_get_version(void);
|
||||||
|
|
||||||
static WCHAR * (CDECL *p_wine_get_dos_file_name)(const char*);
|
static WCHAR * (CDECL *p_wine_get_dos_file_name)(const char*);
|
||||||
static const WCHAR kernel32_dllW[] = {'k','e','r','n','e','l','3','2','.','d','l','l',0};
|
|
||||||
|
|
||||||
static BOOL sha_check(const WCHAR *file_name)
|
static BOOL sha_check(const WCHAR *file_name)
|
||||||
{
|
{
|
||||||
|
@ -187,14 +182,11 @@ enum install_res {
|
||||||
|
|
||||||
static enum install_res install_file(const WCHAR *file_name)
|
static enum install_res install_file(const WCHAR *file_name)
|
||||||
{
|
{
|
||||||
static const WCHAR update_cmd[] = {
|
|
||||||
'R','E','I','N','S','T','A','L','L','=','A','L','L',' ',
|
|
||||||
'R','E','I','N','S','T','A','L','L','M','O','D','E','=','v','o','m','u','s',0};
|
|
||||||
ULONG res;
|
ULONG res;
|
||||||
|
|
||||||
res = MsiInstallProductW(file_name, NULL);
|
res = MsiInstallProductW(file_name, NULL);
|
||||||
if(res == ERROR_PRODUCT_VERSION)
|
if(res == ERROR_PRODUCT_VERSION)
|
||||||
res = MsiInstallProductW(file_name, update_cmd);
|
res = MsiInstallProductW(file_name, L"REINSTALL=ALL REINSTALLMODE=vomus");
|
||||||
if(res != ERROR_SUCCESS) {
|
if(res != ERROR_SUCCESS) {
|
||||||
ERR("MsiInstallProduct failed: %u\n", res);
|
ERR("MsiInstallProduct failed: %u\n", res);
|
||||||
return INSTALL_FAILED;
|
return INSTALL_FAILED;
|
||||||
|
@ -252,10 +244,8 @@ static HKEY open_config_key(void)
|
||||||
HKEY hkey, ret;
|
HKEY hkey, ret;
|
||||||
DWORD res;
|
DWORD res;
|
||||||
|
|
||||||
static const WCHAR wine_keyW[] = {'S','o','f','t','w','a','r','e','\\','W','i','n','e',0};
|
|
||||||
|
|
||||||
/* @@ Wine registry key: HKCU\Software\Wine\$config_key */
|
/* @@ Wine registry key: HKCU\Software\Wine\$config_key */
|
||||||
res = RegOpenKeyW(HKEY_CURRENT_USER, wine_keyW, &hkey);
|
res = RegOpenKeyW(HKEY_CURRENT_USER, L"Software\\Wine", &hkey);
|
||||||
if(res != ERROR_SUCCESS)
|
if(res != ERROR_SUCCESS)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
|
@ -298,19 +288,18 @@ static enum install_res install_from_registered_dir(void)
|
||||||
|
|
||||||
static enum install_res install_from_default_dir(void)
|
static enum install_res install_from_default_dir(void)
|
||||||
{
|
{
|
||||||
static const WCHAR dotdotW[] = {'\\','.','.','\\',0};
|
|
||||||
const WCHAR *package_dir;
|
const WCHAR *package_dir;
|
||||||
WCHAR *dir_buf = NULL;
|
WCHAR *dir_buf = NULL;
|
||||||
enum install_res ret = INSTALL_NEXT;
|
enum install_res ret = INSTALL_NEXT;
|
||||||
|
|
||||||
if ((package_dir = _wgetenv( winebuilddirW )))
|
if ((package_dir = _wgetenv( L"WINEBUILDDIR" )))
|
||||||
{
|
{
|
||||||
dir_buf = heap_alloc( lstrlenW(package_dir) * sizeof(WCHAR) + sizeof(dotdotW));
|
dir_buf = heap_alloc( lstrlenW(package_dir) * sizeof(WCHAR) + sizeof(L"\\..\\") );
|
||||||
lstrcpyW( dir_buf, package_dir );
|
lstrcpyW( dir_buf, package_dir );
|
||||||
lstrcatW( dir_buf, dotdotW );
|
lstrcatW( dir_buf, L"\\..\\" );
|
||||||
package_dir = dir_buf;
|
package_dir = dir_buf;
|
||||||
}
|
}
|
||||||
else package_dir = _wgetenv( winedatadirW );
|
else package_dir = _wgetenv( L"WINEDATADIR" );
|
||||||
|
|
||||||
if (package_dir)
|
if (package_dir)
|
||||||
{
|
{
|
||||||
|
@ -329,8 +318,6 @@ static enum install_res install_from_default_dir(void)
|
||||||
|
|
||||||
static WCHAR *get_cache_file_name(BOOL ensure_exists)
|
static WCHAR *get_cache_file_name(BOOL ensure_exists)
|
||||||
{
|
{
|
||||||
static const WCHAR cacheW[] = {'\\','.','c','a','c','h','e',0};
|
|
||||||
static const WCHAR wineW[] = {'\\','w','i','n','e',0};
|
|
||||||
const char *xdg_dir;
|
const char *xdg_dir;
|
||||||
const WCHAR *home_dir;
|
const WCHAR *home_dir;
|
||||||
WCHAR *cache_dir, *ret;
|
WCHAR *cache_dir, *ret;
|
||||||
|
@ -341,11 +328,11 @@ static WCHAR *get_cache_file_name(BOOL ensure_exists)
|
||||||
{
|
{
|
||||||
if (!(cache_dir = p_wine_get_dos_file_name( xdg_dir ))) return NULL;
|
if (!(cache_dir = p_wine_get_dos_file_name( xdg_dir ))) return NULL;
|
||||||
}
|
}
|
||||||
else if ((home_dir = _wgetenv( winehomedirW )))
|
else if ((home_dir = _wgetenv( L"WINEHOMEDIR" )))
|
||||||
{
|
{
|
||||||
if (!(cache_dir = heap_alloc( lstrlenW(home_dir) * sizeof(WCHAR) + sizeof(cacheW) ))) return NULL;
|
if (!(cache_dir = heap_alloc( lstrlenW(home_dir) * sizeof(WCHAR) + sizeof(L"\\.cache") ))) return NULL;
|
||||||
lstrcpyW( cache_dir, home_dir );
|
lstrcpyW( cache_dir, home_dir );
|
||||||
lstrcatW( cache_dir, cacheW );
|
lstrcatW( cache_dir, L"\\.cache" );
|
||||||
cache_dir[1] = '\\'; /* change \??\ into \\?\ */
|
cache_dir[1] = '\\'; /* change \??\ into \\?\ */
|
||||||
}
|
}
|
||||||
else return NULL;
|
else return NULL;
|
||||||
|
@ -357,14 +344,14 @@ static WCHAR *get_cache_file_name(BOOL ensure_exists)
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
size = lstrlenW( cache_dir ) + ARRAY_SIZE(wineW) + lstrlenW( addon->file_name ) + 1;
|
size = lstrlenW( cache_dir ) + ARRAY_SIZE(L"\\wine") + lstrlenW( addon->file_name ) + 1;
|
||||||
if (!(ret = heap_alloc( size * sizeof(WCHAR) )))
|
if (!(ret = heap_alloc( size * sizeof(WCHAR) )))
|
||||||
{
|
{
|
||||||
heap_free( cache_dir );
|
heap_free( cache_dir );
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
lstrcpyW( ret, cache_dir );
|
lstrcpyW( ret, cache_dir );
|
||||||
lstrcatW( ret, wineW );
|
lstrcatW( ret, L"\\wine" );
|
||||||
heap_free( cache_dir );
|
heap_free( cache_dir );
|
||||||
|
|
||||||
if (ensure_exists && !CreateDirectoryW( ret, NULL ) && GetLastError() != ERROR_ALREADY_EXISTS)
|
if (ensure_exists && !CreateDirectoryW( ret, NULL ) && GetLastError() != ERROR_ALREADY_EXISTS)
|
||||||
|
@ -583,18 +570,15 @@ static HRESULT WINAPI InstallCallbackBindInfo_GetBindInfo(IInternetBindInfo *ifa
|
||||||
static HRESULT WINAPI InstallCallbackBindInfo_GetBindString(IInternetBindInfo *iface, ULONG string_type,
|
static HRESULT WINAPI InstallCallbackBindInfo_GetBindString(IInternetBindInfo *iface, ULONG string_type,
|
||||||
WCHAR **strs, ULONG cnt, ULONG *fetched)
|
WCHAR **strs, ULONG cnt, ULONG *fetched)
|
||||||
{
|
{
|
||||||
static const WCHAR wine_addon_downloaderW[] =
|
|
||||||
{'W','i','n','e',' ','A','d','d','o','n',' ','D','o','w','n','l','o','a','d','e','r',0};
|
|
||||||
|
|
||||||
switch(string_type) {
|
switch(string_type) {
|
||||||
case BINDSTRING_USER_AGENT:
|
case BINDSTRING_USER_AGENT:
|
||||||
TRACE("BINDSTRING_USER_AGENT\n");
|
TRACE("BINDSTRING_USER_AGENT\n");
|
||||||
|
|
||||||
*strs = CoTaskMemAlloc(sizeof(wine_addon_downloaderW));
|
*strs = CoTaskMemAlloc(sizeof(L"Wine Addon Downloader"));
|
||||||
if(!*strs)
|
if(!*strs)
|
||||||
return E_OUTOFMEMORY;
|
return E_OUTOFMEMORY;
|
||||||
|
|
||||||
memcpy(*strs, wine_addon_downloaderW, sizeof(wine_addon_downloaderW));
|
lstrcpyW(*strs, L"Wine Addon Downloader");
|
||||||
*fetched = 1;
|
*fetched = 1;
|
||||||
return S_OK;
|
return S_OK;
|
||||||
}
|
}
|
||||||
|
@ -698,13 +682,11 @@ static void run_winebrowser(const WCHAR *url)
|
||||||
WCHAR *args;
|
WCHAR *args;
|
||||||
BOOL ret;
|
BOOL ret;
|
||||||
|
|
||||||
static const WCHAR winebrowserW[] = {'\\','w','i','n','e','b','r','o','w','s','e','r','.','e','x','e',0};
|
|
||||||
|
|
||||||
url_len = lstrlenW(url);
|
url_len = lstrlenW(url);
|
||||||
|
|
||||||
len = GetSystemDirectoryW(app, MAX_PATH - ARRAY_SIZE(winebrowserW));
|
len = GetSystemDirectoryW(app, MAX_PATH - ARRAY_SIZE(L"\\winebrowser.exe"));
|
||||||
memcpy(app+len, winebrowserW, sizeof(winebrowserW));
|
lstrcpyW(app+len, L"\\winebrowser.exe");
|
||||||
len += ARRAY_SIZE(winebrowserW) - 1;
|
len += ARRAY_SIZE(L"\\winebrowser.exe") - 1;
|
||||||
|
|
||||||
args = heap_alloc((len+1+url_len)*sizeof(WCHAR));
|
args = heap_alloc((len+1+url_len)*sizeof(WCHAR));
|
||||||
if(!args)
|
if(!args)
|
||||||
|
@ -771,7 +753,7 @@ BOOL install_addon(addon_t addon_type)
|
||||||
|
|
||||||
addon = addons_info+addon_type;
|
addon = addons_info+addon_type;
|
||||||
|
|
||||||
p_wine_get_dos_file_name = (void*)GetProcAddress(GetModuleHandleW(kernel32_dllW), "wine_get_dos_file_name");
|
p_wine_get_dos_file_name = (void *)GetProcAddress(GetModuleHandleW(L"kernel32.dll"), "wine_get_dos_file_name");
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Try to find addon .msi file in following order:
|
* Try to find addon .msi file in following order:
|
||||||
|
|
|
@ -80,32 +80,7 @@ HINSTANCE hInst;
|
||||||
static WCHAR btnRemove[MAX_STRING_LEN];
|
static WCHAR btnRemove[MAX_STRING_LEN];
|
||||||
static WCHAR btnModifyRemove[MAX_STRING_LEN];
|
static WCHAR btnModifyRemove[MAX_STRING_LEN];
|
||||||
|
|
||||||
static const WCHAR openW[] = {'o','p','e','n',0};
|
static const WCHAR PathUninstallW[] = L"Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall";
|
||||||
|
|
||||||
/* names of registry keys */
|
|
||||||
static const WCHAR BackSlashW[] = { '\\', 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 DisplayVersionW[] = {'D','i','s','p','l','a','y','V','e','r','s','i','o','n',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 HelpLinkW[] = {'H','e','l','p','L','i','n','k',0};
|
|
||||||
static const WCHAR HelpTelephoneW[] = {'H','e','l','p','T','e','l','e','p','h','o','n','e',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 ReadmeW[] = {'R','e','a','d','m','e',0};
|
|
||||||
static const WCHAR URLUpdateInfoW[] = {'U','R','L','U','p','d','a','t','e','I','n','f','o',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','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 SystemComponentW[] = {'S','y','s','t','e','m','C','o','m','p','o','n','e','n','t',0};
|
|
||||||
|
|
||||||
static const WCHAR PathUninstallW[] = {
|
|
||||||
'S','o','f','t','w','a','r','e','\\',
|
|
||||||
'M','i','c','r','o','s','o','f','t','\\',
|
|
||||||
'W','i','n','d','o','w','s','\\',
|
|
||||||
'C','u','r','r','e','n','t','V','e','r','s','i','o','n','\\',
|
|
||||||
'U','n','i','n','s','t','a','l','l',0 };
|
|
||||||
|
|
||||||
/******************************************************************************
|
/******************************************************************************
|
||||||
* Name : DllMain
|
* Name : DllMain
|
||||||
|
@ -184,7 +159,7 @@ static BOOL ReadApplicationsFromRegistry(HKEY root)
|
||||||
{
|
{
|
||||||
RegOpenKeyExW(root, subKeyName, 0, KEY_READ, &hkeyApp);
|
RegOpenKeyExW(root, subKeyName, 0, KEY_READ, &hkeyApp);
|
||||||
size = sizeof(value);
|
size = sizeof(value);
|
||||||
if (!RegQueryValueExW(hkeyApp, SystemComponentW, NULL, &dwType, (LPBYTE)&value, &size)
|
if (!RegQueryValueExW(hkeyApp, L"SystemComponent", NULL, &dwType, (BYTE *)&value, &size)
|
||||||
&& dwType == REG_DWORD && value == 1)
|
&& dwType == REG_DWORD && value == 1)
|
||||||
{
|
{
|
||||||
RegCloseKey(hkeyApp);
|
RegCloseKey(hkeyApp);
|
||||||
|
@ -193,22 +168,21 @@ static BOOL ReadApplicationsFromRegistry(HKEY root)
|
||||||
}
|
}
|
||||||
displen = 0;
|
displen = 0;
|
||||||
uninstlen = 0;
|
uninstlen = 0;
|
||||||
if (!RegQueryValueExW(hkeyApp, DisplayNameW, 0, 0, NULL, &displen))
|
if (!RegQueryValueExW(hkeyApp, L"DisplayName", 0, 0, NULL, &displen))
|
||||||
{
|
{
|
||||||
size = sizeof(value);
|
size = sizeof(value);
|
||||||
if (!RegQueryValueExW(hkeyApp, WindowsInstallerW, NULL, &dwType, (LPBYTE)&value, &size)
|
if (!RegQueryValueExW(hkeyApp, L"WindowsInstaller", NULL, &dwType, (BYTE *)&value, &size)
|
||||||
&& dwType == REG_DWORD && value == 1)
|
&& dwType == REG_DWORD && value == 1)
|
||||||
{
|
{
|
||||||
static const WCHAR fmtW[] = {'m','s','i','e','x','e','c',' ','/','x','%','s',0};
|
int len = lstrlenW(L"msiexec /x%s") + lstrlenW(subKeyName);
|
||||||
int len = lstrlenW(fmtW) + lstrlenW(subKeyName);
|
|
||||||
|
|
||||||
if (!(command = HeapAlloc(GetProcessHeap(), 0, len * sizeof(WCHAR)))) goto err;
|
if (!(command = HeapAlloc(GetProcessHeap(), 0, len * sizeof(WCHAR)))) goto err;
|
||||||
wsprintfW(command, fmtW, subKeyName);
|
wsprintfW(command, L"msiexec /x%s", subKeyName);
|
||||||
}
|
}
|
||||||
else if (!RegQueryValueExW(hkeyApp, UninstallCommandlineW, 0, 0, NULL, &uninstlen))
|
else if (!RegQueryValueExW(hkeyApp, L"UninstallString", 0, 0, NULL, &uninstlen))
|
||||||
{
|
{
|
||||||
if (!(command = HeapAlloc(GetProcessHeap(), 0, uninstlen))) goto err;
|
if (!(command = HeapAlloc(GetProcessHeap(), 0, uninstlen))) goto err;
|
||||||
RegQueryValueExW(hkeyApp, UninstallCommandlineW, 0, 0, (LPBYTE)command, &uninstlen);
|
RegQueryValueExW(hkeyApp, L"UninstallString", 0, 0, (BYTE *)command, &uninstlen);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -225,12 +199,11 @@ static BOOL ReadApplicationsFromRegistry(HKEY root)
|
||||||
if (!info->title)
|
if (!info->title)
|
||||||
goto err;
|
goto err;
|
||||||
|
|
||||||
RegQueryValueExW(hkeyApp, DisplayNameW, 0, 0, (LPBYTE)info->title,
|
RegQueryValueExW(hkeyApp, L"DisplayName", 0, 0, (BYTE *)info->title, &displen);
|
||||||
&displen);
|
|
||||||
|
|
||||||
/* now get DisplayIcon */
|
/* now get DisplayIcon */
|
||||||
displen = 0;
|
displen = 0;
|
||||||
RegQueryValueExW(hkeyApp, DisplayIconW, 0, 0, NULL, &displen);
|
RegQueryValueExW(hkeyApp, L"DisplayIcon", 0, 0, NULL, &displen);
|
||||||
|
|
||||||
if (displen == 0)
|
if (displen == 0)
|
||||||
info->icon = 0;
|
info->icon = 0;
|
||||||
|
@ -241,8 +214,7 @@ static BOOL ReadApplicationsFromRegistry(HKEY root)
|
||||||
if (!info->icon)
|
if (!info->icon)
|
||||||
goto err;
|
goto err;
|
||||||
|
|
||||||
RegQueryValueExW(hkeyApp, DisplayIconW, 0, 0, (LPBYTE)info->icon,
|
RegQueryValueExW(hkeyApp, L"DisplayIcon", 0, 0, (BYTE *)info->icon, &displen);
|
||||||
&displen);
|
|
||||||
|
|
||||||
/* separate the index from the icon name, if supplied */
|
/* separate the index from the icon name, if supplied */
|
||||||
iconPtr = wcschr(info->icon, ',');
|
iconPtr = wcschr(info->icon, ',');
|
||||||
|
@ -254,21 +226,21 @@ static BOOL ReadApplicationsFromRegistry(HKEY root)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
info->publisher = get_reg_str(hkeyApp, PublisherW);
|
info->publisher = get_reg_str(hkeyApp, L"Publisher");
|
||||||
info->version = get_reg_str(hkeyApp, DisplayVersionW);
|
info->version = get_reg_str(hkeyApp, L"DisplayVersion");
|
||||||
info->contact = get_reg_str(hkeyApp, ContactW);
|
info->contact = get_reg_str(hkeyApp, L"Contact");
|
||||||
info->helplink = get_reg_str(hkeyApp, HelpLinkW);
|
info->helplink = get_reg_str(hkeyApp, L"HelpLink");
|
||||||
info->helptelephone = get_reg_str(hkeyApp, HelpTelephoneW);
|
info->helptelephone = get_reg_str(hkeyApp, L"HelpTelephone");
|
||||||
info->readme = get_reg_str(hkeyApp, ReadmeW);
|
info->readme = get_reg_str(hkeyApp, L"Readme");
|
||||||
info->urlupdateinfo = get_reg_str(hkeyApp, URLUpdateInfoW);
|
info->urlupdateinfo = get_reg_str(hkeyApp, L"URLUpdateInfo");
|
||||||
info->comments = get_reg_str(hkeyApp, CommentsW);
|
info->comments = get_reg_str(hkeyApp, L"Comments");
|
||||||
|
|
||||||
/* Check if NoModify is set */
|
/* Check if NoModify is set */
|
||||||
dwType = REG_DWORD;
|
dwType = REG_DWORD;
|
||||||
dwNoModify = 0;
|
dwNoModify = 0;
|
||||||
displen = sizeof(DWORD);
|
displen = sizeof(DWORD);
|
||||||
|
|
||||||
if (RegQueryValueExW(hkeyApp, NoModifyW, NULL, &dwType, (LPBYTE)&dwNoModify, &displen)
|
if (RegQueryValueExW(hkeyApp, L"NoModify", NULL, &dwType, (BYTE *)&dwNoModify, &displen)
|
||||||
!= ERROR_SUCCESS)
|
!= ERROR_SUCCESS)
|
||||||
{
|
{
|
||||||
dwNoModify = 0;
|
dwNoModify = 0;
|
||||||
|
@ -282,19 +254,18 @@ static BOOL ReadApplicationsFromRegistry(HKEY root)
|
||||||
if (!dwNoModify)
|
if (!dwNoModify)
|
||||||
{
|
{
|
||||||
size = sizeof(value);
|
size = sizeof(value);
|
||||||
if (!RegQueryValueExW(hkeyApp, WindowsInstallerW, NULL, &dwType, (LPBYTE)&value, &size)
|
if (!RegQueryValueExW(hkeyApp, L"WindowsInstaller", NULL, &dwType, (BYTE *)&value, &size)
|
||||||
&& dwType == REG_DWORD && value == 1)
|
&& dwType == REG_DWORD && value == 1)
|
||||||
{
|
{
|
||||||
static const WCHAR fmtW[] = {'m','s','i','e','x','e','c',' ','/','i','%','s',0};
|
int len = lstrlenW(L"msiexec /i%s") + lstrlenW(subKeyName);
|
||||||
int len = lstrlenW(fmtW) + lstrlenW(subKeyName);
|
|
||||||
|
|
||||||
if (!(info->path_modify = HeapAlloc(GetProcessHeap(), 0, len * sizeof(WCHAR)))) goto err;
|
if (!(info->path_modify = HeapAlloc(GetProcessHeap(), 0, len * sizeof(WCHAR)))) goto err;
|
||||||
wsprintfW(info->path_modify, fmtW, subKeyName);
|
wsprintfW(info->path_modify, L"msiexec /i%s", subKeyName);
|
||||||
}
|
}
|
||||||
else if (!RegQueryValueExW(hkeyApp, ModifyPathW, 0, 0, NULL, &displen))
|
else if (!RegQueryValueExW(hkeyApp, L"ModifyPath", 0, 0, NULL, &displen))
|
||||||
{
|
{
|
||||||
if (!(info->path_modify = HeapAlloc(GetProcessHeap(), 0, displen))) goto err;
|
if (!(info->path_modify = HeapAlloc(GetProcessHeap(), 0, displen))) goto err;
|
||||||
RegQueryValueExW(hkeyApp, ModifyPathW, 0, 0, (LPBYTE)info->path_modify, &displen);
|
RegQueryValueExW(hkeyApp, L"ModifyPath", 0, 0, (BYTE *)info->path_modify, &displen);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -440,8 +411,6 @@ static void UpdateButtons(HWND hWnd)
|
||||||
*/
|
*/
|
||||||
static void InstallProgram(HWND hWnd)
|
static void InstallProgram(HWND hWnd)
|
||||||
{
|
{
|
||||||
static const WCHAR filters[] = {'%','s','%','c','*','i','n','s','t','a','l','*','.','e','x','e',';','*','s','e','t','u','p','*','.','e','x','e',';','*','.','m','s','i','%','c','%','s','%','c','*','.','e','x','e','%','c','%','s','%','c','*','.','*','%','c',0}
|
|
||||||
;
|
|
||||||
OPENFILENAMEW ofn;
|
OPENFILENAMEW ofn;
|
||||||
WCHAR titleW[MAX_STRING_LEN];
|
WCHAR titleW[MAX_STRING_LEN];
|
||||||
WCHAR filter_installs[MAX_STRING_LEN];
|
WCHAR filter_installs[MAX_STRING_LEN];
|
||||||
|
@ -455,8 +424,8 @@ static void InstallProgram(HWND hWnd)
|
||||||
LoadStringW(hInst, IDS_FILTER_PROGRAMS, filter_programs, ARRAY_SIZE(filter_programs));
|
LoadStringW(hInst, IDS_FILTER_PROGRAMS, filter_programs, ARRAY_SIZE(filter_programs));
|
||||||
LoadStringW(hInst, IDS_FILTER_ALL, filter_all, ARRAY_SIZE(filter_all));
|
LoadStringW(hInst, IDS_FILTER_ALL, filter_all, ARRAY_SIZE(filter_all));
|
||||||
|
|
||||||
swprintf( FilterBufferW, MAX_PATH, filters, filter_installs, 0, 0,
|
swprintf( FilterBufferW, MAX_PATH, L"%s%c*instal*.exe;*setup*.exe;*.msi%c%s%c*.exe%c%s%c*.*%c",
|
||||||
filter_programs, 0, 0, filter_all, 0, 0 );
|
filter_installs, 0, 0, filter_programs, 0, 0, filter_all, 0, 0 );
|
||||||
memset(&ofn, 0, sizeof(OPENFILENAMEW));
|
memset(&ofn, 0, sizeof(OPENFILENAMEW));
|
||||||
ofn.lStructSize = sizeof(OPENFILENAMEW);
|
ofn.lStructSize = sizeof(OPENFILENAMEW);
|
||||||
ofn.hwndOwner = hWnd;
|
ofn.hwndOwner = hWnd;
|
||||||
|
@ -476,7 +445,7 @@ static void InstallProgram(HWND hWnd)
|
||||||
SHELLEXECUTEINFOW sei;
|
SHELLEXECUTEINFOW sei;
|
||||||
memset(&sei, 0, sizeof(sei));
|
memset(&sei, 0, sizeof(sei));
|
||||||
sei.cbSize = sizeof(sei);
|
sei.cbSize = sizeof(sei);
|
||||||
sei.lpVerb = openW;
|
sei.lpVerb = L"open";
|
||||||
sei.nShow = SW_SHOWDEFAULT;
|
sei.nShow = SW_SHOWDEFAULT;
|
||||||
sei.fMask = 0;
|
sei.fMask = 0;
|
||||||
sei.lpFile = ofn.lpstrFile;
|
sei.lpFile = ofn.lpstrFile;
|
||||||
|
@ -609,7 +578,7 @@ static INT_PTR CALLBACK SupportInfoDlgProc(HWND hWnd, UINT msg, WPARAM wParam, L
|
||||||
if (iter->id == (int) lParam)
|
if (iter->id == (int) lParam)
|
||||||
{
|
{
|
||||||
lstrcpyW(key, PathUninstallW);
|
lstrcpyW(key, PathUninstallW);
|
||||||
lstrcatW(key, BackSlashW);
|
lstrcatW(key, L"\\");
|
||||||
lstrcatW(key, iter->regkey);
|
lstrcatW(key, iter->regkey);
|
||||||
|
|
||||||
/* check the application's registry entries */
|
/* check the application's registry entries */
|
||||||
|
@ -959,18 +928,15 @@ static void StartApplet(HWND hWnd)
|
||||||
|
|
||||||
static LONG start_params(const WCHAR *params)
|
static LONG start_params(const WCHAR *params)
|
||||||
{
|
{
|
||||||
static const WCHAR install_geckoW[] = {'i','n','s','t','a','l','l','_','g','e','c','k','o',0};
|
|
||||||
static const WCHAR install_monoW[] = {'i','n','s','t','a','l','l','_','m','o','n','o',0};
|
|
||||||
|
|
||||||
if(!params)
|
if(!params)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
if(!wcscmp(params, install_geckoW)) {
|
if(!wcscmp(params, L"install_gecko")) {
|
||||||
install_addon(ADDON_GECKO);
|
install_addon(ADDON_GECKO);
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!wcscmp(params, install_monoW)) {
|
if(!wcscmp(params, L"install_mono")) {
|
||||||
install_addon(ADDON_MONO);
|
install_addon(ADDON_MONO);
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue