- rename apps.xml to downloader.xml
authorMaarten Bosma <maarten@bosma.de>
Mon, 1 Jan 2007 14:29:26 +0000 (14:29 +0000)
committerMaarten Bosma <maarten@bosma.de>
Mon, 1 Jan 2007 14:29:26 +0000 (14:29 +0000)
- look first for the xml file in system32 then in current dir.

svn path=/trunk/; revision=25262

reactos/base/applications/downloader/downloader.rbuild
reactos/base/applications/downloader/downloader.xml [moved from reactos/base/applications/downloader/apps.xml with 100% similarity]
reactos/base/applications/downloader/main.c
reactos/base/applications/downloader/xml.c

index c3d2ab3..7d266c0 100644 (file)
@@ -1,6 +1,6 @@
 <?xml version="1.0"?>\r
 <!DOCTYPE project SYSTEM "tools/rbuild/project.dtd">\r
-<installfile base="system32">apps.xml</installfile>    \r
+<installfile base="system32">downloader.xml</installfile>    \r
 <module name="downloader" type="win32gui" installbase="system32" installname="downloader.exe">\r
        <include base="downloader">.</include>\r
        <include base="expat">.</include>\r
index 58d4daf..6c2d111 100644 (file)
@@ -13,6 +13,8 @@
 #include "resources.h"
 #include "structures.h"
 
+#define XML_PATH "C:\\ReactOS\\system32\\downloader.xml"
+
 HWND hCategories, hApps, hDownloadButton, hUpdateButton, hHelpButton;
 HBITMAP hLogo, hUnderline;
 WCHAR* DescriptionHeadline = L"";
@@ -97,7 +99,7 @@ BOOL SetupControls (HWND hwnd)
        HINSTANCE hInstance = GetModuleHandle(NULL);
 
        // Parse the XML file
-       if (ProcessXML ("apps.xml", &Root) == FALSE)
+       if (ProcessXML (XML_PATH, &Root) == FALSE)
                return FALSE;
 
        // Set up the controls
index d7ff30f..e68b113 100644 (file)
@@ -157,8 +157,12 @@ BOOL ProcessXML (const char* filename, struct Category* Root)
        FILE* file = fopen(filename, "r");
        if(!file) 
        {
-               MessageBoxW(0,Strings[IDS_XMLERROR_1],0,0);
-               return FALSE;
+               file = fopen("downloader.xml", "r"); 
+               if(!file) 
+               {
+                       MessageBoxW(0,Strings[IDS_XMLERROR_1],0,0);
+                       return FALSE;
+               }
        }
 
        XML_Parser parser = XML_ParserCreate(NULL);