Lester Kortenhoeven (lester(at)kortenhoeven(dot)de):
authorMaarten Bosma <maarten@bosma.de>
Sat, 10 Feb 2007 21:41:28 +0000 (21:41 +0000)
committerMaarten Bosma <maarten@bosma.de>
Sat, 10 Feb 2007 21:41:28 +0000 (21:41 +0000)
* Implement uninstall feature. Does not work under reactos yet, because it does not seem to store the installer information under the registry path windows stores them.
* Show Version in the description.

svn path=/branches/ros-branch-0_3_1/; revision=25765

reactos/base/applications/downloader/downloader.rbuild
reactos/base/applications/downloader/downloader.xml
reactos/base/applications/downloader/main.c
reactos/base/applications/downloader/resources.h
reactos/base/applications/downloader/rsrc.rc
reactos/base/applications/downloader/structures.h
reactos/base/applications/downloader/translations/de.rc
reactos/base/applications/downloader/translations/en.rc
reactos/base/applications/downloader/translations/fr.rc
reactos/base/applications/downloader/translations/it.rc
reactos/base/applications/downloader/xml.c

index 69ad460..bd276da 100644 (file)
@@ -10,8 +10,9 @@
        <define name="__USE_W32API" />
        <define name="WINVER">0x0501</define>
        <define name="_WIN32_IE>0x0600</define>
-
+       
        <library>kernel32</library>
+       <library>advapi32</library>
        <library>ntdll</library>
        <library>user32</library>
        <library>gdi32</library>
index 42ee02a..dde0911 100644 (file)
@@ -1,54 +1,90 @@
 <tree Version="1"> <!-- Application version this tree is made for -->
        <category name="Internet &amp; Network" icon="1">
-               <application name="Firefox">
+               <application name="Firefox 1.5">
+                       <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>
                        <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 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>
                        <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 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>
                        <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 name="Samba TNG">
-                       <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>
-               </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">
+                       <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>
+               </application>
                <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>
                        <location>http://ovh.dl.sourceforge.net/sourceforge/miranda/miranda-im-v0.5.1-unicode.exe</location>
                </application>
                <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>
-                       <location>http://the.earth.li/~sgtatham/putty/latest/x86/putty-0.58-installer.exe</location>
+                       <location>http://the.earth.li/~sgtatham/putty/latest/x86/putty-0.59-installer.exe</location>
                </application>
        </category>
        <category name="Office" icon="2">
                <application name="Abiword">
+                       <regname>"AbiWord 2.4.1 (remove only)"</regname>
+                       <version>2.4.1</version>
                        <description>Word processor.</description>
                        <location>http://www.abiword.org/downloads/abiword/2.4.1/Windows/abiword-setup-2.4.1.exe</location>
                </application>
                <application name="OpenOffice">
+                       <regname>OpenOffice.org 2.1</regname>
+                       <version>2.1.0</version>
                        <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>
                </application>
        </category>
        <category name="Graphics" icon="3">
                <application name="IrfanView">
+                       <regname>IrfanView (remove only)</regname>
+                       <version>3.99</version>
                        <description>Viewer for all kinds of graphics/audio files/video files.</description>
                        <location>http://gd.tuwien.ac.at/graphics/irfanview/iview399.exe</location>
                </application>
                <application name="IrfanView Plugins">
+                       <version>3.99</version>
                        <description>Additional Plugins for supporting more file types.</description>
                        <location>http://irfanview.tuwien.ac.at/plugins/irfanview_plugins_399.exe</location>
                </application>
                <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>
                        <location>http://ovh.dl.sourceforge.net/sourceforge/tuxpaint/tuxpaint-0.9.16-win32-installer.exe</location>
                </application>
        </category>
        <category name="Development" icon="5">
                <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>
-                       <location>http://ovh.dl.sourceforge.net/sourceforge/reactos/RosBE-0.3.3.exe</location>
+                       <location>http://ovh.dl.sourceforge.net/sourceforge/reactos/RosBE-0.3.4.exe</location>
                </application>
        </category>
        <category name="Games &amp; Fun" icon="6">
                <application name="ScummVM">
+                       <regname>ScummVM 0.9.1</regname>
+                       <version>0.9.1</version>
                        <description>SamNMax, Day of Tentacle, etc on ReactOS</description>
                        <location>http://ovh.dl.sourceforge.net/sourceforge/scummvm/scummvm-0.9.1-win32.exe</location>
                </application>
                        <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>
                </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 name="Tools" icon="7">
                <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>
                        <location>http://ovh.dl.sourceforge.net/sourceforge/sevenzip/7z442.exe</location>
                </application>
                <application name="uTorrent">
+                       <regname>&#181;Torrent</regname>        <!-- XML-Parser-Error:  Mu != &#181; -->
+                       <version>1.6</version>
                        <description>Small and fast Torrent Client.</description>
                        <location>http://download.utorrent.com/1.6/uTorrent-1.6-install.exe</location>
                </application>
                <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>
                        <location>http://www.audiograbber.de/files/342677432/agsetup183se.exe</location>
                </application>
index 066ae14..f53eca5 100644 (file)
@@ -2,19 +2,20 @@
  * LICENSE:         GPL - See COPYING in the top level directory
  * FILE:            base/applications/downloader/xml.c
  * PURPOSE:         Main program
- * PROGRAMMERS:     Maarten Bosma
+ * PROGRAMMERS:     Maarten Bosma, Lester Kortenhoeven
  */
 
 #include <windows.h>
 #include <commctrl.h>
 #include <richedit.h>
 #include <stdio.h>
+#include <shlwapi.h>
 #include "resources.h"
 #include "structures.h"
 
 #define XML_PATH "C:\\ReactOS\\system32\\downloader.xml"
 
-HWND hCategories, hApps, hDownloadButton, hUpdateButton, hHelpButton;
+HWND hwnd, hCategories, hApps, hDownloadButton, hUninstallButton, hUpdateButton, hHelpButton;
 HBITMAP hLogo, hUnderline;
 WCHAR* DescriptionHeadline = L"";
 WCHAR* DescriptionText = L"";
@@ -27,13 +28,49 @@ BOOL ProcessXML (const char* filename, struct Category* Root);
 VOID FreeTree (struct Category* Node);
 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)
 {
-       HWND hwnd;
        DescriptionHeadline = title;
        DescriptionText = message;
-
-       hwnd = GetParent(hCategories);
        InvalidateRect(hwnd,NULL,TRUE); 
        UpdateWindow(hwnd);
 }
@@ -81,15 +118,23 @@ void CategoryChoosen (HWND hwnd, struct Category* Category)
        Insert.item.mask = TVIF_TEXT|TVIF_PARAM|TVIF_IMAGE;
        Insert.hInsertAfter = TVI_LAST;
        Insert.hParent = TVI_ROOT;
-       Insert.item.iImage = 0;
 
        CurrentApplication = Category->Apps;
 
+       WCHAR Uninstaller[200];
        while(CurrentApplication)
        {
                Insert.item.lParam = (UINT)CurrentApplication;
                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);
                CurrentApplication = CurrentApplication->Next;
        }
@@ -118,10 +163,13 @@ BOOL SetupControls (HWND hwnd)
        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);
        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(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(hUninstallButton, BM_SETIMAGE, (WPARAM)IMAGE_BITMAP,(LPARAM)(HANDLE)LoadBitmap(hInstance, MAKEINTRESOURCE(IDB_UNINSTALL)));
+       ShowWindow(hUninstallButton, SW_HIDE);
 
        // Set deflaut entry for hApps
        Insert.item.mask = TVIF_TEXT|TVIF_IMAGE;
@@ -143,7 +191,9 @@ BOOL SetupControls (HWND hwnd)
        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_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
        AddItems (hCategories, Root.Children, NULL);
@@ -200,6 +250,37 @@ 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)
 {
        static RECT DescriptionRect;
@@ -244,6 +325,20 @@ LRESULT CALLBACK WndProc (HWND hwnd, UINT Message, WPARAM wParam, LPARAM lParam)
                                        else
                                                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)
                                {
                                        ShowMessage(Strings[IDS_UPDATE_TITLE], Strings[IDS_UPDATE]);
@@ -261,6 +356,7 @@ LRESULT CALLBACK WndProc (HWND hwnd, UINT Message, WPARAM wParam, LPARAM lParam)
                        LPNMHDR data = (LPNMHDR)lParam;
                        if(data->code == TVN_SELCHANGED)
                        {
+                               BOOL bShowUninstaller = FALSE;
                                if(data->hwndFrom == hCategories) 
                                {
                                        struct Category* Category = (struct Category*) ((LPNMTREEVIEW)lParam)->itemNew.lParam;
@@ -270,8 +366,43 @@ LRESULT CALLBACK WndProc (HWND hwnd, UINT Message, WPARAM wParam, LPARAM lParam)
                                {
                                        SelectedApplication = (struct Application*) ((LPNMTREEVIEW)lParam)->itemNew.lParam;
                                        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;
@@ -279,8 +410,8 @@ LRESULT CALLBACK WndProc (HWND hwnd, UINT Message, WPARAM wParam, LPARAM lParam)
                case WM_SIZING:
                {
                        LPRECT pRect = (LPRECT)lParam;
-                       if (pRect->right-pRect->left < 400)
-                               pRect->right = pRect->left + 400;
+                       if (pRect->right-pRect->left < 520)
+                               pRect->right = pRect->left + 520;
 
                        if (pRect->bottom-pRect->top < 300)
                                pRect->bottom = pRect->top + 300;
@@ -299,7 +430,11 @@ LRESULT CALLBACK WndProc (HWND hwnd, UINT Message, WPARAM wParam, LPARAM lParam)
 
                        MoveWindow(hHelpButton, LOWORD(lParam)-50, 10, 40, 40, TRUE);
                        MoveWindow(hUpdateButton, LOWORD(lParam)-100, 10, 40, 40, TRUE);
-                       MoveWindow(hDownloadButton, (Split_Vertical+LOWORD(lParam))/2-70, HIWORD(lParam)-45, 140, 35, TRUE);
+                       if(IsWindowVisible(hUninstallButton))
+                               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;
 
@@ -320,7 +455,6 @@ LRESULT CALLBACK WndProc (HWND hwnd, UINT Message, WPARAM wParam, LPARAM lParam)
 INT WINAPI WinMain (HINSTANCE hInstance, HINSTANCE hPrevInst,
                                        LPSTR lpCmdLine, INT nCmdShow)
 {
-       HWND hwnd;
        int i;
        WNDCLASSEXW WndClass = {0};
        MSG msg;
index e06ded1..e3918f6 100644 (file)
@@ -5,6 +5,7 @@
 #define IDB_HELP                       0x102
 #define IDB_UPDATE                     0x103
 #define IDB_DOWNLOAD           0x104
+#define IDB_UNINSTALL          0x105
 #define IDB_TREEVIEW_ICON_0    0x900
 #define IDB_TREEVIEW_ICON_1    0x901
 #define IDB_TREEVIEW_ICON_2    0x902
@@ -14,6 +15,8 @@
 #define IDB_TREEVIEW_ICON_6    0x906
 #define IDB_TREEVIEW_ICON_7    0x907
 #define IDB_TREEVIEW_ICON_8    0x908
+#define IDB_TREEVIEW_ICON_9    0x909
+#define IDB_TREEVIEW_ICON_10   0x910
 #define IDD_DOWNLOAD           0x100
 #define IDC_PROGRESS           0x1000
 #define IDC_STATUS                     0x1001
@@ -36,6 +39,9 @@
 #define IDS_XMLERROR_1         14
 #define IDS_XMLERROR_2         15
 #define IDS_DOWNLOAD_ERROR     16
+#define IDS_VERSION            17
+#define IDS_LICENCE            18
+#define IDS_MAINTAINER         19
 
-#define STRING_COUNT           17
+#define STRING_COUNT           20
 #define        MAX_STRING_LENGHT       0x100
index 79a36ef..ee4a532 100644 (file)
@@ -1,11 +1,11 @@
 LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL
 
 IDI_MAIN               ICON DISCARDABLE        "resources/main.ico"
-//IDB_UNDERLINE                BITMAP DISCARDABLE      "resources/underline.bmp"
 IDB_LOGO               BITMAP DISCARDABLE      "resources/logo.bmp"
 IDB_HELP               BITMAP DISCARDABLE      "resources/help.bmp"
 IDB_UPDATE             BITMAP DISCARDABLE      "resources/update.bmp"
 IDB_DOWNLOAD           BITMAP DISCARDABLE      "resources/download.bmp"
+IDB_UNINSTALL          BITMAP DISCARDABLE      "resources/uninstall.bmp"
 IDB_UNDERLINE          BITMAP DISCARDABLE      "resources/underline.bmp"
 IDB_TREEVIEW_ICON_0    BITMAP DISCARDABLE      "resources/0.bmp"
 IDB_TREEVIEW_ICON_1    BITMAP DISCARDABLE      "resources/1.bmp"
@@ -16,6 +16,8 @@ IDB_TREEVIEW_ICON_5   BITMAP DISCARDABLE      "resources/5.bmp"
 IDB_TREEVIEW_ICON_6    BITMAP DISCARDABLE      "resources/6.bmp"
 IDB_TREEVIEW_ICON_7    BITMAP DISCARDABLE      "resources/7.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"
index d0c9096..3044ce5 100644 (file)
@@ -2,6 +2,7 @@
 struct Application
 {
        WCHAR Name[0x100];
+       WCHAR RegName[0x100];
        WCHAR Version[0x100];
        WCHAR Maintainer[0x100];
        WCHAR Licence[0x100];
index f95ee9f..01e01a8 100644 (file)
@@ -29,4 +29,7 @@ BEGIN
   IDS_XMLERROR_1               "XML Datei nicht gefunden!"
   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_VERSION                  "Version: "
+  IDS_LICENCE                  "Lizenz: "
+  IDS_MAINTAINER               "Maintainer: "
 END
index c216fb9..c54fe27 100644 (file)
@@ -29,4 +29,7 @@ BEGIN
   IDS_XMLERROR_1               "Could not find 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_VERSION                  "Version: "
+  IDS_LICENCE                  "Licence: "
+  IDS_MAINTAINER               "Maintainer: "
 END
index a71295c..a75b97e 100644 (file)
@@ -29,4 +29,7 @@ BEGIN
   IDS_XMLERROR_1               "Impossible de trouver 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_VERSION                  "Version: "
+  IDS_LICENCE                  "Licence: "
+  IDS_MAINTAINER               "Maintainer: "
 END
index 58f6d74..bd3c2a6 100644 (file)
@@ -29,4 +29,7 @@ BEGIN
   IDS_XMLERROR_1               "File xml non trovato !"
   IDS_XMLERROR_2               "Impossibile trattare il contenuto del file xml !"
   IDS_DOWNLOAD_ERROR           "Download del file impossibile.\nVerifica la connessione a Internet."
+  IDS_VERSION                  "Version: "
+  IDS_LICENCE                  "Licence: "
+  IDS_MAINTAINER               "Maintainer: "
 END
index b2129fc..edf2146 100644 (file)
@@ -2,7 +2,7 @@
  * LICENSE:         GPL - See COPYING in the top level directory
  * FILE:            base\applications\downloader\xml.c
  * PURPOSE:         Parsing of application information xml files
- * PROGRAMMERS:     Maarten Bosma
+ * PROGRAMMERS:     Maarten Bosma, Lester Kortenhoeven
  */
 
 #include <libs/expat/expat.h>
@@ -81,6 +81,15 @@ void tag_opened (void* usrdata, const char* tag, const char** arg)
                        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) 
                {
                        if(!strcmp(arg[i], "name"))
@@ -103,12 +112,16 @@ void text (void* usrdata, const char* data, int len)
        if (!CurrentApplication)
                return;
 
-       // FIXME: handle newlines e.g. in Description
        if(!strcmp(CurrentTag, "maintainer"))
        {
-               int currentlengt = lstrlenW(CurrentApplication->Location);
+               int currentlengt = lstrlenW(CurrentApplication->Maintainer);
                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"))
        {
                int currentlengt = lstrlenW(CurrentApplication->Description);
@@ -119,6 +132,16 @@ void text (void* usrdata, const char* data, int len)
                int currentlengt = lstrlenW(CurrentApplication->Location);
                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)