Commit d8b6b01b authored by Alexandre Julliard's avatar Alexandre Julliard

appwiz.cpl: Specify a default download URL for add-ons.

parent e3d24386
...@@ -72,6 +72,7 @@ typedef struct { ...@@ -72,6 +72,7 @@ typedef struct {
const char *file_name; const char *file_name;
const char *subdir_name; const char *subdir_name;
const char *sha; const char *sha;
const char *url_default;
const char *config_key; const char *config_key;
const char *url_config_key; const char *url_config_key;
const char *dir_config_key; const char *dir_config_key;
...@@ -84,6 +85,7 @@ static const addon_info_t addons_info[] = { ...@@ -84,6 +85,7 @@ static const addon_info_t addons_info[] = {
"wine_gecko-" GECKO_VERSION "-" ARCH_STRING ".msi", "wine_gecko-" GECKO_VERSION "-" ARCH_STRING ".msi",
"gecko", "gecko",
GECKO_SHA, GECKO_SHA,
"http://source.winehq.org/winegecko.php",
"MSHTML", "GeckoUrl", "GeckoCabDir", "MSHTML", "GeckoUrl", "GeckoCabDir",
MAKEINTRESOURCEW(ID_DWL_GECKO_DIALOG) MAKEINTRESOURCEW(ID_DWL_GECKO_DIALOG)
}, },
...@@ -92,6 +94,7 @@ static const addon_info_t addons_info[] = { ...@@ -92,6 +94,7 @@ static const addon_info_t addons_info[] = {
"wine-mono-" MONO_VERSION ".msi", "wine-mono-" MONO_VERSION ".msi",
"mono", "mono",
MONO_SHA, MONO_SHA,
"http://source.winehq.org/winemono.php",
"Dotnet", "MonoUrl", "MonoCabDir", "Dotnet", "MonoUrl", "MonoCabDir",
MAKEINTRESOURCEW(ID_DWL_MONO_DIALOG) MAKEINTRESOURCEW(ID_DWL_MONO_DIALOG)
} }
...@@ -425,6 +428,22 @@ static const IBindStatusCallbackVtbl InstallCallbackVtbl = { ...@@ -425,6 +428,22 @@ static const IBindStatusCallbackVtbl InstallCallbackVtbl = {
static IBindStatusCallback InstallCallback = { &InstallCallbackVtbl }; static IBindStatusCallback InstallCallback = { &InstallCallbackVtbl };
static void append_url_params( WCHAR *url )
{
static const WCHAR arch_formatW[] = {'?','a','r','c','h','='};
static const WCHAR v_formatW[] = {'&','v','='};
DWORD size = INTERNET_MAX_URL_LENGTH * sizeof(WCHAR);
DWORD len = strlenW(url);
memcpy(url+len, arch_formatW, sizeof(arch_formatW));
len += sizeof(arch_formatW)/sizeof(WCHAR);
len += MultiByteToWideChar(CP_ACP, 0, ARCH_STRING, sizeof(ARCH_STRING),
url+len, size/sizeof(WCHAR)-len)-1;
memcpy(url+len, v_formatW, sizeof(v_formatW));
len += sizeof(v_formatW)/sizeof(WCHAR);
MultiByteToWideChar(CP_ACP, 0, addon->version, -1, url+len, size/sizeof(WCHAR)-len);
}
static LPWSTR get_url(void) static LPWSTR get_url(void)
{ {
DWORD size = INTERNET_MAX_URL_LENGTH*sizeof(WCHAR); DWORD size = INTERNET_MAX_URL_LENGTH*sizeof(WCHAR);
...@@ -434,36 +453,24 @@ static LPWSTR get_url(void) ...@@ -434,36 +453,24 @@ static LPWSTR get_url(void)
DWORD returned_size; DWORD returned_size;
static const WCHAR httpW[] = {'h','t','t','p'}; static const WCHAR httpW[] = {'h','t','t','p'};
static const WCHAR arch_formatW[] = {'?','a','r','c','h','='};
static const WCHAR v_formatW[] = {'&','v','='};
hkey = open_config_key();
if(!hkey)
return NULL;
url = heap_alloc(size); url = heap_alloc(size);
returned_size = size; returned_size = size;
config_key = heap_strdupAtoW(addon->url_config_key); hkey = open_config_key();
res = RegQueryValueExW(hkey, config_key, NULL, &type, (LPBYTE)url, &returned_size); if (hkey)
heap_free(config_key); {
RegCloseKey(hkey); config_key = heap_strdupAtoW(addon->url_config_key);
if(res != ERROR_SUCCESS || type != REG_SZ) { res = RegQueryValueExW(hkey, config_key, NULL, &type, (LPBYTE)url, &returned_size);
heap_free(url); heap_free(config_key);
return NULL; RegCloseKey(hkey);
if(res == ERROR_SUCCESS && type == REG_SZ) goto found;
} }
if(returned_size > sizeof(httpW) && !memcmp(url, httpW, sizeof(httpW))) { MultiByteToWideChar( CP_ACP, 0, addon->url_default, -1, url, size / sizeof(WCHAR) );
DWORD len;
len = strlenW(url); found:
memcpy(url+len, arch_formatW, sizeof(arch_formatW)); if (returned_size > sizeof(httpW) && !memcmp(url, httpW, sizeof(httpW))) append_url_params( url );
len += sizeof(arch_formatW)/sizeof(WCHAR);
len += MultiByteToWideChar(CP_ACP, 0, ARCH_STRING, sizeof(ARCH_STRING), url+len, size/sizeof(WCHAR)-len)-1;
memcpy(url+len, v_formatW, sizeof(v_formatW));
len += sizeof(v_formatW)/sizeof(WCHAR);
MultiByteToWideChar(CP_ACP, 0, addon->version, -1, url+len, size/sizeof(WCHAR)-len);
}
TRACE("Got URL %s\n", debugstr_w(url)); TRACE("Got URL %s\n", debugstr_w(url));
return url; return url;
......
...@@ -3,7 +3,7 @@ Signature="$CHICAGO$" ...@@ -3,7 +3,7 @@ Signature="$CHICAGO$"
[RegisterDll] [RegisterDll]
AddReg=Classes.Reg, Protocols.Reg, IE.Reg, FileAssoc.Reg, WineGecko.Reg AddReg=Classes.Reg, Protocols.Reg, IE.Reg, FileAssoc.Reg
[UnregisterDll] [UnregisterDll]
...@@ -69,10 +69,6 @@ HKLM,"Software\Microsoft\Internet Explorer\Default Behaviors","TIME",, "CLSID:47 ...@@ -69,10 +69,6 @@ HKLM,"Software\Microsoft\Internet Explorer\Default Behaviors","TIME",, "CLSID:47
HKLM,"Software\Microsoft\Internet Explorer\ActiveX Compatibility","Version",,"6.17" HKLM,"Software\Microsoft\Internet Explorer\ActiveX Compatibility","Version",,"6.17"
[WineGecko.Reg]
HKCU,Software\Wine\MSHTML,"GeckoUrl",,"http://source.winehq.org/winegecko.php"
[FileAssoc.Reg] [FileAssoc.Reg]
;; AVI ;; AVI
......
...@@ -712,8 +712,6 @@ HKLM,SOFTWARE\Microsoft\Active Setup\Installed Components\{de5aed00-a4bf-11d1-99 ...@@ -712,8 +712,6 @@ HKLM,SOFTWARE\Microsoft\Active Setup\Installed Components\{de5aed00-a4bf-11d1-99
HKLM,SOFTWARE\Microsoft\Active Setup\Installed Components\{de5aed00-a4bf-11d1-9948-00c04f98bbc9},"Locale",2,"*" HKLM,SOFTWARE\Microsoft\Active Setup\Installed Components\{de5aed00-a4bf-11d1-9948-00c04f98bbc9},"Locale",2,"*"
HKLM,SOFTWARE\Microsoft\Active Setup\Installed Components\{de5aed00-a4bf-11d1-9948-00c04f98bbc9},"Version",2,"4,74,9273,0" HKLM,SOFTWARE\Microsoft\Active Setup\Installed Components\{de5aed00-a4bf-11d1-9948-00c04f98bbc9},"Version",2,"4,74,9273,0"
HKCU,SOFTWARE\Wine\Dotnet,"MonoUrl",,"http://source.winehq.org/winemono.php"
[Nls] [Nls]
HKLM,System\CurrentControlSet\Control\Nls\Codepage,"37",,"" HKLM,System\CurrentControlSet\Control\Nls\Codepage,"37",,""
HKLM,System\CurrentControlSet\Control\Nls\Language,"0401",,"" HKLM,System\CurrentControlSet\Control\Nls\Language,"0401",,""
......
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