From a00d6a195fe9fc14afc7603af65f6fa6203d95f0 Mon Sep 17 00:00:00 2001 From: Christoph von Wittich Date: Fri, 18 Jan 2008 22:23:52 +0000 Subject: [PATCH] add and to be able to install Diablo 2 Shareware with Download! TODO: write the req. fix which creates a new shortcut with -w -glide see in the xml file svn path=/trunk/; revision=31878 --- rosapps/downloader/downloader.xml | 14 ++++++++ rosapps/downloader/main.c | 53 +++++++++++++++++++++++++++++++ rosapps/downloader/structures.h | 2 ++ rosapps/downloader/xml.c | 10 ++++++ 4 files changed, 79 insertions(+) diff --git a/rosapps/downloader/downloader.xml b/rosapps/downloader/downloader.xml index 16c524558f4..5a4fec425d1 100644 --- a/rosapps/downloader/downloader.xml +++ b/rosapps/downloader/downloader.xml @@ -102,6 +102,12 @@ An Open Source bitmap graphics editor geared towards young children. http://ovh.dl.sourceforge.net/sourceforge/tuxpaint/tuxpaint-0.9.18-win32-installer.exe + + GlidewrapZbag + 0.84c + glidewrapper needed to run Diablo 2 on ReactOS. + http://www.zeckensack.de/glide/archive/GlideWrapper084c.exe + @@ -132,6 +138,14 @@ SamNMax, Day of Tentacle, etc on ReactOS http://ovh.dl.sourceforge.net/sourceforge/scummvm/scummvm-0.10.0-win32.exe + + Diablo 2 Shareware + 1.4 + Diablo 2 Shareware. zeckensack's glide wrapper is req. to run it. + http://ftp.freenet.de./pub/filepilot/windows/spiele/diabloiidemo.exe + GlidewrapZbag + http://svn.reactos.org/fixes/diablo2fix.exe + Nice Clone of Chip's Challenge originally made for the Atari Lynx. Includes free CCLP2 Graphics Pack, so you dont need the copyrighted Original. http://www.muppetlabs.com/~breadbox/pub/software/tworld/tworld-1.3.0-win32-CCLP2.exe diff --git a/rosapps/downloader/main.c b/rosapps/downloader/main.c index 0bcb8483805..dd75784b6e3 100644 --- a/rosapps/downloader/main.c +++ b/rosapps/downloader/main.c @@ -635,10 +635,39 @@ ProfDlgProc(HWND hDlg, return FALSE; } +BOOL IsApplicationInstalled(struct Application* App) +{ + WCHAR Uninstaller[200]; + if(StrCmpW(App->RegName, L"")) { + if(getUninstaller(App->RegName, Uninstaller)) { + return TRUE; + } + } + return FALSE; +} + +struct Application* GetDependency(const WCHAR* Dependency) +{ + struct Category* Category = Root.Children; + + while (Category->Next) + { + while (Category->Apps) + { + if(StrCmpW(Category->Apps->Name, Dependency) == 0) + return Category->Apps; + Category->Apps = Category->Apps->Next; + } + Category = Category->Next; + } + return NULL; +} + LRESULT CALLBACK WndProc (HWND hwnd, UINT Message, WPARAM wParam, LPARAM lParam) { static RECT DescriptionRect; + struct Application* AppToInstall; switch (Message) { @@ -683,7 +712,31 @@ WndProc (HWND hwnd, UINT Message, WPARAM wParam, LPARAM lParam) if (lParam == (LPARAM)hDownloadButton) { if(SelectedApplication) + { + /* install dependencies */ + if(StrCmpW(SelectedApplication->Depends, L"")) + { + AppToInstall = SelectedApplication; + SelectedApplication = GetDependency(SelectedApplication->Depends); + if (!IsApplicationInstalled(SelectedApplication)) + { + DialogBoxW(GetModuleHandle(NULL), MAKEINTRESOURCEW(IDD_DOWNLOAD), 0, DownloadProc); + } + SelectedApplication = AppToInstall; + } + + /* download and install the app */ DialogBoxW(GetModuleHandle(NULL), MAKEINTRESOURCEW(IDD_DOWNLOAD), 0, DownloadProc); + + /* install req. hacks to get it working */ + if(StrCmpW(SelectedApplication->PostInstallAction, L"")) + { + AppToInstall = SelectedApplication; + CopyMemory(SelectedApplication->Location, SelectedApplication->PostInstallAction, sizeof(SelectedApplication->Location)); + DialogBoxW(GetModuleHandle(NULL), MAKEINTRESOURCEW(IDD_DOWNLOAD), 0, DownloadProc); + SelectedApplication = AppToInstall; + } + } else ShowMessage(Strings[IDS_NO_APP_TITLE], Strings[IDS_NO_APP]); } diff --git a/rosapps/downloader/structures.h b/rosapps/downloader/structures.h index 3044ce58506..67d0d48c7de 100644 --- a/rosapps/downloader/structures.h +++ b/rosapps/downloader/structures.h @@ -8,6 +8,8 @@ struct Application WCHAR Licence[0x100]; WCHAR Description[0x400]; WCHAR Location[0x100]; + WCHAR Depends[0x100]; + WCHAR PostInstallAction[0x100]; struct Application* Next; }; diff --git a/rosapps/downloader/xml.c b/rosapps/downloader/xml.c index c05f3e6ae75..09c05fb0515 100644 --- a/rosapps/downloader/xml.c +++ b/rosapps/downloader/xml.c @@ -134,6 +134,16 @@ void text (void* usrdata, const char* data, int len) int currentlengt = lstrlenW(CurrentApplication->Licence); MultiByteToWideChar(CP_UTF8, 0, data, len, &CurrentApplication->Licence[currentlengt], 0x100-currentlengt); } + else if(!strcmp(CurrentTag, "depends")) + { + int currentlengt = lstrlenW(CurrentApplication->Depends); + MultiByteToWideChar(CP_UTF8, 0, data, len, &CurrentApplication->Depends[currentlengt], 0x100-currentlengt); + } + else if(!strcmp(CurrentTag, "postinstallaction")) + { + int currentlengt = lstrlenW(CurrentApplication->PostInstallAction); + MultiByteToWideChar(CP_UTF8, 0, data, len, &CurrentApplication->PostInstallAction[currentlengt], 0x100-currentlengt); + } } void tag_closed (void* tree, const char* tag)