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 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);
|
||||
|
||||
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)
|
||||
{
|
||||
|
@ -187,14 +182,11 @@ enum install_res {
|
|||
|
||||
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;
|
||||
|
||||
res = MsiInstallProductW(file_name, NULL);
|
||||
if(res == ERROR_PRODUCT_VERSION)
|
||||
res = MsiInstallProductW(file_name, update_cmd);
|
||||
res = MsiInstallProductW(file_name, L"REINSTALL=ALL REINSTALLMODE=vomus");
|
||||
if(res != ERROR_SUCCESS) {
|
||||
ERR("MsiInstallProduct failed: %u\n", res);
|
||||
return INSTALL_FAILED;
|
||||
|
@ -252,10 +244,8 @@ static HKEY open_config_key(void)
|
|||
HKEY hkey, ret;
|
||||
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 */
|
||||
res = RegOpenKeyW(HKEY_CURRENT_USER, wine_keyW, &hkey);
|
||||
res = RegOpenKeyW(HKEY_CURRENT_USER, L"Software\\Wine", &hkey);
|
||||
if(res != ERROR_SUCCESS)
|
||||
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 const WCHAR dotdotW[] = {'\\','.','.','\\',0};
|
||||
const WCHAR *package_dir;
|
||||
WCHAR *dir_buf = NULL;
|
||||
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 );
|
||||
lstrcatW( dir_buf, dotdotW );
|
||||
lstrcatW( dir_buf, L"\\..\\" );
|
||||
package_dir = dir_buf;
|
||||
}
|
||||
else package_dir = _wgetenv( winedatadirW );
|
||||
else package_dir = _wgetenv( L"WINEDATADIR" );
|
||||
|
||||
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 const WCHAR cacheW[] = {'\\','.','c','a','c','h','e',0};
|
||||
static const WCHAR wineW[] = {'\\','w','i','n','e',0};
|
||||
const char *xdg_dir;
|
||||
const WCHAR *home_dir;
|
||||
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;
|
||||
}
|
||||
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 );
|
||||
lstrcatW( cache_dir, cacheW );
|
||||
lstrcatW( cache_dir, L"\\.cache" );
|
||||
cache_dir[1] = '\\'; /* change \??\ into \\?\ */
|
||||
}
|
||||
else return NULL;
|
||||
|
@ -357,14 +344,14 @@ static WCHAR *get_cache_file_name(BOOL ensure_exists)
|
|||
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) )))
|
||||
{
|
||||
heap_free( cache_dir );
|
||||
return NULL;
|
||||
}
|
||||
lstrcpyW( ret, cache_dir );
|
||||
lstrcatW( ret, wineW );
|
||||
lstrcatW( ret, L"\\wine" );
|
||||
heap_free( cache_dir );
|
||||
|
||||
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,
|
||||
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) {
|
||||
case BINDSTRING_USER_AGENT:
|
||||
TRACE("BINDSTRING_USER_AGENT\n");
|
||||
|
||||
*strs = CoTaskMemAlloc(sizeof(wine_addon_downloaderW));
|
||||
*strs = CoTaskMemAlloc(sizeof(L"Wine Addon Downloader"));
|
||||
if(!*strs)
|
||||
return E_OUTOFMEMORY;
|
||||
|
||||
memcpy(*strs, wine_addon_downloaderW, sizeof(wine_addon_downloaderW));
|
||||
lstrcpyW(*strs, L"Wine Addon Downloader");
|
||||
*fetched = 1;
|
||||
return S_OK;
|
||||
}
|
||||
|
@ -698,13 +682,11 @@ static void run_winebrowser(const WCHAR *url)
|
|||
WCHAR *args;
|
||||
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);
|
||||
|
||||
len = GetSystemDirectoryW(app, MAX_PATH - ARRAY_SIZE(winebrowserW));
|
||||
memcpy(app+len, winebrowserW, sizeof(winebrowserW));
|
||||
len += ARRAY_SIZE(winebrowserW) - 1;
|
||||
len = GetSystemDirectoryW(app, MAX_PATH - ARRAY_SIZE(L"\\winebrowser.exe"));
|
||||
lstrcpyW(app+len, L"\\winebrowser.exe");
|
||||
len += ARRAY_SIZE(L"\\winebrowser.exe") - 1;
|
||||
|
||||
args = heap_alloc((len+1+url_len)*sizeof(WCHAR));
|
||||
if(!args)
|
||||
|
@ -771,7 +753,7 @@ BOOL install_addon(addon_t 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:
|
||||
|
|
|
@ -80,32 +80,7 @@ HINSTANCE hInst;
|
|||
static WCHAR btnRemove[MAX_STRING_LEN];
|
||||
static WCHAR btnModifyRemove[MAX_STRING_LEN];
|
||||
|
||||
static const WCHAR openW[] = {'o','p','e','n',0};
|
||||
|
||||
/* 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 };
|
||||
static const WCHAR PathUninstallW[] = L"Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall";
|
||||
|
||||
/******************************************************************************
|
||||
* Name : DllMain
|
||||
|
@ -184,7 +159,7 @@ static BOOL ReadApplicationsFromRegistry(HKEY root)
|
|||
{
|
||||
RegOpenKeyExW(root, subKeyName, 0, KEY_READ, &hkeyApp);
|
||||
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)
|
||||
{
|
||||
RegCloseKey(hkeyApp);
|
||||
|
@ -193,22 +168,21 @@ static BOOL ReadApplicationsFromRegistry(HKEY root)
|
|||
}
|
||||
displen = 0;
|
||||
uninstlen = 0;
|
||||
if (!RegQueryValueExW(hkeyApp, DisplayNameW, 0, 0, NULL, &displen))
|
||||
if (!RegQueryValueExW(hkeyApp, L"DisplayName", 0, 0, NULL, &displen))
|
||||
{
|
||||
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)
|
||||
{
|
||||
static const WCHAR fmtW[] = {'m','s','i','e','x','e','c',' ','/','x','%','s',0};
|
||||
int len = lstrlenW(fmtW) + lstrlenW(subKeyName);
|
||||
int len = lstrlenW(L"msiexec /x%s") + lstrlenW(subKeyName);
|
||||
|
||||
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;
|
||||
RegQueryValueExW(hkeyApp, UninstallCommandlineW, 0, 0, (LPBYTE)command, &uninstlen);
|
||||
RegQueryValueExW(hkeyApp, L"UninstallString", 0, 0, (BYTE *)command, &uninstlen);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -225,12 +199,11 @@ static BOOL ReadApplicationsFromRegistry(HKEY root)
|
|||
if (!info->title)
|
||||
goto err;
|
||||
|
||||
RegQueryValueExW(hkeyApp, DisplayNameW, 0, 0, (LPBYTE)info->title,
|
||||
&displen);
|
||||
RegQueryValueExW(hkeyApp, L"DisplayName", 0, 0, (BYTE *)info->title, &displen);
|
||||
|
||||
/* now get DisplayIcon */
|
||||
displen = 0;
|
||||
RegQueryValueExW(hkeyApp, DisplayIconW, 0, 0, NULL, &displen);
|
||||
RegQueryValueExW(hkeyApp, L"DisplayIcon", 0, 0, NULL, &displen);
|
||||
|
||||
if (displen == 0)
|
||||
info->icon = 0;
|
||||
|
@ -241,8 +214,7 @@ static BOOL ReadApplicationsFromRegistry(HKEY root)
|
|||
if (!info->icon)
|
||||
goto err;
|
||||
|
||||
RegQueryValueExW(hkeyApp, DisplayIconW, 0, 0, (LPBYTE)info->icon,
|
||||
&displen);
|
||||
RegQueryValueExW(hkeyApp, L"DisplayIcon", 0, 0, (BYTE *)info->icon, &displen);
|
||||
|
||||
/* separate the index from the icon name, if supplied */
|
||||
iconPtr = wcschr(info->icon, ',');
|
||||
|
@ -254,21 +226,21 @@ static BOOL ReadApplicationsFromRegistry(HKEY root)
|
|||
}
|
||||
}
|
||||
|
||||
info->publisher = get_reg_str(hkeyApp, PublisherW);
|
||||
info->version = get_reg_str(hkeyApp, DisplayVersionW);
|
||||
info->contact = get_reg_str(hkeyApp, ContactW);
|
||||
info->helplink = get_reg_str(hkeyApp, HelpLinkW);
|
||||
info->helptelephone = get_reg_str(hkeyApp, HelpTelephoneW);
|
||||
info->readme = get_reg_str(hkeyApp, ReadmeW);
|
||||
info->urlupdateinfo = get_reg_str(hkeyApp, URLUpdateInfoW);
|
||||
info->comments = get_reg_str(hkeyApp, CommentsW);
|
||||
info->publisher = get_reg_str(hkeyApp, L"Publisher");
|
||||
info->version = get_reg_str(hkeyApp, L"DisplayVersion");
|
||||
info->contact = get_reg_str(hkeyApp, L"Contact");
|
||||
info->helplink = get_reg_str(hkeyApp, L"HelpLink");
|
||||
info->helptelephone = get_reg_str(hkeyApp, L"HelpTelephone");
|
||||
info->readme = get_reg_str(hkeyApp, L"Readme");
|
||||
info->urlupdateinfo = get_reg_str(hkeyApp, L"URLUpdateInfo");
|
||||
info->comments = get_reg_str(hkeyApp, L"Comments");
|
||||
|
||||
/* Check if NoModify is set */
|
||||
dwType = REG_DWORD;
|
||||
dwNoModify = 0;
|
||||
displen = sizeof(DWORD);
|
||||
|
||||
if (RegQueryValueExW(hkeyApp, NoModifyW, NULL, &dwType, (LPBYTE)&dwNoModify, &displen)
|
||||
if (RegQueryValueExW(hkeyApp, L"NoModify", NULL, &dwType, (BYTE *)&dwNoModify, &displen)
|
||||
!= ERROR_SUCCESS)
|
||||
{
|
||||
dwNoModify = 0;
|
||||
|
@ -282,19 +254,18 @@ static BOOL ReadApplicationsFromRegistry(HKEY root)
|
|||
if (!dwNoModify)
|
||||
{
|
||||
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)
|
||||
{
|
||||
static const WCHAR fmtW[] = {'m','s','i','e','x','e','c',' ','/','i','%','s',0};
|
||||
int len = lstrlenW(fmtW) + lstrlenW(subKeyName);
|
||||
int len = lstrlenW(L"msiexec /i%s") + lstrlenW(subKeyName);
|
||||
|
||||
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;
|
||||
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 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;
|
||||
WCHAR titleW[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_ALL, filter_all, ARRAY_SIZE(filter_all));
|
||||
|
||||
swprintf( FilterBufferW, MAX_PATH, filters, filter_installs, 0, 0,
|
||||
filter_programs, 0, 0, filter_all, 0, 0 );
|
||||
swprintf( FilterBufferW, MAX_PATH, L"%s%c*instal*.exe;*setup*.exe;*.msi%c%s%c*.exe%c%s%c*.*%c",
|
||||
filter_installs, 0, 0, filter_programs, 0, 0, filter_all, 0, 0 );
|
||||
memset(&ofn, 0, sizeof(OPENFILENAMEW));
|
||||
ofn.lStructSize = sizeof(OPENFILENAMEW);
|
||||
ofn.hwndOwner = hWnd;
|
||||
|
@ -476,7 +445,7 @@ static void InstallProgram(HWND hWnd)
|
|||
SHELLEXECUTEINFOW sei;
|
||||
memset(&sei, 0, sizeof(sei));
|
||||
sei.cbSize = sizeof(sei);
|
||||
sei.lpVerb = openW;
|
||||
sei.lpVerb = L"open";
|
||||
sei.nShow = SW_SHOWDEFAULT;
|
||||
sei.fMask = 0;
|
||||
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)
|
||||
{
|
||||
lstrcpyW(key, PathUninstallW);
|
||||
lstrcatW(key, BackSlashW);
|
||||
lstrcatW(key, L"\\");
|
||||
lstrcatW(key, iter->regkey);
|
||||
|
||||
/* check the application's registry entries */
|
||||
|
@ -959,18 +928,15 @@ static void StartApplet(HWND hWnd)
|
|||
|
||||
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)
|
||||
return FALSE;
|
||||
|
||||
if(!wcscmp(params, install_geckoW)) {
|
||||
if(!wcscmp(params, L"install_gecko")) {
|
||||
install_addon(ADDON_GECKO);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
if(!wcscmp(params, install_monoW)) {
|
||||
if(!wcscmp(params, L"install_mono")) {
|
||||
install_addon(ADDON_MONO);
|
||||
return TRUE;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue