diff --git a/reactos/base/applications/downloader/download.c b/reactos/base/applications/downloader/download.c
index 9780e021a9b..f710f5e42ec 100644
--- a/reactos/base/applications/downloader/download.c
+++ b/reactos/base/applications/downloader/download.c
@@ -221,31 +221,11 @@ ThreadFunc(LPVOID Context)
{
//static const WCHAR szUrl[] = DownloadUrl;
IBindStatusCallback *dl;
- WCHAR path[MAX_PATH];
- LPWSTR p;
- STARTUPINFOW si;
- PROCESS_INFORMATION pi;
- HWND Dlg = (HWND) Context;
+ HWND Dlg = ((struct lParamDownload*)Context)->Dlg;
DWORD r;
BOOL bCancelled = FALSE;
- BOOL bTempfile = FALSE;
-
- /* built the path for the download */
- p = wcsrchr(SelectedApplication->Location, L'/');
- if (NULL == p)
- {
- goto end;
- }
- if (! GetTempPathW(MAX_PATH, path))
- {
- goto end;
- }
- wcscat(path, p + 1);
-
- /* download it */
- bTempfile = TRUE;
- dl = CreateDl(Context, &bCancelled);
- r = URLDownloadToFileW(NULL, SelectedApplication->Location, path, 0, dl);
+ dl = CreateDl(Dlg, &bCancelled);
+ r = URLDownloadToFileW(NULL, ((struct lParamDownload*)Context)->URL, ((struct lParamDownload*)Context)->File, 0, dl);
if (NULL != dl)
{
IBindStatusCallback_Release(dl);
@@ -253,30 +233,6 @@ ThreadFunc(LPVOID Context)
if (S_OK != r)
{
MessageBoxW(0,Strings[IDS_DOWNLOAD_ERROR],0,0);
- goto end;
- }
- else if (bCancelled)
- {
- goto end;
- }
- ShowWindow(Dlg, SW_HIDE);
-
- /* run it */
- memset(&si, 0, sizeof(si));
- si.cb = sizeof(si);
- r = CreateProcessW(path, NULL, NULL, NULL, 0, 0, NULL, NULL, &si, &pi);
- if (0 == r)
- {
- goto end;
- }
- CloseHandle(pi.hThread);
- WaitForSingleObject(pi.hProcess, INFINITE);
- CloseHandle(pi.hProcess);
-
-end:
- if (bTempfile)
- {
- DeleteFileW(path);
}
EndDialog(Dlg, 0);
return 0;
@@ -287,7 +243,7 @@ DownloadProc(HWND Dlg, UINT Msg, WPARAM wParam, LPARAM lParam)
{
HANDLE Thread;
DWORD ThreadId;
- HWND Item;
+ HWND Item;;
switch (Msg)
{
@@ -320,7 +276,8 @@ DownloadProc(HWND Dlg, UINT Msg, WPARAM wParam, LPARAM lParam)
ShowWindow(Item, SW_HIDE);
}
}*/
- Thread = CreateThread(NULL, 0, ThreadFunc, Dlg, 0, &ThreadId);
+ ((struct lParamDownload*)lParam)->Dlg = Dlg;
+ Thread = CreateThread(NULL, 0, ThreadFunc, (LPVOID)lParam, 0, &ThreadId);
if (NULL == Thread)
{
return FALSE;
diff --git a/reactos/base/applications/downloader/downloader.rbuild b/reactos/base/applications/downloader/downloader.rbuild
index bd276dabc9f..4665d5350dd 100644
--- a/reactos/base/applications/downloader/downloader.rbuild
+++ b/reactos/base/applications/downloader/downloader.rbuild
@@ -1,6 +1,8 @@
-downloader.xml
+
+
+
.
.
@@ -27,5 +29,6 @@
main.c
xml.c
download.c
+ script.c
downloader.rc
diff --git a/reactos/base/applications/downloader/main.c b/reactos/base/applications/downloader/main.c
index 12fc3a9d5da..6f812ee102f 100644
--- a/reactos/base/applications/downloader/main.c
+++ b/reactos/base/applications/downloader/main.c
@@ -10,46 +10,65 @@
#include
#include
#include
+#include
#include "resources.h"
#include "structures.h"
-#define XML_PATH "C:\\ReactOS\\system32\\downloader.xml"
+#define XML_PATH "tree.xml"
HWND hwnd, hCategories, hApps, hDownloadButton, hUninstallButton, hUpdateButton, hHelpButton;
HBITMAP hLogo, hUnderline;
+CHAR* CmdLine;
WCHAR* DescriptionHeadline = L"";
WCHAR* DescriptionText = L"";
-WCHAR ApplicationText[700];
-
+WCHAR ApplicationText[0xA04]; // MAX_STRING_LENGHT + Version + \n + MAX_STRING_LENGHT + Licence + \n + MAX_STRING_LENGHT + Maintainer + \n\n + Description
+ // 0x100 + 0x100 + 1 + 0x100 + 0x100 + 1 + 0x100 + 0x100 + 2 + 0x400 = 0xA04
struct Category Root;
struct Application* SelectedApplication;
INT_PTR CALLBACK DownloadProc (HWND, UINT, WPARAM, LPARAM);
+DWORD WINAPI InstallThreadFunc(LPVOID);
+DWORD WINAPI UninstallThreadFunc(LPVOID);
BOOL ProcessXML (const char* filename, struct Category* Root);
+char* addDML (const char*);
VOID FreeTree (struct Category* Node);
WCHAR Strings [STRING_COUNT][MAX_STRING_LENGHT];
+BOOL getUninstaller(struct Application* CurrentApplication, WCHAR* Uninstaller) {
-BOOL getUninstaller(WCHAR* RegName, WCHAR* Uninstaller) {
-
- const DWORD ArraySize = 200;
+ DWORD ArraySize = 0x100;
HKEY hKey1;
HKEY hKey2;
DWORD Type = 0;
- DWORD Size = ArraySize;
WCHAR Value[ArraySize];
WCHAR KeyName[ArraySize];
+ DWORD Size = ArraySize;
LONG i = 0;
+ if (CurrentApplication->RegName[0] == L'\0') {
+ return FALSE;
+ }
+
if (RegOpenKeyExW(HKEY_LOCAL_MACHINE,L"SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall",0,KEY_READ,&hKey1) == ERROR_SUCCESS) {
+ if (RegOpenKeyExW(hKey1,CurrentApplication->RegName,0,KEY_READ,&hKey2) == ERROR_SUCCESS) {
+ 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;
+ }
+ }
while (RegEnumKeyExW(hKey1,i,KeyName,&Size,NULL,NULL,NULL,NULL) == ERROR_SUCCESS) {
++i;
RegOpenKeyExW(hKey1,KeyName,0,KEY_READ,&hKey2);
- Size = ArraySize;
+ Size = sizeof(Value);
if (RegQueryValueExW(hKey2,L"DisplayName",0,&Type,(LPBYTE)Value,&Size) == ERROR_SUCCESS) {
Size = ArraySize;
- if (StrCmpW(Value,RegName) == 0) {
+ if (!wcscmp(Value,CurrentApplication->RegName)) {
if (RegQueryValueExW(hKey2,L"UninstallString",0,&Type,(LPBYTE)Uninstaller,&Size) == ERROR_SUCCESS) {
RegCloseKey(hKey2);
RegCloseKey(hKey1);
@@ -123,17 +142,16 @@ void CategoryChoosen (HWND hwnd, struct Category* Category)
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.iImage = 10;
- if(StrCmpW(CurrentApplication->RegName,L"")) {
- if(getUninstaller(CurrentApplication->RegName, Uninstaller))
- Insert.item.iImage = 9;
- }
+ if(getUninstaller(CurrentApplication, NULL)) {
+ Insert.item.iImage = 9;
+ } else {
+ Insert.item.iImage = 10;
+ }
SendMessage(hwnd, TVM_INSERTITEM, 0, (LPARAM)&Insert);
CurrentApplication = CurrentApplication->Next;
}
@@ -161,8 +179,8 @@ 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);
+ hDownloadButton = CreateWindowW (L"Button", L"", WS_CHILD|WS_VISIBLE|BS_BITMAP, 330, 505, 140, 35, hwnd, 0, hInstance, NULL);
+ hUninstallButton = CreateWindowW (L"Button", L"", WS_CHILD|WS_VISIBLE|BS_BITMAP, 260, 505, 140, 35, 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)));
@@ -267,17 +285,41 @@ void hideUninstaller() {
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;
+void searchApp(const WCHAR* AppName, struct Category* Node) {
+ struct Application* CurrentApplication;
+ if (Node->Children)
+ searchApp(AppName, Node->Children);
+ if (Node->Next)
+ searchApp(AppName, Node->Next);
+ CurrentApplication = Node->Apps;
+ while((SelectedApplication == NULL) && (CurrentApplication != NULL)) {
+ if(wcscmp(CurrentApplication->Name,AppName)==0)
+ SelectedApplication = CurrentApplication;
+ CurrentApplication = CurrentApplication->Next;
+ }
+}
- 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();
+void ShowSelectedApplication() {
+ ApplicationText[0]=L'\0';
+ if(SelectedApplication->Version[0] != L'\0') {
+ StrCatW(ApplicationText, Strings[IDS_VERSION]);
+ StrCatW(ApplicationText, SelectedApplication->Version);
+ StrCatW(ApplicationText, L"\n");
+ }
+ if(SelectedApplication->Licence[0] != L'\0') {
+ StrCatW(ApplicationText, Strings[IDS_LICENCE]);
+ StrCatW(ApplicationText, SelectedApplication->Licence);
+ StrCatW(ApplicationText, L"\n");
+ }
+ if(SelectedApplication->Maintainer[0] != L'\0') {
+ StrCatW(ApplicationText, Strings[IDS_MAINTAINER]);
+ StrCatW(ApplicationText, SelectedApplication->Maintainer);
+ StrCatW(ApplicationText, L"\n");
+ }
+ if((SelectedApplication->Licence[0] != L'\0') || (SelectedApplication->Version[0] != L'\0') || (SelectedApplication->Maintainer[0] != L'\0'))
+ StrCatW(ApplicationText, L"\n");
+ StrCatW(ApplicationText, SelectedApplication->Description);
+ ShowMessage(SelectedApplication->Name, ApplicationText);
}
LRESULT CALLBACK WndProc (HWND hwnd, UINT Message, WPARAM wParam, LPARAM lParam)
@@ -288,9 +330,34 @@ LRESULT CALLBACK WndProc (HWND hwnd, UINT Message, WPARAM wParam, LPARAM lParam)
{
case WM_CREATE:
{
+ WCHAR wAppName[0x100] = L"";
+ if (strncmp(CmdLine,"add ",4)==0) {
+ CmdLine = CmdLine+4;
+ if(CmdLine[0]==L'\"') {
+ CmdLine++;
+ CmdLine[strlen(CmdLine)-1]=L'\0';
+ }
+ char* aAppName = addDML(CmdLine);
+ MultiByteToWideChar(CP_UTF8, 0, aAppName, -1, wAppName, 0x100);
+ } else if (strncmp(CmdLine,"show ",5)==0) {
+ MultiByteToWideChar(CP_UTF8, 0, CmdLine+5, -1, wAppName, 0x100);
+ }
+
if(!SetupControls(hwnd))
return -1;
- ShowMessage(Strings[IDS_WELCOME_TITLE], Strings[IDS_WELCOME]);
+
+ if(wAppName[0]!=L'\0')
+ searchApp(wAppName, &Root);
+
+ if(SelectedApplication == NULL) {
+ ShowMessage(Strings[IDS_WELCOME_TITLE], Strings[IDS_WELCOME]);
+ } else {
+ ShowSelectedApplication();
+ if(getUninstaller(SelectedApplication, NULL))
+ showUninstaller();
+ else
+ hideUninstaller();
+ }
}
break;
@@ -319,21 +386,20 @@ LRESULT CALLBACK WndProc (HWND hwnd, UINT Message, WPARAM wParam, LPARAM lParam)
{
if (lParam == (LPARAM)hDownloadButton)
{
- if(SelectedApplication)
- DialogBoxW(GetModuleHandle(NULL), MAKEINTRESOURCEW(IDD_DOWNLOAD), 0, DownloadProc);
- else
+ if(SelectedApplication) {
+ DWORD ThreadId;
+ CreateThread(NULL, 0, InstallThreadFunc, SelectedApplication, 0, &ThreadId);
+ } 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);
- }
- }
+ if(SelectedApplication) {
+ DWORD ThreadId;
+ CreateThread(NULL, 0, UninstallThreadFunc, SelectedApplication, 0, &ThreadId);
+ hideUninstaller();
+ } else
+ ShowMessage(Strings[IDS_NO_APP_TITLE], Strings[IDS_NO_APP]);
}
else if (lParam == (LPARAM)hUpdateButton)
{
@@ -363,31 +429,9 @@ LRESULT CALLBACK WndProc (HWND hwnd, UINT Message, WPARAM wParam, LPARAM lParam)
SelectedApplication = (struct Application*) ((LPNMTREEVIEW)lParam)->itemNew.lParam;
if(SelectedApplication)
{
- ApplicationText[0]=L'\0';
- if(StrCmpW(SelectedApplication->Version, L"")) {
- StrCatW(ApplicationText, Strings[IDS_VERSION]);
- StrCatW(ApplicationText, SelectedApplication->Version);
- StrCatW(ApplicationText, L"\n");
- }
- if(StrCmpW(SelectedApplication->Licence, L"")) {
- StrCatW(ApplicationText, Strings[IDS_LICENCE]);
- StrCatW(ApplicationText, SelectedApplication->Licence);
- StrCatW(ApplicationText, L"\n");
- }
- if(StrCmpW(SelectedApplication->Maintainer, L"")) {
- StrCatW(ApplicationText, Strings[IDS_MAINTAINER]);
- StrCatW(ApplicationText, SelectedApplication->Maintainer);
- StrCatW(ApplicationText, L"\n");
- }
- if(StrCmpW(SelectedApplication->Licence, L"") || StrCmpW(SelectedApplication->Version, L"") || StrCmpW(SelectedApplication->Maintainer, L""))
- StrCatW(ApplicationText, L"\n");
- StrCatW(ApplicationText, SelectedApplication->Description);
- ShowMessage(SelectedApplication->Name, ApplicationText);
- WCHAR Uninstaller[200];
- if(StrCmpW(SelectedApplication->RegName, L"")) {
- if(getUninstaller(SelectedApplication->RegName, Uninstaller)) {
- bShowUninstaller = TRUE;
- }
+ ShowSelectedApplication();
+ if(getUninstaller(SelectedApplication, NULL)) {
+ bShowUninstaller = TRUE;
}
}
}
@@ -452,7 +496,8 @@ INT WINAPI WinMain (HINSTANCE hInstance, HINSTANCE hPrevInst,
MSG msg;
InitCommonControls();
-
+ CmdLine = lpCmdLine;
+
// Load strings
for(i=0; i
+
+firefox.1.5.0.9.dml
+firefox.2.0.0.1.dml
diff --git a/reactos/base/applications/downloader/packagetree/internet/browser/firefox.1.5.0.9.dml b/reactos/base/applications/downloader/packagetree/internet/browser/firefox.1.5.0.9.dml
new file mode 100644
index 00000000000..3f077451653
--- /dev/null
+++ b/reactos/base/applications/downloader/packagetree/internet/browser/firefox.1.5.0.9.dml
@@ -0,0 +1,7 @@
+
+ Mozilla Firefox (1.5)
+ MPL/GPL/LGPL
+ 1.5.0.9
+ The most popular and one of the best free WebBrowsers out there.
+ http://ftp-mozilla.netscape.com/pub/mozilla.org/firefox/releases/1.5.0.9/win32/en-US/Firefox%20Setup%201.5.0.9.exe
+
\ No newline at end of file
diff --git a/reactos/base/applications/downloader/packagetree/internet/browser/firefox.2.0.0.1.dml b/reactos/base/applications/downloader/packagetree/internet/browser/firefox.2.0.0.1.dml
new file mode 100644
index 00000000000..4e1d9e4e92f
--- /dev/null
+++ b/reactos/base/applications/downloader/packagetree/internet/browser/firefox.2.0.0.1.dml
@@ -0,0 +1,7 @@
+
+ Mozilla Firefox (2.0.0.1)
+ MPL/GPL/LGPL
+ 2.0.0.1
+ The most popular and one of the best free WebBrowsers out there.
+ http://ftp-mozilla.netscape.com/pub/mozilla.org/firefox/releases/latest/win32/en-US/Firefox%20Setup%202.0.0.1.exe
+
\ No newline at end of file
diff --git a/reactos/base/applications/downloader/packagetree/internet/category.xml b/reactos/base/applications/downloader/packagetree/internet/category.xml
new file mode 100644
index 00000000000..dcf2b42a9b6
--- /dev/null
+++ b/reactos/base/applications/downloader/packagetree/internet/category.xml
@@ -0,0 +1,54 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Mozilla Thunderbird (1.5)
+ MPL/GPL/LGPL
+ 1.5.0.9
+ The most popular and one of the best free MailClients out there.
+ http://ftp-mozilla.netscape.com/pub/mozilla.org/thunderbird/releases/latest/win32/en-US/Thunderbird%20Setup%201.5.0.9.exe
+
+
+ SeaMonkey (1.0.7)
+ 1.0.7
+ Mozilla Suite is alive. This is the one and only Browser, Mail, Chat, Composer bundle you will ever need.
+ http://ftp-mozilla.netscape.com/pub/mozilla.org/seamonkey/releases/1.0.7/seamonkey-1.0.7.en-US.win32.installer.exe
+
+
+ Mozilla ActiveX Control v1.7.12 (ReactOS special)
+ 1.7.12
+ Essential Component to get ReactOS Explorer's and other application's Internet Browsing feature running.
+ http://ovh.dl.sourceforge.net/sourceforge/reactos/MozillaControl1712-ReactOS.exe
+
+
+ The Off By One Web Browser
+ The Off By One Browser is a very small and fast web browser with full HTML 3.2 support.
+ http://offbyone.com/offbyone/images/OffByOneSetup.exe
+
+
+ This tool allows you to access your Windows shared folders/printers with ReactOS.
+ http://svn.reactos.org/packages/samba-tng.exe
+
+
+ Miranda IM
+ 0.5.1
+ Open source multiprotocol instant messaging application - May not work completely.
+ http://ovh.dl.sourceforge.net/sourceforge/miranda/miranda-im-v0.5.1-unicode.exe
+
+
+ PuTTY version 0.59
+ MIT
+ 0.59
+ A free SSH, Telnet, rlogin, and raw TCP client.
+ http://the.earth.li/~sgtatham/putty/latest/x86/putty-0.59-installer.exe
+
+
\ No newline at end of file
diff --git a/reactos/base/applications/downloader/packagetree/internet/internet.rbuild b/reactos/base/applications/downloader/packagetree/internet/internet.rbuild
new file mode 100644
index 00000000000..9b7659f16eb
--- /dev/null
+++ b/reactos/base/applications/downloader/packagetree/internet/internet.rbuild
@@ -0,0 +1,6 @@
+
+
+
+
+
+category.xml
diff --git a/reactos/base/applications/downloader/packagetree/packagetree.rbuild b/reactos/base/applications/downloader/packagetree/packagetree.rbuild
new file mode 100644
index 00000000000..01d7036e57f
--- /dev/null
+++ b/reactos/base/applications/downloader/packagetree/packagetree.rbuild
@@ -0,0 +1,9 @@
+
+
+
+
+
+
+
+
+tree.xml
diff --git a/reactos/base/applications/downloader/packagetree/script/default.install.xml b/reactos/base/applications/downloader/packagetree/script/default.install.xml
new file mode 100644
index 00000000000..c26a300a57f
--- /dev/null
+++ b/reactos/base/applications/downloader/packagetree/script/default.install.xml
@@ -0,0 +1,5 @@
+
\ No newline at end of file
diff --git a/reactos/base/applications/downloader/packagetree/script/default.uninstall.xml b/reactos/base/applications/downloader/packagetree/script/default.uninstall.xml
new file mode 100644
index 00000000000..0f4c05c56ce
--- /dev/null
+++ b/reactos/base/applications/downloader/packagetree/script/default.uninstall.xml
@@ -0,0 +1 @@
+
diff --git a/reactos/base/applications/downloader/packagetree/script/script.rbuild b/reactos/base/applications/downloader/packagetree/script/script.rbuild
new file mode 100644
index 00000000000..069134d0987
--- /dev/null
+++ b/reactos/base/applications/downloader/packagetree/script/script.rbuild
@@ -0,0 +1,3 @@
+
+default.install.xml
+default.uninstall.xml
diff --git a/reactos/base/applications/downloader/downloader.xml b/reactos/base/applications/downloader/packagetree/tree.xml
similarity index 64%
rename from reactos/base/applications/downloader/downloader.xml
rename to reactos/base/applications/downloader/packagetree/tree.xml
index 31fea383d50..9ce014fd9a3 100644
--- a/reactos/base/applications/downloader/downloader.xml
+++ b/reactos/base/applications/downloader/packagetree/tree.xml
@@ -1,182 +1,142 @@
-
-
-
- Mozilla Firefox (1.5)
- MPL/GPL/LGPL
- 1.5.0.9
- The most popular and one of the best free WebBrowsers out there.
- http://ftp-mozilla.netscape.com/pub/mozilla.org/firefox/releases/1.5.0.9/win32/en-US/Firefox%20Setup%201.5.0.9.exe
-
-
- Mozilla Firefox (2.0.0.1)
- MPL/GPL/LGPL
- 2.0.0.1
- The most popular and one of the best free WebBrowsers out there.
- http://ftp-mozilla.netscape.com/pub/mozilla.org/firefox/releases/latest/win32/en-US/Firefox%20Setup%202.0.0.1.exe
-
-
- Mozilla Thunderbird (1.5)
- MPL/GPL/LGPL
- 1.5.0.9
- The most popular and one of the best free MailClients out there.
- http://ftp-mozilla.netscape.com/pub/mozilla.org/thunderbird/releases/latest/win32/en-US/Thunderbird%20Setup%201.5.0.9.exe
-
-
- SeaMonkey (1.0.7)
- 1.0.7
- Mozilla Suite is alive. This is the one and only Browser, Mail, Chat, Composer bundle you will ever need.
- http://ftp-mozilla.netscape.com/pub/mozilla.org/seamonkey/releases/1.0.7/seamonkey-1.0.7.en-US.win32.installer.exe
-
-
- Mozilla ActiveX Control v1.7.12 (ReactOS special)
- 1.7.12
- Essential Component to get ReactOS Explorer's and other application's Internet Browsing feature running.
- http://ovh.dl.sourceforge.net/sourceforge/reactos/MozillaControl1712-ReactOS.exe
-
-
- The Off By One Web Browser
- The Off By One Browser is a very small and fast web browser with full HTML 3.2 support.
- http://offbyone.com/offbyone/images/OffByOneSetup.exe
-
-
- This tool allows you to access your Windows shared folders/printers with ReactOS.
- http://svn.reactos.org/packages/samba-tng.exe
-
-
- Miranda IM
- 0.5.1
- Open source multiprotocol instant messaging application - May not work completely.
- http://ovh.dl.sourceforge.net/sourceforge/miranda/miranda-im-v0.5.1-unicode.exe
-
-
- PuTTY version 0.59
- MIT
- 0.59
- A free SSH, Telnet, rlogin, and raw TCP client.
- http://the.earth.li/~sgtatham/putty/latest/x86/putty-0.59-installer.exe
-
-
-
-
- "AbiWord 2.4.1 (remove only)"
- 2.4.1
- Word processor.
- http://www.abiword.org/downloads/abiword/2.4.1/Windows/abiword-setup-2.4.1.exe
-
-
- OpenOffice.org 2.1
- 2.1.0
- THE Open Source Office Suite.
- http://ftp.tu-chemnitz.de/pub/openoffice-extended//stable/2.1.0/OOo_2.1.0_Win32Intel_install_en-US.exe
-
-
-
-
- IrfanView (remove only)
- 3.99
- Viewer for all kinds of graphics/audio files/video files.
- http://gd.tuwien.ac.at/graphics/irfanview/iview399.exe
-
-
- 3.99
- Additional Plugins for supporting more file types.
- http://irfanview.tuwien.ac.at/plugins/irfanview_plugins_399.exe
-
-
- Tux Paint 0.9.16
- 0.9.16
- An open source bitmap graphics editor geared towards young children.
- http://ovh.dl.sourceforge.net/sourceforge/tuxpaint/tuxpaint-0.9.16-win32-installer.exe
-
-
-
-
-
-
- ReactOS Build Environment 0.3.4
- 0.3.4
- Allows you to build the ReactOS Source. For more instructions see ReactOS wiki.
- http://ovh.dl.sourceforge.net/sourceforge/reactos/RosBE-0.3.4.exe
-
-
- MinGW 5.1.3
- 5.1.3
- A Port of the GNU toolchain with GCC, GDB, GNU make, etc.
- http://puzzle.dl.sourceforge.net/sourceforge/mingw/MinGW-5.1.3.exe
-
-
- FreeBASIC 0.16b
- 0.16b
- Open Source Basic Compiler. The Basic syntax is compatible to QBASIC.
- http://switch.dl.sourceforge.net/sourceforge/fbc/FreeBASIC-v0.16b-win32.exe
-
-
-
-
- ScummVM 0.9.1
- 0.9.1
- SamNMax, Day of Tentacle, etc on ReactOS
- http://ovh.dl.sourceforge.net/sourceforge/scummvm/scummvm-0.9.1-win32.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
-
-
- OpenTTD 0.5.0
- 0.5.0-RC5
- Open-source-clone of the "Transport Tycoon Deluxe" game-engine. You need a copy of Transport Tycoon.
- http://ovh.dl.sourceforge.net/sourceforge/openttd/openttd-0.5.0-RC5-win32.exe
-
- LBreakout2 2.4.1
- LBreakout2 2.4.1
- 2.4.1
- Breakout Clone using SDL libs.
- http://switch.dl.sourceforge.net/sourceforge/lgames/lbreakout2-2.4.1-win32.exe
-
-
- LGeneral 1.1
- 1.1
- Panzer General Clone using SDL libs.
- http://kent.dl.sourceforge.net/sourceforge/lgames/lgeneral-1.1-win32.exe
-
-
- LMarbles 1.0.6
- 1.0.6
- Atomix Clone using SDL libs.
- http://heanet.dl.sourceforge.net/sourceforge/lgames/lmarbles-1.0.6-win32.exe
-
-
-
-
- 7-Zip 4.42
- 4.42
- Utility to create and open 7zip, zip, tar, rar and other archive files.
- http://ovh.dl.sourceforge.net/sourceforge/sevenzip/7z442.exe
-
-
- µTorrent
- 1.6
- Small and fast Torrent Client.
- http://download.utorrent.com/1.6/uTorrent-1.6-install.exe
-
-
- Audiograbber 1.83 SE
- 1.83 SE
- A very good CD Ripper/Audio File Converter.
- http://www.audiograbber.de/files/342677432/agsetup183se.exe
-
-
-
-
- 1.2.11
- Needed for many Open Source Games to run. You need 7-Zip or a similar Utility to extract it.
- http://ovh.dl.sourceforge.net/sourceforge/libsdl/SDL-1.2.11-win32.zip
-
-
- 0.65
- DOSBox is a DOS emulator.
- http://puzzle.dl.sourceforge.net/sourceforge/dosbox/DOSBox0.65-win32-installer.exe
-
-
-
+
+
+
+
+ "AbiWord 2.4.1 (remove only)"
+ 2.4.1
+ Word processor.
+ http://www.abiword.org/downloads/abiword/2.4.1/Windows/abiword-setup-2.4.1.exe
+
+
+ OpenOffice.org 2.1
+ 2.1.0
+ THE Open Source Office Suite.
+ http://ftp.tu-chemnitz.de/pub/openoffice-extended//stable/2.1.0/OOo_2.1.0_Win32Intel_install_en-US.exe
+
+
+
+
+ IrfanView (remove only)
+ 3.99
+ Viewer for all kinds of graphics/audio files/video files.
+ http://gd.tuwien.ac.at/graphics/irfanview/iview399.exe
+
+
+ 3.99
+ Additional Plugins for supporting more file types.
+ http://irfanview.tuwien.ac.at/plugins/irfanview_plugins_399.exe
+
+
+ Tux Paint 0.9.16
+ 0.9.16
+ An open source bitmap graphics editor geared towards young children.
+ http://ovh.dl.sourceforge.net/sourceforge/tuxpaint/tuxpaint-0.9.16-win32-installer.exe
+
+
+
+
+
+
+ ReactOS Build Environment 0.3.4
+ 0.3.4
+ Allows you to build the ReactOS Source. For more instructions see ReactOS wiki.
+ http://ovh.dl.sourceforge.net/sourceforge/reactos/RosBE-0.3.4.exe
+
+
+ MinGW 5.1.3
+ 5.1.3
+ A Port of the GNU toolchain with GCC, GDB, GNU make, etc.
+ http://puzzle.dl.sourceforge.net/sourceforge/mingw/MinGW-5.1.3.exe
+
+
+ FreeBASIC 0.16b
+ 0.16b
+ Open Source Basic Compiler. The Basic syntax is compatible to QBASIC.
+ http://switch.dl.sourceforge.net/sourceforge/fbc/FreeBASIC-v0.16b-win32.exe
+
+
+
+
+ ScummVM 0.9.1
+ 0.9.1
+ SamNMax, Day of Tentacle, etc on ReactOS
+ http://ovh.dl.sourceforge.net/sourceforge/scummvm/scummvm-0.9.1-win32.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
+
+
+ OpenTTD 0.5.0
+ 0.5.0-RC5
+ Open-source-clone of the "Transport Tycoon Deluxe" game-engine. You need a copy of Transport Tycoon.
+ http://ovh.dl.sourceforge.net/sourceforge/openttd/openttd-0.5.0-RC5-win32.exe
+
+ LBreakout2 2.4.1
+ LBreakout2 2.4.1
+ 2.4.1
+ Breakout Clone using SDL libs.
+ http://switch.dl.sourceforge.net/sourceforge/lgames/lbreakout2-2.4.1-win32.exe
+
+
+ LGeneral 1.1
+ 1.1
+ Panzer General Clone using SDL libs.
+ http://kent.dl.sourceforge.net/sourceforge/lgames/lgeneral-1.1-win32.exe
+
+
+ LMarbles 1.0.6
+ 1.0.6
+ Atomix Clone using SDL libs.
+ http://heanet.dl.sourceforge.net/sourceforge/lgames/lmarbles-1.0.6-win32.exe
+
+
+
+
+ 7-Zip 4.42
+ 4.42
+ Utility to create and open 7zip, zip, tar, rar and other archive files.
+ http://ovh.dl.sourceforge.net/sourceforge/sevenzip/7z442.exe
+
+
+ uTorrent
+ 1.6
+ Small and fast Torrent Client.
+ http://download.utorrent.com/1.6/uTorrent-1.6-install.exe
+
+
+ Audiograbber 1.83 SE
+ 1.83 SE
+ A very good CD Ripper/Audio File Converter.
+ http://www.audiograbber.de/files/342677432/agsetup183se.exe
+
+
+
+
+ SDL Runtime
+ 1.2.11
+ Needed for many Open Source Games to run. You need 7-Zip or a similar Utility to extract it.
+ http://ovh.dl.sourceforge.net/sourceforge/libsdl/SDL-1.2.11-win32.zip
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 0.65
+ DOSBox is a DOS emulator.
+ http://puzzle.dl.sourceforge.net/sourceforge/dosbox/DOSBox0.65-win32-installer.exe
+
+
+
diff --git a/reactos/base/applications/downloader/resources.h b/reactos/base/applications/downloader/resources.h
index e3918f667bf..875777f62fd 100644
--- a/reactos/base/applications/downloader/resources.h
+++ b/reactos/base/applications/downloader/resources.h
@@ -39,9 +39,10 @@
#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 IDS_UNZIP_ERROR 17
+#define IDS_VERSION 18
+#define IDS_LICENCE 19
+#define IDS_MAINTAINER 20
-#define STRING_COUNT 20
+#define STRING_COUNT 21
#define MAX_STRING_LENGHT 0x100
diff --git a/reactos/base/applications/downloader/script.c b/reactos/base/applications/downloader/script.c
new file mode 100644
index 00000000000..c7ebb082e17
--- /dev/null
+++ b/reactos/base/applications/downloader/script.c
@@ -0,0 +1,246 @@
+/* PROJECT: ReactOS Downloader
+ * LICENSE: GPL - See COPYING in the top level directory
+ * FILE: base/applications/downloader/script.c
+ * PURPOSE: Run (un/)installscript
+ * PROGRAMMERS: Lester Kortenhoeven
+ */
+
+#include
+
+#include "resources.h"
+#include "structures.h"
+
+extern BOOL getUninstaller(struct Application*, WCHAR*);
+extern INT_PTR CALLBACK DownloadProc (HWND, UINT, WPARAM, LPARAM);
+extern WCHAR Strings [STRING_COUNT][MAX_STRING_LENGHT];
+
+static void DownloadScriptFunc (WCHAR* URL, WCHAR* File) {
+ struct lParamDownload* lParam;
+ lParam = malloc(sizeof(struct lParamDownload));
+ lParam->URL = URL;
+ lParam->File = File;
+ DialogBoxParamW(GetModuleHandle(NULL), MAKEINTRESOURCEW(IDD_DOWNLOAD), 0, DownloadProc, (LPARAM)lParam);
+ free(lParam);
+}
+
+static void ExecScriptFunc(WCHAR* Arg) {
+ STARTUPINFOW si;
+ PROCESS_INFORMATION pi;
+
+ memset(&si, 0, sizeof(si));
+ si.cb=sizeof(si);
+ CreateProcessW(NULL,Arg,NULL,NULL,FALSE,0,NULL,NULL,&si,&pi);
+ CloseHandle(pi.hThread);
+ WaitForSingleObject(pi.hProcess, INFINITE);
+ CloseHandle(pi.hProcess);
+}
+
+
+static void DelScriptFunc(WCHAR* Arg) {
+ DeleteFileW(Arg);
+}
+
+static BOOL UnzipScriptFunc(WCHAR* File, WCHAR* Outdir) {
+ HKEY hKey;
+ DWORD Type = 0;
+ WCHAR ExecStr[0x100];
+ DWORD currentlengt = 0x100;
+ if (RegOpenKeyExW(HKEY_LOCAL_MACHINE,L"SOFTWARE\\7-Zip",0,KEY_READ,&hKey) == ERROR_SUCCESS) {
+ if (RegQueryValueExW(hKey,L"Path",0,&Type,(LPBYTE)ExecStr,¤tlengt) == ERROR_SUCCESS) {
+ if (File[0] != L'\0') {
+ wcsncat(ExecStr,L"\\7z.exe x ",0x100-currentlengt);
+ currentlengt = lstrlenW(ExecStr);
+ wcsncat(ExecStr,File,0x100-currentlengt);
+ currentlengt = lstrlenW(ExecStr);
+ wcsncat(ExecStr,L" -o",0x100-currentlengt);
+ currentlengt = lstrlenW(ExecStr);
+ wcsncat(ExecStr,Outdir,0x100-currentlengt);
+ ExecScriptFunc(ExecStr);
+ RegCloseKey(hKey);
+ }
+ return TRUE;
+ }
+ RegCloseKey(hKey);
+ }
+ MessageBoxW(0,Strings[IDS_UNZIP_ERROR],0,0);
+ return FALSE;
+}
+
+static void AddUninstallerScriptFunc(WCHAR* RegName, WCHAR* File) {
+ HKEY hKey1;
+ HKEY hKey2;
+ LPDWORD dispos = NULL;
+ if (RegOpenKeyExW(HKEY_LOCAL_MACHINE,L"SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall",0,KEY_WRITE,&hKey1) == ERROR_SUCCESS)
+ if (RegCreateKeyEx(hKey1,RegName,0,NULL,REG_OPTION_NON_VOLATILE,KEY_WRITE,NULL,&hKey2,dispos) == ERROR_SUCCESS) {
+ RegSetValueExW(hKey2,L"DisplayName",0,REG_SZ,(BYTE*)RegName,(lstrlen(RegName)+1)*sizeof(WCHAR));
+ RegSetValueExW(hKey2,L"UninstallString",0,REG_SZ,(BYTE*)File,(lstrlen(File)+1)*sizeof(WCHAR));
+ }
+ RegCloseKey(hKey2);
+ RegCloseKey(hKey1);
+}
+
+static void RemoveUninstallerScriptFunc(WCHAR* RegName) {
+ HKEY hKey1;
+ HKEY hKey2;
+ if (RegOpenKeyExW(HKEY_LOCAL_MACHINE,L"SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall",0,KEY_WRITE,&hKey1) == ERROR_SUCCESS) {
+ if (RegOpenKeyExW(hKey1,RegName,0,KEY_WRITE,&hKey2) == ERROR_SUCCESS) {
+ RegDeleteValueW(hKey2,L"DisplayName");
+ RegDeleteValueW(hKey2,L"UninstallString");
+ RegCloseKey(hKey2);
+ }
+ // RegDeleteKeyW(hKey1,RegName);
+ }
+ RegCloseKey(hKey1);
+}
+
+static void MessageScriptFunc(WCHAR* Text) {
+ MessageBoxW(0,Text,Strings[IDS_WINDOW_TITLE],0);
+}
+
+extern void LoadScriptFunc(WCHAR*, struct ScriptElement*);
+
+static void RunScript(struct Application* App, struct ScriptElement* Script) {
+ BOOL bRun = TRUE;
+ struct ScriptElement* p = Script;
+ INT SizeB = 0x100;
+ INT SizeA = sizeof(p->Arg)/sizeof(*(p->Arg));
+ INT i;
+ int currentlengt = 0;
+ WCHAR ArgBuffer[SizeA][SizeB];
+ WCHAR BufferA[SizeB];
+ WCHAR BufferB[SizeB];
+ WCHAR BufferC[SizeB];
+ WCHAR* Pos1;
+ WCHAR* Pos2;
+ WCHAR* Pos3 = NULL;
+ BOOL bNext;
+ while(bRun && (p != NULL)) {
+
+ for(i=0; iArg[i]);
+ Pos1 = BufferA;
+ Pos2 = wcschr(Pos1, L'%');
+ if(!Pos2) {
+ wcscpy(ArgBuffer[i], Pos1);
+ break;
+ }
+ Pos2[0] = L'\0';
+ wcscpy(BufferB, Pos1);
+ Pos1 = Pos2 + 1;
+ Pos2 = wcschr(Pos1, L'%');
+ while (Pos2) {
+ Pos2[0] = L'\0';
+ if(bNext) {
+ if (wcscmp(Pos1, L"name") == 0) {
+ Pos3 = App->Name;
+ } else if (wcscmp(Pos1, L"regname") == 0) {
+ Pos3 = App->RegName;
+ } else if (wcscmp(Pos1, L"version") == 0) {
+ Pos3 = App->Version;
+ } else if (wcscmp(Pos1, L"maintainer") == 0) {
+ Pos3 = App->Maintainer;
+ } else if (wcscmp(Pos1, L"licence") == 0) {
+ Pos3 = App->Licence;
+ } else if (wcscmp(Pos1, L"description") == 0) {
+ Pos3 = App->Description;
+ } else if (wcscmp(Pos1, L"location") == 0) {
+ Pos3 = App->Location;
+ } else if (wcscmp(Pos1, L"regname_uninstaller") == 0) {
+ if (!getUninstaller(App, BufferC)) {
+ BufferC[0] = '\0';
+ }
+ Pos3 = BufferC;
+ } else if (wcscmp(Pos1, L"location_file") == 0) {
+ Pos3 = wcsrchr(App->Location, L'/');
+ if(Pos3 == NULL) {
+ BufferC[0] = '\0';
+ Pos3 = BufferC;
+ } else {
+ Pos3++;
+ }
+ } else {
+ Pos3 = _wgetenv(Pos1);
+ }
+ bNext = !(Pos3);
+ if (bNext) {
+ Pos3 = Pos1;
+ currentlengt = lstrlenW(BufferB);
+ wcsncat(BufferB, L"%", SizeB-currentlengt);
+ }
+ } else {
+ Pos3 = Pos1;
+ bNext = TRUE;
+ }
+ currentlengt = lstrlenW(BufferB);
+ wcsncat(BufferB, Pos3, SizeB-currentlengt);
+ Pos1 = Pos2 + 1;
+ Pos2 = wcschr(Pos1, L'%');
+ }
+ if (bNext) {
+ wcsncat(BufferB, L"%", SizeB-currentlengt);
+ }
+ currentlengt = lstrlenW(BufferB);
+ wcsncat(BufferB, Pos1, SizeB-currentlengt);
+ wcscpy(ArgBuffer[i], BufferB);
+ }
+
+ if (wcscmp(p->Func, L"download") == 0) {
+ DownloadScriptFunc(ArgBuffer[0], ArgBuffer[1]);
+ } else if (wcscmp(p->Func, L"exec") == 0) {
+ ExecScriptFunc(ArgBuffer[0]);
+ } else if (wcscmp(p->Func, L"del") == 0) {
+ DelScriptFunc(ArgBuffer[0]);
+ } else if (wcscmp(p->Func, L"unzip") == 0) {
+ bRun = UnzipScriptFunc(ArgBuffer[0], ArgBuffer[1]);
+ } else if (wcscmp(p->Func, L"adduninstaller") == 0) {
+ AddUninstallerScriptFunc(ArgBuffer[0], ArgBuffer[1]);
+ } else if (wcscmp(p->Func, L"removeuninstaller") == 0) {
+ RemoveUninstallerScriptFunc(ArgBuffer[0]);
+ } else if (wcscmp(p->Func, L"message") == 0) {
+ MessageScriptFunc(ArgBuffer[0]);
+ } else if (wcscmp(p->Func, L"load") == 0) {
+ LoadScriptFunc(ArgBuffer[0],p);
+ }
+ p = p->Next;
+ }
+}
+
+DWORD WINAPI InstallThreadFunc(LPVOID Context) {
+ struct Application* App = (struct Application*)Context;
+
+ if(App->InstallScript == NULL){
+ /* Default UninstallScript */
+ struct ScriptElement* Current;
+ Current = malloc(sizeof(struct ScriptElement));
+ App->InstallScript = Current;
+ memset(Current, 0, sizeof(struct ScriptElement));
+ wcscpy(Current->Func, L"load");
+ wcscpy(Current->Arg[0], L"script/default.install.xml");
+ }
+
+ RunScript(App, App->InstallScript);
+
+ return 0;
+}
+
+
+
+DWORD WINAPI UninstallThreadFunc(LPVOID Context){
+ struct Application* App = (struct Application*)Context;
+
+ if(App->UninstallScript == NULL){
+ /* Default UninstallScript */
+ struct ScriptElement* Current;
+ Current = malloc(sizeof(struct ScriptElement));
+ App->UninstallScript = Current;
+ memset(Current, 0, sizeof(struct ScriptElement));
+ wcscpy(Current->Func, L"load");
+ wcscpy(Current->Arg[0], L"script/default.uninstall.xml");
+ }
+
+ RunScript(App, App->UninstallScript);
+
+ return 0;
+}
+
diff --git a/reactos/base/applications/downloader/structures.h b/reactos/base/applications/downloader/structures.h
index 3044ce58506..fc1fee118c2 100644
--- a/reactos/base/applications/downloader/structures.h
+++ b/reactos/base/applications/downloader/structures.h
@@ -9,6 +9,8 @@ struct Application
WCHAR Description[0x400];
WCHAR Location[0x100];
struct Application* Next;
+ struct ScriptElement* InstallScript;
+ struct ScriptElement* UninstallScript;
};
struct Category
@@ -22,3 +24,17 @@ struct Category
struct Category* Children;
struct Category* Parent;
};
+
+struct ScriptElement
+{
+ WCHAR Func[0x100];
+ WCHAR Arg[2][0x100];
+ struct ScriptElement* Next;
+};
+
+struct lParamDownload
+{
+ HWND Dlg;
+ WCHAR* URL;
+ WCHAR* File;
+};
diff --git a/reactos/base/applications/downloader/translations/de.rc b/reactos/base/applications/downloader/translations/de.rc
index 01e01a89a4c..497325ac15c 100644
--- a/reactos/base/applications/downloader/translations/de.rc
+++ b/reactos/base/applications/downloader/translations/de.rc
@@ -14,7 +14,7 @@ STRINGTABLE DISCARDABLE
BEGIN
IDS_WINDOW_TITLE "Download ! - ReactOS Downloader"
IDS_WELCOME_TITLE "Willkommen im ReactOS Downloader"
- IDS_WELCOME "Bitte wählen Sie rechts eine Kategorie. Dies ist Version 1.0."
+ IDS_WELCOME "Bitte wählen Sie links eine Kategorie. Dies ist Version 1.0."
IDS_NO_APP_TITLE "Keine Anwendung ausgewählt"
IDS_NO_APP "Bitte wählen Sie eine Anwendung, bevor Sie die Download-Schaltfläche betätigen. Wenn Sie Hilfe benötigen, drücken Sie die Hilfe-Schaltfläche in der oberen rechten Ecke."
IDS_UPDATE_TITLE "Update"
@@ -29,6 +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_UNZIP_ERROR "7-Zip nicht gefunden.\nBitte installieren Sie 7-Zip."
IDS_VERSION "Version: "
IDS_LICENCE "Lizenz: "
IDS_MAINTAINER "Maintainer: "
diff --git a/reactos/base/applications/downloader/translations/en.rc b/reactos/base/applications/downloader/translations/en.rc
index c54fe275daa..5921e961ef9 100644
--- a/reactos/base/applications/downloader/translations/en.rc
+++ b/reactos/base/applications/downloader/translations/en.rc
@@ -14,7 +14,7 @@ STRINGTABLE DISCARDABLE
BEGIN
IDS_WINDOW_TITLE "Download ! - ReactOS Downloader"
IDS_WELCOME_TITLE "Welcome to the ReactOS Downloader"
- IDS_WELCOME "Please choose a category on the right. This is version 1.0."
+ IDS_WELCOME "Please choose a category on the left. This is version 1.0."
IDS_NO_APP_TITLE "No application selected"
IDS_NO_APP "Please select a Application before you click the download button, if you need assistance please click on the question mark button on the top right corner."
IDS_UPDATE_TITLE "Update"
@@ -29,6 +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_UNZIP_ERROR "7-Zip not found.\nPlease install 7-Zip"
IDS_VERSION "Version: "
IDS_LICENCE "Licence: "
IDS_MAINTAINER "Maintainer: "
diff --git a/reactos/base/applications/downloader/translations/fr.rc b/reactos/base/applications/downloader/translations/fr.rc
index a75b97e2acd..4efedf6348e 100644
--- a/reactos/base/applications/downloader/translations/fr.rc
+++ b/reactos/base/applications/downloader/translations/fr.rc
@@ -29,6 +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_UNZIP_ERROR "7-Zip not found.\nPlease install 7-Zip"
IDS_VERSION "Version: "
IDS_LICENCE "Licence: "
IDS_MAINTAINER "Maintainer: "
diff --git a/reactos/base/applications/downloader/translations/id.rc b/reactos/base/applications/downloader/translations/id.rc
index bf02804af92..89d642d2074 100644
--- a/reactos/base/applications/downloader/translations/id.rc
+++ b/reactos/base/applications/downloader/translations/id.rc
@@ -29,6 +29,7 @@ BEGIN
IDS_XMLERROR_1 "Tidak dapat menemukan file xml !"
IDS_XMLERROR_2 "Tidak dapat mengurai file xml !"
IDS_DOWNLOAD_ERROR "Tidak bisa mendownload file.\nSilahkan periksa koneksi internet anda."
+ IDS_UNZIP_ERROR "7-Zip not found.\nPlease install 7-Zip"
IDS_VERSION "Versi: "
IDS_LICENCE "Lisensi: "
IDS_MAINTAINER "Pemelihara: "
diff --git a/reactos/base/applications/downloader/translations/it.rc b/reactos/base/applications/downloader/translations/it.rc
index bd3c2a6ad66..ade0ff46d10 100644
--- a/reactos/base/applications/downloader/translations/it.rc
+++ b/reactos/base/applications/downloader/translations/it.rc
@@ -29,6 +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_UNZIP_ERROR "7-Zip not found.\nPlease install 7-Zip"
IDS_VERSION "Version: "
IDS_LICENCE "Licence: "
IDS_MAINTAINER "Maintainer: "
diff --git a/reactos/base/applications/downloader/xml.c b/reactos/base/applications/downloader/xml.c
index 3d02023c01f..b56ff71dc6c 100644
--- a/reactos/base/applications/downloader/xml.c
+++ b/reactos/base/applications/downloader/xml.c
@@ -10,20 +10,153 @@
#include
#include
#include
+#include
#include "structures.h"
#include "resources.h"
BOOL TagOpen;
+BOOL InstallScriptOpen;
+BOOL UninstallScriptOpen;
struct Category* Current;
struct Application* CurrentApplication;
+struct ScriptElement* CurrentScript;
+char DML_Name[0x100];
+char DML_Target[0x100];
+char Path [0x100];
char CurrentTag [0x100];
+
extern WCHAR Strings [STRING_COUNT][MAX_STRING_LENGHT];
+BOOL ImportXML (const char*);
+
+void ImportFolder (const char* folder)
+{
+ WCHAR buffer[0x100];
+ char buffer2[0x100];
+ struct _wfinddata_t Finddata;
+ DWORD Findhandle;
+ buffer[0]='\0';
+ strcpy(buffer2, Path);
+ strncat(buffer2, folder, 0x100-strlen(buffer2));
+ strncat(buffer2, "\\*.dml", 0x100-strlen(buffer2));
+ MultiByteToWideChar(CP_UTF8, 0, buffer2, -1, buffer, 0x100);
+ if((Findhandle=_wfindfirst(buffer, &Finddata)) == -1)
+ return;
+ do {
+ buffer[0]='\0';
+ MultiByteToWideChar(CP_UTF8, 0, folder, -1, buffer, 0x100);
+ wcsncat(buffer, L"\\", 0x100-wcslen(buffer));
+ wcsncat(buffer, Finddata.name, 0x100-wcslen(buffer));
+ WideCharToMultiByte(CP_UTF8, 0, buffer, -1, buffer2, 0x100, NULL, FALSE);
+ ImportXML(buffer2);
+ } while(_wfindnext(Findhandle, &Finddata)==0);
+ _findclose(Findhandle);
+}
+
+
+void Script_tag_opened (void* usrdata, const char* tag, const char** arg)
+{
+ int i;
+ if (!strcmp(tag, "script")) {
+ return;
+ } else if (InstallScriptOpen && (CurrentScript == NULL)) {
+ CurrentApplication->InstallScript = malloc(sizeof(struct ScriptElement));
+ CurrentScript = CurrentApplication->InstallScript;
+ } else if (UninstallScriptOpen && (CurrentScript == NULL)) {
+ CurrentApplication->UninstallScript = malloc(sizeof(struct ScriptElement));
+ CurrentScript = CurrentApplication->UninstallScript;
+ } else if (CurrentScript != NULL) {
+ CurrentScript->Next = malloc(sizeof(struct ScriptElement));
+ CurrentScript = CurrentScript->Next;
+ } else {
+ return;
+ }
+ memset(CurrentScript, 0, sizeof(struct ScriptElement));
+ if (!strcmp(tag, "download")) {
+ wcscpy(CurrentScript->Func, L"download");
+ for (i=0; arg[i]; i+=2) {
+ if(!strcmp(arg[i], "file")) {
+ MultiByteToWideChar(CP_UTF8, 0, arg[i+1], -1, CurrentScript->Arg[1], 0x100);
+ } else if(!strcmp(arg[i], "url")) {
+ MultiByteToWideChar(CP_UTF8, 0, arg[i+1], -1, CurrentScript->Arg[0], 0x100);
+ }
+ }
+ } else if (!strcmp(tag, "exec")) {
+ wcscpy(CurrentScript->Func, L"exec");
+ for (i=0; arg[i]; i+=2) {
+ if(!strcmp(arg[i], "file")) {
+ MultiByteToWideChar(CP_UTF8, 0, arg[i+1], -1, CurrentScript->Arg[0], 0x100);
+ }
+ }
+ } else if (!strcmp(tag, "del")) {
+ wcscpy(CurrentScript->Func, L"del");
+ for (i=0; arg[i]; i+=2) {
+ if(!strcmp(arg[i], "file")) {
+ MultiByteToWideChar(CP_UTF8, 0, arg[i+1], -1, CurrentScript->Arg[0], 0x100);
+ }
+ }
+ } else if (!strcmp(tag, "unzip")) {
+ wcscpy(CurrentScript->Func, L"unzip");
+ for (i=0; arg[i]; i+=2) {
+ if(!strcmp(arg[i], "file")) {
+ MultiByteToWideChar(CP_UTF8, 0, arg[i+1], -1, CurrentScript->Arg[0], 0x100);
+ } else if(!strcmp(arg[i], "outdir")) {
+ MultiByteToWideChar(CP_UTF8, 0, arg[i+1], -1, CurrentScript->Arg[1], 0x100);
+ }
+ }
+ } else if (!strcmp(tag, "adduninstaller")) {
+ wcscpy(CurrentScript->Func, L"adduninstaller");
+ for (i=0; arg[i]; i+=2) {
+ if(!strcmp(arg[i], "regname")) {
+ MultiByteToWideChar(CP_UTF8, 0, arg[i+1], -1, CurrentScript->Arg[0], 0x100);
+ } else if(!strcmp(arg[i], "file")) {
+ MultiByteToWideChar(CP_UTF8, 0, arg[i+1], -1, CurrentScript->Arg[1], 0x100);
+ }
+ }
+ } else if (!strcmp(tag, "removeuninstaller")) {
+ wcscpy(CurrentScript->Func, L"removeuninstaller");
+ for (i=0; arg[i]; i+=2) {
+ if(!strcmp(arg[i], "regname")) {
+ MultiByteToWideChar(CP_UTF8, 0, arg[i+1], -1, CurrentScript->Arg[0], 0x100);
+ }
+ }
+ } else if (!strcmp(tag, "message")) {
+ wcscpy(CurrentScript->Func, L"message");
+ for (i=0; arg[i]; i+=2) {
+ if(!strcmp(arg[i], "text")) {
+ MultiByteToWideChar(CP_UTF8, 0, arg[i+1], -1, CurrentScript->Arg[0], 0x100);
+ }
+ }
+ } else if (!strcmp(tag, "load")) {
+ wcscpy(CurrentScript->Func, L"load");
+ for (i=0; arg[i]; i+=2) {
+ if(!strcmp(arg[i], "file")) {
+ MultiByteToWideChar(CP_UTF8, 0, arg[i+1], -1, CurrentScript->Arg[0], 0x100);
+ }
+ }
+ } else
+ MessageBoxW(0,Strings[IDS_XMLERROR_2],0,0);
+}
+
void tag_opened (void* usrdata, const char* tag, const char** arg)
{
int i;
- if(!strcmp(tag, "tree") && !CurrentApplication)
+ if(!strcmp(tag, "import"))
+ {
+ for (i=0; arg[i]; i+=2)
+ {
+ if(!strcmp(arg[i], "file"))
+ {
+ ImportXML(arg[i+1]);
+ }
+ else if(!strcmp(arg[i], "folder"))
+ {
+ ImportFolder(arg[i+1]);
+ }
+ }
+ }
+ else if(!strcmp(tag, "tree") && !CurrentApplication)
{
// check version
}
@@ -92,7 +225,16 @@ void tag_opened (void* usrdata, const char* tag, const char** arg)
}
else if (CurrentApplication)
{
- strncpy(CurrentTag, tag, 0x100);
+ if (!strcmp(tag, "installscript")) {
+ InstallScriptOpen = TRUE;
+ } else if (!strcmp(tag, "uninstallscript")) {
+ UninstallScriptOpen = TRUE;
+ } else {
+ Script_tag_opened(usrdata, tag, arg);
+ if (CurrentScript == NULL) {
+ strncpy(CurrentTag, tag, 0x100);
+ }
+ }
}
else
MessageBoxW(0,Strings[IDS_XMLERROR_2],0,0);
@@ -155,30 +297,27 @@ void tag_closed (void* tree, const char* tag)
{
CurrentApplication = NULL;
}
+ else if(!strcmp(tag, "installscript") || !strcmp(tag, "uninstallscript"))
+ {
+ CurrentScript = NULL;
+ InstallScriptOpen = FALSE;
+ UninstallScriptOpen = FALSE;
+ }
}
-BOOL ProcessXML (const char* filename, struct Category* Root)
+BOOL ImportXML (const char* filename)
{
int done = 0;
- char buffer[255];
+ char buffer[0x100];
FILE* file;
XML_Parser parser;
-
- if(Current)
- return FALSE;
-
- Current = Root;
- TagOpen = TRUE;
-
- file = fopen(filename, "r");
+ strcpy(buffer, Path);
+ strncat(buffer, filename, 0x100-strlen(buffer));
+ file = fopen(buffer, "r");
if(!file)
{
- file = fopen("downloader.xml", "r");
- if(!file)
- {
- MessageBoxW(0,Strings[IDS_XMLERROR_1],0,0);
- return FALSE;
- }
+ MessageBoxW(0,Strings[IDS_XMLERROR_1],0,0);
+ return FALSE;
}
parser = XML_ParserCreate(NULL);
@@ -204,10 +343,169 @@ BOOL ProcessXML (const char* filename, struct Category* Root)
return TRUE;
}
+BOOL ProcessXML (const char* filename, struct Category* Root)
+{
+ FILE* file;
+ file = fopen(filename, "r");
+ if(file)
+ {
+ Path[0]='\0';
+ fclose(file);
+ }
+ else
+ {
+ strncpy(Path, getenv("SystemRoot"), 0x100-13);
+ strcat(Path, "\\packagetree\\");
+ }
+
+ if(Current)
+ return FALSE;
+
+ Current = Root;
+ CurrentApplication = NULL;
+ CurrentScript = NULL;
+ TagOpen = TRUE;
+ InstallScriptOpen = FALSE;
+ UninstallScriptOpen = FALSE;
+
+ return ImportXML(filename);
+}
+
+void DML_tag_opened (void* usrdata, const char* tag, const char** arg)
+{
+ int i;
+
+ if(!strcmp(tag, "application"))
+ {
+ for (i=0; arg[i]; i+=2)
+ {
+ if(!strcmp(arg[i], "name"))
+ {
+ strncpy(DML_Name, arg[i+1], 0x100);
+ }
+ else if(!strcmp(arg[i], "target"))
+ {
+ strncpy(DML_Target, arg[i+1], 0x100);
+ }
+ }
+ }
+}
+
+void NOP_text (void* usrdata, const char* data, int len)
+{
+}
+
+void NOP_tag_closed (void* tree, const char* tag)
+{
+}
+
+char* addDML (const char* filename)
+{
+ int done = 0;
+ char buffer[0x100];
+ FILE* file;
+ XML_Parser parser;
+ DML_Target[0] = '\0';
+ file = fopen(filename, "r");
+ if(!file)
+ {
+ MessageBoxW(0,Strings[IDS_XMLERROR_1],0,0);
+ return NULL;
+ }
+
+ parser = XML_ParserCreate(NULL);
+ XML_SetElementHandler(parser, DML_tag_opened, NOP_tag_closed);
+ XML_SetCharacterDataHandler(parser, NOP_text);
+
+ while (!done)
+ {
+ size_t len = fread (buffer, 1, sizeof(buffer), file);
+ done = len < sizeof(buffer);
+
+ buffer[len] = 0;
+ if(!XML_Parse(parser, buffer, len, done))
+ {
+ MessageBoxW(0,Strings[IDS_XMLERROR_2],0,0);
+ return NULL;
+ }
+ }
+
+ XML_ParserFree(parser);
+ fclose(file);
+
+ if(DML_Target[0]=='\0')
+ {
+ MessageBoxW(0,Strings[IDS_XMLERROR_2],0,0);
+ return NULL;
+ }
+
+ strcpy(buffer, getenv("SystemRoot"));
+ strncat(buffer, "\\packagetree\\", 0x100-strlen(buffer));
+ strncat(buffer, DML_Target, 0x100-strlen(buffer));
+
+ CopyFileA(filename, buffer, FALSE);
+ return DML_Name;
+}
+
+void LoadScriptFunc(WCHAR* filenameW, struct ScriptElement* Script)
+{
+ int done = 0;
+ char buffer[0x100];
+ char filenameA[0x100];
+ FILE* file;
+ XML_Parser parser;
+ struct ScriptElement* NextElement = Script->Next;
+ wcscpy(Script->Func,L"NOP");
+ CurrentScript = Script;
+ WideCharToMultiByte(CP_UTF8, 0, filenameW, -1, filenameA, 0x100, NULL, FALSE);
+ strcpy(buffer, Path);
+ strncat(buffer, filenameA, 0x100-strlen(buffer));
+ file = fopen(buffer, "r");
+ if(!file)
+ {
+ MessageBoxW(0,Strings[IDS_XMLERROR_1],0,0);
+ return;
+ }
+
+ parser = XML_ParserCreate(NULL);
+ XML_SetElementHandler(parser, Script_tag_opened, NOP_tag_closed);
+ XML_SetCharacterDataHandler(parser, NOP_text);
+
+ while (!done)
+ {
+ size_t len = fread (buffer, 1, sizeof(buffer), file);
+ done = len < sizeof(buffer);
+
+ buffer[len] = 0;
+ if(!XML_Parse(parser, buffer, len, done))
+ {
+ MessageBoxW(0,Strings[IDS_XMLERROR_2],0,0);
+ CurrentScript->Next = NextElement;
+ return;
+ }
+ }
+
+ XML_ParserFree(parser);
+ fclose(file);
+ CurrentScript->Next = NextElement;
+ return;
+}
+
+void FreeScript (struct ScriptElement* Script)
+{
+ if (Script->Next != NULL)
+ FreeScript(Script->Next);
+ free(Script);
+}
+
void FreeApps (struct Application* Apps)
{
if (Apps->Next)
FreeApps(Apps->Next);
+ if (Apps->InstallScript)
+ FreeScript(Apps->InstallScript);
+ if (Apps->UninstallScript)
+ FreeScript(Apps->UninstallScript);
free(Apps);
}