Commit dcf7a1f6 authored by Michael Stefaniuc's avatar Michael Stefaniuc Committed by Alexandre Julliard

appwiz.cpl: Use wide-char string literals.

parent d55bc240
......@@ -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:
......
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