sorry 25765 was ment to go to trunk

svn path=/branches/ros-branch-0_3_1/; revision=25766
This commit is contained in:
Maarten Bosma 2007-02-10 21:46:37 +00:00
parent d06c2356fb
commit 40790c54c7
11 changed files with 26 additions and 269 deletions

View file

@ -10,9 +10,8 @@
<define name="__USE_W32API" /> <define name="__USE_W32API" />
<define name="WINVER">0x0501</define> <define name="WINVER">0x0501</define>
<define name="_WIN32_IE>0x0600</define> <define name="_WIN32_IE>0x0600</define>
<library>kernel32</library> <library>kernel32</library>
<library>advapi32</library>
<library>ntdll</library> <library>ntdll</library>
<library>user32</library> <library>user32</library>
<library>gdi32</library> <library>gdi32</library>

View file

@ -1,90 +1,54 @@
<tree Version="1"> <!-- Application version this tree is made for --> <tree Version="1"> <!-- Application version this tree is made for -->
<category name="Internet &amp; Network" icon="1"> <category name="Internet &amp; Network" icon="1">
<application name="Firefox 1.5"> <application name="Firefox">
<regname>Mozilla Firefox (1.5)</regname>
<licence>MPL/GPL/LGPL</licence>
<version>1.5.0.9</version>
<description>The most popular and one of the best free WebBrowsers out there.</description>
<location>http://ftp-mozilla.netscape.com/pub/mozilla.org/firefox/releases/1.5.0.9/win32/en-US/Firefox%20Setup%201.5.0.9.exe</location>
</application>
<application name="Firefox 2.0">
<regname>Mozilla Firefox (2.0.0.1)</regname>
<licence>MPL/GPL/LGPL</licence>
<version>2.0.0.1</version>
<description>The most popular and one of the best free WebBrowsers out there.</description> <description>The most popular and one of the best free WebBrowsers out there.</description>
<location>http://ftp-mozilla.netscape.com/pub/mozilla.org/firefox/releases/latest/win32/en-US/Firefox%20Setup%202.0.0.1.exe</location> <location>http://ftp-mozilla.netscape.com/pub/mozilla.org/firefox/releases/latest/win32/en-US/Firefox%20Setup%202.0.0.1.exe</location>
</application> </application>
<application name="Thunderbird"> <application name="Thunderbird">
<regname>Mozilla Thunderbird (1.5)</regname>
<licence>MPL/GPL/LGPL</licence>
<version>1.5.0.9</version>
<description>The most popular and one of the best free MailClients out there.</description> <description>The most popular and one of the best free MailClients out there.</description>
<location>http://ftp-mozilla.netscape.com/pub/mozilla.org/thunderbird/releases/latest/win32/en-US/Thunderbird%20Setup%201.5.0.9.exe</location> <location>http://ftp-mozilla.netscape.com/pub/mozilla.org/thunderbird/releases/latest/win32/en-US/Thunderbird%20Setup%201.5.0.9.exe</location>
</application> </application>
<application name="SeaMonkey"> <application name="SeaMonkey">
<regname>SeaMonkey (1.0.7)</regname>
<version>1.0.7</version>
<description>Mozilla Suite is alive. This is the one and only Browser, Mail, Chat, Composer bundle you will ever need.</description> <description>Mozilla Suite is alive. This is the one and only Browser, Mail, Chat, Composer bundle you will ever need.</description>
<location>http://ftp-mozilla.netscape.com/pub/mozilla.org/seamonkey/releases/1.0.7/seamonkey-1.0.7.en-US.win32.installer.exe</location> <location>http://ftp-mozilla.netscape.com/pub/mozilla.org/seamonkey/releases/1.0.7/seamonkey-1.0.7.en-US.win32.installer.exe</location>
</application> </application>
<application name="Mozilla ActiveX Control">
<regname>Mozilla ActiveX Control v1.7.12 (ReactOS special)</regname>
<version>1.7.12</version>
<description>Essential Component to get ReactOS Explorer's and other application's Internet Browsing feature running.</description>
<location>http://ovh.dl.sourceforge.net/sourceforge/reactos/MozillaControl1712-ReactOS.exe</location>
</application>
<application name="Off By One Browser">
<regname>The Off By One Web Browser</regname>
<description>The Off By One Browser is a very small and fast web browser with full HTML 3.2 support.</description>
<location>http://offbyone.com/offbyone/images/OffByOneSetup.exe</location>
</application>
<application name="Samba TNG"> <application name="Samba TNG">
<description>This tool allows you to access your Windows shared folders/printers with ReactOS.</description> <description>This tool allows you to access your Windows shared folders/printers with ReactOS.</description>
<location>http://svn.reactos.org/packages/samba-tng.exe</location> <location>http://svn.reactos.org/packages/samba-tng.exe</location>
</application> </application>
<application name="Mozilla ActiveX Control">
<description>Essential Component to get ReactOS Explorer's and other application's Internet Browsing feature running.</description>
<location>http://ovh.dl.sourceforge.net/sourceforge/reactos/MozillaControl1712-ReactOS.exe</location>
</application>
<application name="Miranda IM"> <application name="Miranda IM">
<regname>Miranda IM</regname>
<version>0.5.1</version>
<description>Open source multiprotocol instant messaging application - May not work completely.</description> <description>Open source multiprotocol instant messaging application - May not work completely.</description>
<location>http://ovh.dl.sourceforge.net/sourceforge/miranda/miranda-im-v0.5.1-unicode.exe</location> <location>http://ovh.dl.sourceforge.net/sourceforge/miranda/miranda-im-v0.5.1-unicode.exe</location>
</application> </application>
<application name="Putty"> <application name="Putty">
<regname>PuTTY version 0.59</regname>
<licence>MIT</licence>
<version>0.59</version>
<description>A free SSH, Telnet, rlogin, and raw TCP client.</description> <description>A free SSH, Telnet, rlogin, and raw TCP client.</description>
<location>http://the.earth.li/~sgtatham/putty/latest/x86/putty-0.59-installer.exe</location> <location>http://the.earth.li/~sgtatham/putty/latest/x86/putty-0.58-installer.exe</location>
</application> </application>
</category> </category>
<category name="Office" icon="2"> <category name="Office" icon="2">
<application name="Abiword"> <application name="Abiword">
<regname>"AbiWord 2.4.1 (remove only)"</regname>
<version>2.4.1</version>
<description>Word processor.</description> <description>Word processor.</description>
<location>http://www.abiword.org/downloads/abiword/2.4.1/Windows/abiword-setup-2.4.1.exe</location> <location>http://www.abiword.org/downloads/abiword/2.4.1/Windows/abiword-setup-2.4.1.exe</location>
</application> </application>
<application name="OpenOffice"> <application name="OpenOffice">
<regname>OpenOffice.org 2.1</regname>
<version>2.1.0</version>
<description>THE Open Source Office Suite.</description> <description>THE Open Source Office Suite.</description>
<location>http://ftp.tu-chemnitz.de/pub/openoffice-extended//stable/2.1.0/OOo_2.1.0_Win32Intel_install_en-US.exe</location> <location>http://ftp.tu-chemnitz.de/pub/openoffice-extended//stable/2.1.0/OOo_2.1.0_Win32Intel_install_en-US.exe</location>
</application> </application>
</category> </category>
<category name="Graphics" icon="3"> <category name="Graphics" icon="3">
<application name="IrfanView"> <application name="IrfanView">
<regname>IrfanView (remove only)</regname>
<version>3.99</version>
<description>Viewer for all kinds of graphics/audio files/video files.</description> <description>Viewer for all kinds of graphics/audio files/video files.</description>
<location>http://gd.tuwien.ac.at/graphics/irfanview/iview399.exe</location> <location>http://gd.tuwien.ac.at/graphics/irfanview/iview399.exe</location>
</application> </application>
<application name="IrfanView Plugins"> <application name="IrfanView Plugins">
<version>3.99</version>
<description>Additional Plugins for supporting more file types.</description> <description>Additional Plugins for supporting more file types.</description>
<location>http://irfanview.tuwien.ac.at/plugins/irfanview_plugins_399.exe</location> <location>http://irfanview.tuwien.ac.at/plugins/irfanview_plugins_399.exe</location>
</application> </application>
<application name="TuxPaint"> <application name="TuxPaint">
<regname>Tux Paint 0.9.16</regname>
<version>0.9.16</version>
<description>An open source bitmap graphics editor geared towards young children.</description> <description>An open source bitmap graphics editor geared towards young children.</description>
<location>http://ovh.dl.sourceforge.net/sourceforge/tuxpaint/tuxpaint-0.9.16-win32-installer.exe</location> <location>http://ovh.dl.sourceforge.net/sourceforge/tuxpaint/tuxpaint-0.9.16-win32-installer.exe</location>
</application> </application>
@ -93,16 +57,12 @@
</category> </category>
<category name="Development" icon="5"> <category name="Development" icon="5">
<application name="ReactOS Build Environment"> <application name="ReactOS Build Environment">
<regname>ReactOS Build Environment 0.3.4</regname>
<version>0.3.4</version>
<description>Allows you to build the ReactOS Source. For more instructions see ReactOS wiki.</description> <description>Allows you to build the ReactOS Source. For more instructions see ReactOS wiki.</description>
<location>http://ovh.dl.sourceforge.net/sourceforge/reactos/RosBE-0.3.4.exe</location> <location>http://ovh.dl.sourceforge.net/sourceforge/reactos/RosBE-0.3.3.exe</location>
</application> </application>
</category> </category>
<category name="Games &amp; Fun" icon="6"> <category name="Games &amp; Fun" icon="6">
<application name="ScummVM"> <application name="ScummVM">
<regname>ScummVM 0.9.1</regname>
<version>0.9.1</version>
<description>SamNMax, Day of Tentacle, etc on ReactOS</description> <description>SamNMax, Day of Tentacle, etc on ReactOS</description>
<location>http://ovh.dl.sourceforge.net/sourceforge/scummvm/scummvm-0.9.1-win32.exe</location> <location>http://ovh.dl.sourceforge.net/sourceforge/scummvm/scummvm-0.9.1-win32.exe</location>
</application> </application>
@ -110,41 +70,17 @@
<description>Nice Clone of Chip's Challenge originally made for the Atari Lynx. Includes free CCLP2 Graphics Pack, so you dont need the copyrighted Original.</description> <description>Nice Clone of Chip's Challenge originally made for the Atari Lynx. Includes free CCLP2 Graphics Pack, so you dont need the copyrighted Original.</description>
<location>http://www.muppetlabs.com/~breadbox/pub/software/tworld/tworld-1.3.0-win32-CCLP2.exe</location> <location>http://www.muppetlabs.com/~breadbox/pub/software/tworld/tworld-1.3.0-win32-CCLP2.exe</location>
</application> </application>
<application name="LBreakout2">LBreakout2 2.4.1
<regname>LBreakout2 2.4.1</regname>
<version>2.4.1</version>
<description>Breakout Clone using SDL libs.</description>
<location>http://switch.dl.sourceforge.net/sourceforge/lgames/lbreakout2-2.4.1-win32.exe</location>
</application>
<application name="LGeneral">
<regname>LGeneral 1.1</regname>
<version>1.1</version>
<description>Panzer General Clone using SDL libs.</description>
<location>http://kent.dl.sourceforge.net/sourceforge/lgames/lgeneral-1.1-win32.exe</location>
</application>
<application name="LMarbles">
<regname>LMarbles 1.0.6</regname>
<version>1.0.6</version>
<description>Atomix Clone using SDL libs.</description>
<location>http://heanet.dl.sourceforge.net/sourceforge/lgames/lmarbles-1.0.6-win32.exe</location>
</application>
</category> </category>
<category name="Tools" icon="7"> <category name="Tools" icon="7">
<application name="7-Zip"> <application name="7-Zip">
<regname>7-Zip 4.42</regname>
<version>4.42</version>
<description>Utility to create and open 7zip, zip, tar, rar and other archive files.</description> <description>Utility to create and open 7zip, zip, tar, rar and other archive files.</description>
<location>http://ovh.dl.sourceforge.net/sourceforge/sevenzip/7z442.exe</location> <location>http://ovh.dl.sourceforge.net/sourceforge/sevenzip/7z442.exe</location>
</application> </application>
<application name="uTorrent"> <application name="uTorrent">
<regname>&#181;Torrent</regname> <!-- XML-Parser-Error: Mu != &#181; -->
<version>1.6</version>
<description>Small and fast Torrent Client.</description> <description>Small and fast Torrent Client.</description>
<location>http://download.utorrent.com/1.6/uTorrent-1.6-install.exe</location> <location>http://download.utorrent.com/1.6/uTorrent-1.6-install.exe</location>
</application> </application>
<application name="Audio Grabber"> <application name="Audio Grabber">
<regname>Audiograbber 1.83 SE </regname>
<version>1.83 SE</version>
<description>A very good CD Ripper/Audio File Converter.</description> <description>A very good CD Ripper/Audio File Converter.</description>
<location>http://www.audiograbber.de/files/342677432/agsetup183se.exe</location> <location>http://www.audiograbber.de/files/342677432/agsetup183se.exe</location>
</application> </application>

View file

@ -2,20 +2,19 @@
* LICENSE: GPL - See COPYING in the top level directory * LICENSE: GPL - See COPYING in the top level directory
* FILE: base/applications/downloader/xml.c * FILE: base/applications/downloader/xml.c
* PURPOSE: Main program * PURPOSE: Main program
* PROGRAMMERS: Maarten Bosma, Lester Kortenhoeven * PROGRAMMERS: Maarten Bosma
*/ */
#include <windows.h> #include <windows.h>
#include <commctrl.h> #include <commctrl.h>
#include <richedit.h> #include <richedit.h>
#include <stdio.h> #include <stdio.h>
#include <shlwapi.h>
#include "resources.h" #include "resources.h"
#include "structures.h" #include "structures.h"
#define XML_PATH "C:\\ReactOS\\system32\\downloader.xml" #define XML_PATH "C:\\ReactOS\\system32\\downloader.xml"
HWND hwnd, hCategories, hApps, hDownloadButton, hUninstallButton, hUpdateButton, hHelpButton; HWND hCategories, hApps, hDownloadButton, hUpdateButton, hHelpButton;
HBITMAP hLogo, hUnderline; HBITMAP hLogo, hUnderline;
WCHAR* DescriptionHeadline = L""; WCHAR* DescriptionHeadline = L"";
WCHAR* DescriptionText = L""; WCHAR* DescriptionText = L"";
@ -28,49 +27,13 @@ BOOL ProcessXML (const char* filename, struct Category* Root);
VOID FreeTree (struct Category* Node); VOID FreeTree (struct Category* Node);
WCHAR Strings [STRING_COUNT][MAX_STRING_LENGHT]; WCHAR Strings [STRING_COUNT][MAX_STRING_LENGHT];
BOOL getUninstaller(WCHAR* RegName, WCHAR* Uninstaller) {
const DWORD ArraySize = 200;
HKEY hKey1;
HKEY hKey2;
DWORD Type = 0;
DWORD Size = ArraySize;
WCHAR Value[ArraySize];
WCHAR KeyName[ArraySize];
LONG i = 0;
if (RegOpenKeyExW(HKEY_LOCAL_MACHINE,L"SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall",0,KEY_READ,&hKey1) == ERROR_SUCCESS) {
while (RegEnumKeyExW(hKey1,i,KeyName,&Size,NULL,NULL,NULL,NULL) == ERROR_SUCCESS) {
++i;
RegOpenKeyExW(hKey1,KeyName,0,KEY_READ,&hKey2);
Size = ArraySize;
if (RegQueryValueExW(hKey2,L"DisplayName",0,&Type,(LPBYTE)Value,&Size) == ERROR_SUCCESS) {
Size = ArraySize;
if (StrCmpW(Value,RegName) == 0) {
if (RegQueryValueExW(hKey2,L"UninstallString",0,&Type,(LPBYTE)Uninstaller,&Size) == ERROR_SUCCESS) {
RegCloseKey(hKey2);
RegCloseKey(hKey1);
return TRUE;
} else {
RegCloseKey(hKey2);
RegCloseKey(hKey1);
return FALSE;
}
}
}
RegCloseKey(hKey2);
Size = ArraySize;
}
RegCloseKey(hKey1);
}
return FALSE;
}
void ShowMessage (WCHAR* title, WCHAR* message) void ShowMessage (WCHAR* title, WCHAR* message)
{ {
HWND hwnd;
DescriptionHeadline = title; DescriptionHeadline = title;
DescriptionText = message; DescriptionText = message;
hwnd = GetParent(hCategories);
InvalidateRect(hwnd,NULL,TRUE); InvalidateRect(hwnd,NULL,TRUE);
UpdateWindow(hwnd); UpdateWindow(hwnd);
} }
@ -118,23 +81,15 @@ void CategoryChoosen (HWND hwnd, struct Category* Category)
Insert.item.mask = TVIF_TEXT|TVIF_PARAM|TVIF_IMAGE; Insert.item.mask = TVIF_TEXT|TVIF_PARAM|TVIF_IMAGE;
Insert.hInsertAfter = TVI_LAST; Insert.hInsertAfter = TVI_LAST;
Insert.hParent = TVI_ROOT; Insert.hParent = TVI_ROOT;
Insert.item.iImage = 0;
CurrentApplication = Category->Apps; CurrentApplication = Category->Apps;
WCHAR Uninstaller[200];
while(CurrentApplication) while(CurrentApplication)
{ {
Insert.item.lParam = (UINT)CurrentApplication; Insert.item.lParam = (UINT)CurrentApplication;
Insert.item.pszText = CurrentApplication->Name; Insert.item.pszText = CurrentApplication->Name;
Insert.item.cchTextMax = lstrlenW(CurrentApplication->Name); Insert.item.cchTextMax = lstrlenW(CurrentApplication->Name);
Insert.item.iImage = 10;
if(StrCmpW(CurrentApplication->RegName,L"")) {
if(getUninstaller(CurrentApplication->RegName, Uninstaller))
Insert.item.iImage = 9;
} else {
if(getUninstaller(CurrentApplication->Name, Uninstaller))
Insert.item.iImage = 9;
}
SendMessage(hwnd, TVM_INSERTITEM, 0, (LPARAM)&Insert); SendMessage(hwnd, TVM_INSERTITEM, 0, (LPARAM)&Insert);
CurrentApplication = CurrentApplication->Next; CurrentApplication = CurrentApplication->Next;
} }
@ -163,13 +118,10 @@ BOOL SetupControls (HWND hwnd)
hHelpButton = CreateWindowW (L"Button", L"", WS_CHILD|WS_VISIBLE|BS_BITMAP, 550, 10, 40, 40, hwnd, 0, hInstance, NULL); hHelpButton = CreateWindowW (L"Button", L"", WS_CHILD|WS_VISIBLE|BS_BITMAP, 550, 10, 40, 40, hwnd, 0, hInstance, NULL);
hUpdateButton = CreateWindowW (L"Button", L"", WS_CHILD|WS_VISIBLE|BS_BITMAP, 500, 10, 40, 40, hwnd, 0, hInstance, NULL); hUpdateButton = CreateWindowW (L"Button", L"", WS_CHILD|WS_VISIBLE|BS_BITMAP, 500, 10, 40, 40, hwnd, 0, hInstance, NULL);
hDownloadButton = CreateWindowW (L"Button", L"", WS_CHILD|WS_VISIBLE|BS_BITMAP, 330, 505, 140, 33, hwnd, 0, hInstance, NULL); hDownloadButton = CreateWindowW (L"Button", L"", WS_CHILD|WS_VISIBLE|BS_BITMAP, 330, 505, 140, 33, hwnd, 0, hInstance, NULL);
hUninstallButton = CreateWindowW (L"Button", L"", WS_CHILD|WS_VISIBLE|BS_BITMAP, 260, 505, 140, 33, hwnd, 0, hInstance, NULL);
SendMessageW(hHelpButton, BM_SETIMAGE, (WPARAM)IMAGE_BITMAP, (LPARAM)(HANDLE)LoadBitmap(hInstance, MAKEINTRESOURCE(IDB_HELP))); SendMessageW(hHelpButton, BM_SETIMAGE, (WPARAM)IMAGE_BITMAP, (LPARAM)(HANDLE)LoadBitmap(hInstance, MAKEINTRESOURCE(IDB_HELP)));
SendMessageW(hUpdateButton, BM_SETIMAGE, (WPARAM)IMAGE_BITMAP,(LPARAM)(HANDLE)LoadBitmap(hInstance, MAKEINTRESOURCE(IDB_UPDATE))); SendMessageW(hUpdateButton, BM_SETIMAGE, (WPARAM)IMAGE_BITMAP,(LPARAM)(HANDLE)LoadBitmap(hInstance, MAKEINTRESOURCE(IDB_UPDATE)));
SendMessageW(hDownloadButton, BM_SETIMAGE, (WPARAM)IMAGE_BITMAP,(LPARAM)(HANDLE)LoadBitmap(hInstance, MAKEINTRESOURCE(IDB_DOWNLOAD))); SendMessageW(hDownloadButton, BM_SETIMAGE, (WPARAM)IMAGE_BITMAP,(LPARAM)(HANDLE)LoadBitmap(hInstance, MAKEINTRESOURCE(IDB_DOWNLOAD)));
SendMessageW(hUninstallButton, BM_SETIMAGE, (WPARAM)IMAGE_BITMAP,(LPARAM)(HANDLE)LoadBitmap(hInstance, MAKEINTRESOURCE(IDB_UNINSTALL)));
ShowWindow(hUninstallButton, SW_HIDE);
// Set deflaut entry for hApps // Set deflaut entry for hApps
Insert.item.mask = TVIF_TEXT|TVIF_IMAGE; Insert.item.mask = TVIF_TEXT|TVIF_IMAGE;
@ -191,9 +143,7 @@ BOOL SetupControls (HWND hwnd)
ImageList_Add(hImageList, LoadBitmap(hInstance, MAKEINTRESOURCE(IDB_TREEVIEW_ICON_5)), NULL); ImageList_Add(hImageList, LoadBitmap(hInstance, MAKEINTRESOURCE(IDB_TREEVIEW_ICON_5)), NULL);
ImageList_Add(hImageList, LoadBitmap(hInstance, MAKEINTRESOURCE(IDB_TREEVIEW_ICON_6)), NULL); ImageList_Add(hImageList, LoadBitmap(hInstance, MAKEINTRESOURCE(IDB_TREEVIEW_ICON_6)), NULL);
ImageList_Add(hImageList, LoadBitmap(hInstance, MAKEINTRESOURCE(IDB_TREEVIEW_ICON_7)), NULL); ImageList_Add(hImageList, LoadBitmap(hInstance, MAKEINTRESOURCE(IDB_TREEVIEW_ICON_7)), NULL);
ImageList_Add(hImageList, LoadBitmap(hInstance, MAKEINTRESOURCE(IDB_TREEVIEW_ICON_8)), NULL); ImageList_Add(hImageList, LoadBitmap(hInstance, MAKEINTRESOURCE(IDB_TREEVIEW_ICON_8)), NULL);
ImageList_Add(hImageList, LoadBitmap(hInstance, MAKEINTRESOURCE(IDB_TREEVIEW_ICON_9)), NULL);
ImageList_Add(hImageList, LoadBitmap(hInstance, MAKEINTRESOURCE(IDB_TREEVIEW_ICON_10)), NULL);
// Fill the TreeViews // Fill the TreeViews
AddItems (hCategories, Root.Children, NULL); AddItems (hCategories, Root.Children, NULL);
@ -250,37 +200,6 @@ static void DrawDescription (HDC hdc, RECT DescriptionRect)
} }
void showUninstaller() {
int Split_Vertical = 200;
RECT Rect;
GetClientRect(hwnd,&Rect);
ShowWindow(hUninstallButton,SW_SHOW);
MoveWindow(hDownloadButton,(Split_Vertical+Rect.right-Rect.left)/2,Rect.bottom-Rect.top-45,140,35,TRUE);;
}
void hideUninstaller() {
int Split_Vertical = 200;
RECT Rect;
GetClientRect(hwnd,&Rect);
ShowWindow(hUninstallButton,SW_HIDE);
MoveWindow(hDownloadButton,(Split_Vertical+Rect.right-Rect.left)/2-70,Rect.bottom-Rect.top-45,140,35,TRUE);
}
void startUninstaller(WCHAR* Uninstaller) {
STARTUPINFOW si;
PROCESS_INFORMATION pi;
memset(&si, 0, sizeof(si));
si.cb = sizeof(si);
CreateProcessW(NULL,Uninstaller,NULL,NULL,FALSE,0,NULL,NULL,&si,&pi);
CloseHandle(pi.hThread);
// WaitForSingleObject(pi.hProcess, INFINITE); // If you want to wait for the Unistaller
CloseHandle(pi.hProcess);
hideUninstaller();
}
LRESULT CALLBACK WndProc (HWND hwnd, UINT Message, WPARAM wParam, LPARAM lParam) LRESULT CALLBACK WndProc (HWND hwnd, UINT Message, WPARAM wParam, LPARAM lParam)
{ {
static RECT DescriptionRect; static RECT DescriptionRect;
@ -325,20 +244,6 @@ LRESULT CALLBACK WndProc (HWND hwnd, UINT Message, WPARAM wParam, LPARAM lParam)
else else
ShowMessage(Strings[IDS_NO_APP_TITLE], Strings[IDS_NO_APP]); ShowMessage(Strings[IDS_NO_APP_TITLE], Strings[IDS_NO_APP]);
} }
else if (lParam == (LPARAM)hUninstallButton)
{
if(SelectedApplication)
{
WCHAR Uninstaller[200];
if(StrCmpW(SelectedApplication->RegName, L"")) {
if(getUninstaller(SelectedApplication->RegName, Uninstaller))
startUninstaller(Uninstaller);
} else {
if(getUninstaller(SelectedApplication->Name, Uninstaller))
startUninstaller(Uninstaller);
}
}
}
else if (lParam == (LPARAM)hUpdateButton) else if (lParam == (LPARAM)hUpdateButton)
{ {
ShowMessage(Strings[IDS_UPDATE_TITLE], Strings[IDS_UPDATE]); ShowMessage(Strings[IDS_UPDATE_TITLE], Strings[IDS_UPDATE]);
@ -356,7 +261,6 @@ LRESULT CALLBACK WndProc (HWND hwnd, UINT Message, WPARAM wParam, LPARAM lParam)
LPNMHDR data = (LPNMHDR)lParam; LPNMHDR data = (LPNMHDR)lParam;
if(data->code == TVN_SELCHANGED) if(data->code == TVN_SELCHANGED)
{ {
BOOL bShowUninstaller = FALSE;
if(data->hwndFrom == hCategories) if(data->hwndFrom == hCategories)
{ {
struct Category* Category = (struct Category*) ((LPNMTREEVIEW)lParam)->itemNew.lParam; struct Category* Category = (struct Category*) ((LPNMTREEVIEW)lParam)->itemNew.lParam;
@ -366,43 +270,8 @@ LRESULT CALLBACK WndProc (HWND hwnd, UINT Message, WPARAM wParam, LPARAM lParam)
{ {
SelectedApplication = (struct Application*) ((LPNMTREEVIEW)lParam)->itemNew.lParam; SelectedApplication = (struct Application*) ((LPNMTREEVIEW)lParam)->itemNew.lParam;
if(SelectedApplication) if(SelectedApplication)
{ ShowMessage(SelectedApplication->Name, SelectedApplication->Description);
DescriptionText = calloc(700,sizeof(WCHAR));
if(StrCmpW(SelectedApplication->Version, L"")) {
StrCatW(DescriptionText, Strings[IDS_VERSION]);
StrCatW(DescriptionText, SelectedApplication->Version);
StrCatW(DescriptionText, L"\n");
}
if(StrCmpW(SelectedApplication->Licence, L"")) {
StrCatW(DescriptionText, Strings[IDS_LICENCE]);
StrCatW(DescriptionText, SelectedApplication->Licence);
StrCatW(DescriptionText, L"\n");
}
if(StrCmpW(SelectedApplication->Maintainer, L"")) {
StrCatW(DescriptionText, Strings[IDS_MAINTAINER]);
StrCatW(DescriptionText, SelectedApplication->Maintainer);
StrCatW(DescriptionText, L"\n");
}
if(StrCmpW(SelectedApplication->Licence, L"") || StrCmpW(SelectedApplication->Version, L"") || StrCmpW(SelectedApplication->Maintainer, L""))
StrCatW(DescriptionText, L"\n");
StrCatW(DescriptionText, SelectedApplication->Description);
ShowMessage(SelectedApplication->Name, DescriptionText);
WCHAR Uninstaller[200];
if(StrCmpW(SelectedApplication->RegName, L"")) {
if(getUninstaller(SelectedApplication->RegName, Uninstaller)) {
bShowUninstaller = TRUE;
}
} else {
if(getUninstaller(SelectedApplication->Name, Uninstaller)) {
bShowUninstaller = TRUE;
}
}
}
} }
if (bShowUninstaller)
showUninstaller();
else
hideUninstaller();
} }
} }
break; break;
@ -410,8 +279,8 @@ LRESULT CALLBACK WndProc (HWND hwnd, UINT Message, WPARAM wParam, LPARAM lParam)
case WM_SIZING: case WM_SIZING:
{ {
LPRECT pRect = (LPRECT)lParam; LPRECT pRect = (LPRECT)lParam;
if (pRect->right-pRect->left < 520) if (pRect->right-pRect->left < 400)
pRect->right = pRect->left + 520; pRect->right = pRect->left + 400;
if (pRect->bottom-pRect->top < 300) if (pRect->bottom-pRect->top < 300)
pRect->bottom = pRect->top + 300; pRect->bottom = pRect->top + 300;
@ -430,11 +299,7 @@ LRESULT CALLBACK WndProc (HWND hwnd, UINT Message, WPARAM wParam, LPARAM lParam)
MoveWindow(hHelpButton, LOWORD(lParam)-50, 10, 40, 40, TRUE); MoveWindow(hHelpButton, LOWORD(lParam)-50, 10, 40, 40, TRUE);
MoveWindow(hUpdateButton, LOWORD(lParam)-100, 10, 40, 40, TRUE); MoveWindow(hUpdateButton, LOWORD(lParam)-100, 10, 40, 40, TRUE);
if(IsWindowVisible(hUninstallButton)) MoveWindow(hDownloadButton, (Split_Vertical+LOWORD(lParam))/2-70, HIWORD(lParam)-45, 140, 35, TRUE);
MoveWindow(hDownloadButton, (Split_Vertical+LOWORD(lParam))/2, HIWORD(lParam)-45, 140, 35, TRUE);
else
MoveWindow(hDownloadButton, (Split_Vertical+LOWORD(lParam))/2-70, HIWORD(lParam)-45, 140, 35, TRUE);
MoveWindow(hUninstallButton, (Split_Vertical+LOWORD(lParam))/2-140, HIWORD(lParam)-45, 140, 35, TRUE);
} }
break; break;
@ -455,6 +320,7 @@ LRESULT CALLBACK WndProc (HWND hwnd, UINT Message, WPARAM wParam, LPARAM lParam)
INT WINAPI WinMain (HINSTANCE hInstance, HINSTANCE hPrevInst, INT WINAPI WinMain (HINSTANCE hInstance, HINSTANCE hPrevInst,
LPSTR lpCmdLine, INT nCmdShow) LPSTR lpCmdLine, INT nCmdShow)
{ {
HWND hwnd;
int i; int i;
WNDCLASSEXW WndClass = {0}; WNDCLASSEXW WndClass = {0};
MSG msg; MSG msg;

View file

@ -5,7 +5,6 @@
#define IDB_HELP 0x102 #define IDB_HELP 0x102
#define IDB_UPDATE 0x103 #define IDB_UPDATE 0x103
#define IDB_DOWNLOAD 0x104 #define IDB_DOWNLOAD 0x104
#define IDB_UNINSTALL 0x105
#define IDB_TREEVIEW_ICON_0 0x900 #define IDB_TREEVIEW_ICON_0 0x900
#define IDB_TREEVIEW_ICON_1 0x901 #define IDB_TREEVIEW_ICON_1 0x901
#define IDB_TREEVIEW_ICON_2 0x902 #define IDB_TREEVIEW_ICON_2 0x902
@ -15,8 +14,6 @@
#define IDB_TREEVIEW_ICON_6 0x906 #define IDB_TREEVIEW_ICON_6 0x906
#define IDB_TREEVIEW_ICON_7 0x907 #define IDB_TREEVIEW_ICON_7 0x907
#define IDB_TREEVIEW_ICON_8 0x908 #define IDB_TREEVIEW_ICON_8 0x908
#define IDB_TREEVIEW_ICON_9 0x909
#define IDB_TREEVIEW_ICON_10 0x910
#define IDD_DOWNLOAD 0x100 #define IDD_DOWNLOAD 0x100
#define IDC_PROGRESS 0x1000 #define IDC_PROGRESS 0x1000
#define IDC_STATUS 0x1001 #define IDC_STATUS 0x1001
@ -39,9 +36,6 @@
#define IDS_XMLERROR_1 14 #define IDS_XMLERROR_1 14
#define IDS_XMLERROR_2 15 #define IDS_XMLERROR_2 15
#define IDS_DOWNLOAD_ERROR 16 #define IDS_DOWNLOAD_ERROR 16
#define IDS_VERSION 17
#define IDS_LICENCE 18
#define IDS_MAINTAINER 19
#define STRING_COUNT 20 #define STRING_COUNT 17
#define MAX_STRING_LENGHT 0x100 #define MAX_STRING_LENGHT 0x100

View file

@ -1,11 +1,11 @@
LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL
IDI_MAIN ICON DISCARDABLE "resources/main.ico" IDI_MAIN ICON DISCARDABLE "resources/main.ico"
//IDB_UNDERLINE BITMAP DISCARDABLE "resources/underline.bmp"
IDB_LOGO BITMAP DISCARDABLE "resources/logo.bmp" IDB_LOGO BITMAP DISCARDABLE "resources/logo.bmp"
IDB_HELP BITMAP DISCARDABLE "resources/help.bmp" IDB_HELP BITMAP DISCARDABLE "resources/help.bmp"
IDB_UPDATE BITMAP DISCARDABLE "resources/update.bmp" IDB_UPDATE BITMAP DISCARDABLE "resources/update.bmp"
IDB_DOWNLOAD BITMAP DISCARDABLE "resources/download.bmp" IDB_DOWNLOAD BITMAP DISCARDABLE "resources/download.bmp"
IDB_UNINSTALL BITMAP DISCARDABLE "resources/uninstall.bmp"
IDB_UNDERLINE BITMAP DISCARDABLE "resources/underline.bmp" IDB_UNDERLINE BITMAP DISCARDABLE "resources/underline.bmp"
IDB_TREEVIEW_ICON_0 BITMAP DISCARDABLE "resources/0.bmp" IDB_TREEVIEW_ICON_0 BITMAP DISCARDABLE "resources/0.bmp"
IDB_TREEVIEW_ICON_1 BITMAP DISCARDABLE "resources/1.bmp" IDB_TREEVIEW_ICON_1 BITMAP DISCARDABLE "resources/1.bmp"
@ -16,8 +16,6 @@ IDB_TREEVIEW_ICON_5 BITMAP DISCARDABLE "resources/5.bmp"
IDB_TREEVIEW_ICON_6 BITMAP DISCARDABLE "resources/6.bmp" IDB_TREEVIEW_ICON_6 BITMAP DISCARDABLE "resources/6.bmp"
IDB_TREEVIEW_ICON_7 BITMAP DISCARDABLE "resources/7.bmp" IDB_TREEVIEW_ICON_7 BITMAP DISCARDABLE "resources/7.bmp"
IDB_TREEVIEW_ICON_8 BITMAP DISCARDABLE "resources/8.bmp" IDB_TREEVIEW_ICON_8 BITMAP DISCARDABLE "resources/8.bmp"
IDB_TREEVIEW_ICON_9 BITMAP DISCARDABLE "resources/9.bmp"
IDB_TREEVIEW_ICON_10 BITMAP DISCARDABLE "resources/10.bmp"
#include "translations/de.rc" #include "translations/de.rc"

View file

@ -2,7 +2,6 @@
struct Application struct Application
{ {
WCHAR Name[0x100]; WCHAR Name[0x100];
WCHAR RegName[0x100];
WCHAR Version[0x100]; WCHAR Version[0x100];
WCHAR Maintainer[0x100]; WCHAR Maintainer[0x100];
WCHAR Licence[0x100]; WCHAR Licence[0x100];

View file

@ -29,7 +29,4 @@ BEGIN
IDS_XMLERROR_1 "XML Datei nicht gefunden!" IDS_XMLERROR_1 "XML Datei nicht gefunden!"
IDS_XMLERROR_2 "XML Datei kann nicht verarbeitet werden!" IDS_XMLERROR_2 "XML Datei kann nicht verarbeitet werden!"
IDS_DOWNLOAD_ERROR "Die Datei konnte nicht runtergeladen werden.\nBitte prüfen sie, ob eine Verbindung zum Internet besteht." IDS_DOWNLOAD_ERROR "Die Datei konnte nicht runtergeladen werden.\nBitte prüfen sie, ob eine Verbindung zum Internet besteht."
IDS_VERSION "Version: "
IDS_LICENCE "Lizenz: "
IDS_MAINTAINER "Maintainer: "
END END

View file

@ -29,7 +29,4 @@ BEGIN
IDS_XMLERROR_1 "Could not find the xml file !" IDS_XMLERROR_1 "Could not find the xml file !"
IDS_XMLERROR_2 "Could not parse the xml file !" IDS_XMLERROR_2 "Could not parse the xml file !"
IDS_DOWNLOAD_ERROR "Unable to download the file.\nPlease check you internet connection." IDS_DOWNLOAD_ERROR "Unable to download the file.\nPlease check you internet connection."
IDS_VERSION "Version: "
IDS_LICENCE "Licence: "
IDS_MAINTAINER "Maintainer: "
END END

View file

@ -29,7 +29,4 @@ BEGIN
IDS_XMLERROR_1 "Impossible de trouver le fichier xml !" IDS_XMLERROR_1 "Impossible de trouver le fichier xml !"
IDS_XMLERROR_2 "Impossible d'analyser le fichier xml !" IDS_XMLERROR_2 "Impossible d'analyser le fichier xml !"
IDS_DOWNLOAD_ERROR "Impossible de télécharger le fichier.\nVeuillez vérifier votre connexion Internet." IDS_DOWNLOAD_ERROR "Impossible de télécharger le fichier.\nVeuillez vérifier votre connexion Internet."
IDS_VERSION "Version: "
IDS_LICENCE "Licence: "
IDS_MAINTAINER "Maintainer: "
END END

View file

@ -29,7 +29,4 @@ BEGIN
IDS_XMLERROR_1 "File xml non trovato !" IDS_XMLERROR_1 "File xml non trovato !"
IDS_XMLERROR_2 "Impossibile trattare il contenuto del file xml !" IDS_XMLERROR_2 "Impossibile trattare il contenuto del file xml !"
IDS_DOWNLOAD_ERROR "Download del file impossibile.\nVerifica la connessione a Internet." IDS_DOWNLOAD_ERROR "Download del file impossibile.\nVerifica la connessione a Internet."
IDS_VERSION "Version: "
IDS_LICENCE "Licence: "
IDS_MAINTAINER "Maintainer: "
END END

View file

@ -2,7 +2,7 @@
* LICENSE: GPL - See COPYING in the top level directory * LICENSE: GPL - See COPYING in the top level directory
* FILE: base\applications\downloader\xml.c * FILE: base\applications\downloader\xml.c
* PURPOSE: Parsing of application information xml files * PURPOSE: Parsing of application information xml files
* PROGRAMMERS: Maarten Bosma, Lester Kortenhoeven * PROGRAMMERS: Maarten Bosma
*/ */
#include <libs/expat/expat.h> #include <libs/expat/expat.h>
@ -81,15 +81,6 @@ void tag_opened (void* usrdata, const char* tag, const char** arg)
CurrentApplication = Current->Apps; CurrentApplication = Current->Apps;
} }
int currentlengt = lstrlenW(CurrentApplication->Maintainer);
MultiByteToWideChar(CP_ACP, 0, 0, 0, &CurrentApplication->Maintainer[currentlengt], 0x100-currentlengt);
currentlengt = lstrlenW(CurrentApplication->RegName);
MultiByteToWideChar(CP_ACP, 0, 0, 0, &CurrentApplication->RegName[currentlengt], 0x100-currentlengt);
currentlengt = lstrlenW(CurrentApplication->Version);
MultiByteToWideChar(CP_ACP, 0, 0, 0, &CurrentApplication->Version[currentlengt], 0x100-currentlengt);
currentlengt = lstrlenW(CurrentApplication->Licence);
MultiByteToWideChar(CP_ACP, 0, 0, 0, &CurrentApplication->Licence[currentlengt], 0x100-currentlengt);
for (i=0; arg[i]; i+=2) for (i=0; arg[i]; i+=2)
{ {
if(!strcmp(arg[i], "name")) if(!strcmp(arg[i], "name"))
@ -112,16 +103,12 @@ void text (void* usrdata, const char* data, int len)
if (!CurrentApplication) if (!CurrentApplication)
return; return;
// FIXME: handle newlines e.g. in Description
if(!strcmp(CurrentTag, "maintainer")) if(!strcmp(CurrentTag, "maintainer"))
{ {
int currentlengt = lstrlenW(CurrentApplication->Maintainer); int currentlengt = lstrlenW(CurrentApplication->Location);
MultiByteToWideChar(CP_ACP, 0, data, len, &CurrentApplication->Maintainer[currentlengt], 0x100-currentlengt); MultiByteToWideChar(CP_ACP, 0, data, len, &CurrentApplication->Maintainer[currentlengt], 0x100-currentlengt);
} }
else if(!strcmp(CurrentTag, "regname"))
{
int currentlengt = lstrlenW(CurrentApplication->RegName);
MultiByteToWideChar(CP_ACP, 0, data, len, &CurrentApplication->RegName[currentlengt], 0x100-currentlengt);
}
else if(!strcmp(CurrentTag, "description")) else if(!strcmp(CurrentTag, "description"))
{ {
int currentlengt = lstrlenW(CurrentApplication->Description); int currentlengt = lstrlenW(CurrentApplication->Description);
@ -132,16 +119,6 @@ void text (void* usrdata, const char* data, int len)
int currentlengt = lstrlenW(CurrentApplication->Location); int currentlengt = lstrlenW(CurrentApplication->Location);
MultiByteToWideChar(CP_ACP, 0, data, len, &CurrentApplication->Location[currentlengt], 0x100-currentlengt); MultiByteToWideChar(CP_ACP, 0, data, len, &CurrentApplication->Location[currentlengt], 0x100-currentlengt);
} }
else if(!strcmp(CurrentTag, "version"))
{
int currentlengt = lstrlenW(CurrentApplication->Version);
MultiByteToWideChar(CP_ACP, 0, data, len, &CurrentApplication->Version[currentlengt], 0x400-currentlengt);
}
else if(!strcmp(CurrentTag, "licence"))
{
int currentlengt = lstrlenW(CurrentApplication->Licence);
MultiByteToWideChar(CP_ACP, 0, data, len, &CurrentApplication->Licence[currentlengt], 0x100-currentlengt);
}
} }
void tag_closed (void* tree, const char* tag) void tag_closed (void* tree, const char* tag)