* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
-#include <config.h>
-#include <wine/port.h>
+#include "appwiz.h"
#include <stdio.h>
# include <unistd.h>
#endif
-#define COBJMACROS
-#define NONAMELESSUNION
-#define NONAMELESSSTRUCT
-
-#include <windef.h>
-#include <winbase.h>
#include <msi.h>
-#include "appwiz.h"
-
-#include <wine/debug.h>
-
-WINE_DEFAULT_DEBUG_CHANNEL(appwiz);
-
-#define GECKO_VERSION "2.21"
+#define GECKO_VERSION "2.40"
#ifdef __i386__
#define ARCH_STRING "x86"
-#define GECKO_SHA "a514fc4d53783a586c7880a676c415695fe934a3"
+#define GECKO_SHA "8a3adedf3707973d1ed4ac3b2e791486abf814bd"
#else
#define ARCH_STRING ""
#define GECKO_SHA "???"
static const addon_info_t *addon;
static HWND install_dialog = NULL;
+static IBinding *download_binding;
-static WCHAR GeckoUrl[] = L"http://dl.dropboxusercontent.com/u/743491/ReactOS/wine_gecko-2.21-x86.msi";
+static WCHAR GeckoUrl[] = L"https://svn.reactos.org/amine/wine_gecko-2.40-x86.msi";
/* SHA definitions are copied from advapi32. They aren't available in headers. */
return INSTALL_FAILED;
}
+ if (type == REG_EXPAND_SZ)
+ {
+ size = ExpandEnvironmentStringsA(package_dir, NULL, 0);
+ if (size)
+ {
+ char* buf = heap_alloc(size + sizeof(addon->file_name));
+ ExpandEnvironmentStringsA(package_dir, buf, size);
+ heap_free(package_dir);
+ package_dir = buf;
+ }
+ }
+
TRACE("Trying %s/%s\n", debugstr_a(package_dir), debugstr_a(addon->file_name));
ret = install_from_unix_file(package_dir, "", addon->file_name);
DWORD dwReserved, IBinding *pib)
{
set_status(IDS_DOWNLOADING);
+ IBinding_AddRef(pib);
+ download_binding = pib;
+
return S_OK;
}
static HRESULT WINAPI InstallCallback_OnStopBinding(IBindStatusCallback *iface,
HRESULT hresult, LPCWSTR szError)
{
+ if(download_binding) {
+ IBinding_Release(download_binding);
+ download_binding = NULL;
+ }
+
if(FAILED(hresult)) {
- ERR("Binding failed %08x\n", hresult);
+ if(hresult == E_ABORT)
+ TRACE("Binding aborted\n");
+ else
+ ERR("Binding failed %08x\n", hresult);
return S_OK;
}
hres = URLDownloadToFileW(NULL, GeckoUrl, tmp_file, 0, &InstallCallback);
if(FAILED(hres)) {
ERR("URLDownloadToFile failed: %08x\n", hres);
- return 0;
- }
-
- if(sha_check(tmp_file)) {
- install_file(tmp_file);
- }else {
- WCHAR message[256];
-
- if(LoadStringW(hApplet, IDS_INVALID_SHA, message, sizeof(message)/sizeof(WCHAR))) {
- MessageBoxW(NULL, message, NULL, MB_ICONERROR);
+ } else {
+ if(sha_check(tmp_file)) {
+ install_file(tmp_file);
+ }else {
+ WCHAR message[256];
+
+ if(LoadStringW(hApplet, IDS_INVALID_SHA, message, sizeof(message)/sizeof(WCHAR))) {
+ MessageBoxW(NULL, message, NULL, MB_ICONERROR);
+ }
}
}
case WM_COMMAND:
switch(wParam) {
case IDCANCEL:
- EndDialog(hwnd, 0);
+ if(download_binding) {
+ IBinding_Abort(download_binding);
+ }
+ else {
+ EndDialog(hwnd, 0);
+ }
return FALSE;
case ID_DWL_INSTALL:
ShowWindow(GetDlgItem(hwnd, ID_DWL_PROGRESS), SW_SHOW);
EnableWindow(GetDlgItem(hwnd, ID_DWL_INSTALL), 0);
- EnableWindow(GetDlgItem(hwnd, IDCANCEL), 0); /* FIXME */
CloseHandle( CreateThread(NULL, 0, download_proc, NULL, 0, NULL));
return FALSE;
}
return FALSE;
}
-BOOL install_addon(addon_t addon_type)
+BOOL install_addon(addon_t addon_type, HWND hwnd_parent)
{
if(!*ARCH_STRING)
* - download the package
*/
if (install_from_registered_dir() == INSTALL_NEXT)
- DialogBoxW(hApplet, addon->dialog_template, 0, installer_proc);
+ DialogBoxW(hApplet, addon->dialog_template, hwnd_parent, installer_proc);
return TRUE;
}