Author: dchapyshev
Date: Sat Oct 24 14:58:07 2009
New Revision: 43710
URL:
http://svn.reactos.org/svn/reactos?rev=43710&view=rev
Log:
- Add samplify runonce.exe utility
Added:
trunk/reactos/base/system/runonce/ (with props)
trunk/reactos/base/system/runonce/lang/ (with props)
trunk/reactos/base/system/runonce/lang/en-US.rc (with props)
trunk/reactos/base/system/runonce/lang/ru-RU.rc (with props)
trunk/reactos/base/system/runonce/res/ (with props)
trunk/reactos/base/system/runonce/res/icon.ico (with props)
trunk/reactos/base/system/runonce/resource.h (with props)
trunk/reactos/base/system/runonce/rsrc.rc (with props)
trunk/reactos/base/system/runonce/runonce.c (with props)
trunk/reactos/base/system/runonce/runonce.h (with props)
trunk/reactos/base/system/runonce/runonce.rbuild (with props)
trunk/reactos/base/system/runonce/runonce.rc (with props)
Modified:
trunk/reactos/base/system/system.rbuild
Propchange: trunk/reactos/base/system/runonce/
------------------------------------------------------------------------------
--- bugtraq:logregex (added)
+++ bugtraq:logregex Sat Oct 24 14:58:07 2009
@@ -1,0 +1,2 @@
+([Ii]ssue|[Bb]ug)s? #?(\d+)(,? ?#?(\d+))*(,? ?(and |or )?#?(\d+))?
+(\d+)
Propchange: trunk/reactos/base/system/runonce/
------------------------------------------------------------------------------
bugtraq:message = See issue #%BUGID% for more details.
Propchange: trunk/reactos/base/system/runonce/
------------------------------------------------------------------------------
bugtraq:url =
http://www.reactos.org/bugzilla/show_bug.cgi?id=%BUGID%
Propchange: trunk/reactos/base/system/runonce/
------------------------------------------------------------------------------
tsvn:logminsize = 10
Propchange: trunk/reactos/base/system/runonce/lang/
------------------------------------------------------------------------------
--- bugtraq:logregex (added)
+++ bugtraq:logregex Sat Oct 24 14:58:07 2009
@@ -1,0 +1,2 @@
+([Ii]ssue|[Bb]ug)s? #?(\d+)(,? ?#?(\d+))*(,? ?(and |or )?#?(\d+))?
+(\d+)
Propchange: trunk/reactos/base/system/runonce/lang/
------------------------------------------------------------------------------
bugtraq:message = See issue #%BUGID% for more details.
Propchange: trunk/reactos/base/system/runonce/lang/
------------------------------------------------------------------------------
bugtraq:url =
http://www.reactos.org/bugzilla/show_bug.cgi?id=%BUGID%
Propchange: trunk/reactos/base/system/runonce/lang/
------------------------------------------------------------------------------
tsvn:logminsize = 10
Added: trunk/reactos/base/system/runonce/lang/en-US.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/system/runonce/lang/e…
==============================================================================
--- trunk/reactos/base/system/runonce/lang/en-US.rc (added)
+++ trunk/reactos/base/system/runonce/lang/en-US.rc [iso-8859-1] Sat Oct 24 14:58:07 2009
@@ -1,0 +1,11 @@
+LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
+
+IDD_RUNONCE_DLG DIALOG DISCARDABLE 0, 0, 239, 170
+STYLE DS_SHELLFONT | DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
+CAPTION "ReactOS Setup"
+FONT 8, "MS Shell Dlg"
+BEGIN
+ LTEXT "ReactOS is now setting up the following items:", -1, 38, 8, 196, 18
+ LISTBOX IDC_COMP_LIST, 36, 32, 197, 131, LBS_OWNERDRAWVARIABLE | LBS_NOINTEGRALHEIGHT |
WS_VSCROLL | WS_TABSTOP
+ ICON IDI_ICON, -1, 5, 6, 21, 20
+END
Propchange: trunk/reactos/base/system/runonce/lang/en-US.rc
------------------------------------------------------------------------------
svn:eol-style = native
Added: trunk/reactos/base/system/runonce/lang/ru-RU.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/system/runonce/lang/r…
==============================================================================
--- trunk/reactos/base/system/runonce/lang/ru-RU.rc (added)
+++ trunk/reactos/base/system/runonce/lang/ru-RU.rc [iso-8859-1] Sat Oct 24 14:58:07 2009
@@ -1,0 +1,11 @@
+LANGUAGE LANG_RUSSIAN, SUBLANG_DEFAULT
+
+IDD_RUNONCE_DLG DIALOG DISCARDABLE 0, 0, 239, 170
+STYLE DS_SHELLFONT | DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
+CAPTION "Óñòàíîâêà ReactOS"
+FONT 8, "MS Shell Dlg"
+BEGIN
+ LTEXT "ReactOS íàñòðàèâàåò ñëåäóþùèå êîìïîíåíòû:", -1, 38, 8, 196, 18
+ LISTBOX IDC_COMP_LIST, 36, 32, 197, 131, LBS_OWNERDRAWVARIABLE | LBS_NOINTEGRALHEIGHT |
WS_VSCROLL | WS_TABSTOP
+ ICON IDI_ICON, -1, 5, 6, 21, 20
+END
Propchange: trunk/reactos/base/system/runonce/lang/ru-RU.rc
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: trunk/reactos/base/system/runonce/res/
------------------------------------------------------------------------------
--- bugtraq:logregex (added)
+++ bugtraq:logregex Sat Oct 24 14:58:07 2009
@@ -1,0 +1,2 @@
+([Ii]ssue|[Bb]ug)s? #?(\d+)(,? ?#?(\d+))*(,? ?(and |or )?#?(\d+))?
+(\d+)
Propchange: trunk/reactos/base/system/runonce/res/
------------------------------------------------------------------------------
bugtraq:message = See issue #%BUGID% for more details.
Propchange: trunk/reactos/base/system/runonce/res/
------------------------------------------------------------------------------
bugtraq:url =
http://www.reactos.org/bugzilla/show_bug.cgi?id=%BUGID%
Propchange: trunk/reactos/base/system/runonce/res/
------------------------------------------------------------------------------
tsvn:logminsize = 10
Added: trunk/reactos/base/system/runonce/res/icon.ico
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/system/runonce/res/ic…
==============================================================================
Binary file - no diff available.
Propchange: trunk/reactos/base/system/runonce/res/icon.ico
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: trunk/reactos/base/system/runonce/resource.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/system/runonce/resour…
==============================================================================
--- trunk/reactos/base/system/runonce/resource.h (added)
+++ trunk/reactos/base/system/runonce/resource.h [iso-8859-1] Sat Oct 24 14:58:07 2009
@@ -1,0 +1,10 @@
+#ifndef _RESOURCE_H__
+#define _RESOURCE_H__
+
+#define IDI_ICON 10
+
+#define IDD_RUNONCE_DLG 100
+
+#define IDC_COMP_LIST 1000
+
+#endif /* _RESOURCE_H__ */
Propchange: trunk/reactos/base/system/runonce/resource.h
------------------------------------------------------------------------------
svn:eol-style = native
Added: trunk/reactos/base/system/runonce/rsrc.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/system/runonce/rsrc.r…
==============================================================================
--- trunk/reactos/base/system/runonce/rsrc.rc (added)
+++ trunk/reactos/base/system/runonce/rsrc.rc [iso-8859-1] Sat Oct 24 14:58:07 2009
@@ -1,0 +1,2 @@
+#include "lang/en-US.rc"
+#include "lang/ru-RU.rc"
Propchange: trunk/reactos/base/system/runonce/rsrc.rc
------------------------------------------------------------------------------
svn:eol-style = native
Added: trunk/reactos/base/system/runonce/runonce.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/system/runonce/runonc…
==============================================================================
--- trunk/reactos/base/system/runonce/runonce.c (added)
+++ trunk/reactos/base/system/runonce/runonce.c [iso-8859-1] Sat Oct 24 14:58:07 2009
@@ -1,0 +1,180 @@
+/*
+ * COPYRIGHT: See COPYING in the top level directory
+ * PROJECT: ReactOS runonce.exe
+ * FILE: base/system/runonce/runonce.c
+ * PROGRAMMER: Dmitry Chapyshev (dmitry(a)reactos.org)
+ */
+
+#include "runonce.h"
+
+
+static
+DWORD
+WINAPI
+StartApplication(LPVOID lpDlg)
+{
+ HWND hList = GetDlgItem((HWND)lpDlg, IDC_COMP_LIST);
+ INT Index, Count = SendMessage(hList, LB_GETCOUNT, 0, 0);
+ PROCESS_INFORMATION pi;
+ STARTUPINFOW si;
+ TCHAR szData[MAX_PATH];
+
+ for (Index = 0; Index < Count; Index++)
+ {
+ SendMessage(hList, LB_GETTEXT, Index, (LPARAM)szData);
+
+ ZeroMemory(&si, sizeof(si));
+ si.cb = sizeof(si);
+ si.wShowWindow = SW_SHOW;
+
+ if (!CreateProcess(NULL, szData, NULL, NULL, FALSE, 0, NULL, NULL, &si,
&pi))
+ continue;
+
+ WaitForSingleObjectEx(pi.hProcess, INFINITE, TRUE);
+
+ CloseHandle(pi.hProcess);
+ CloseHandle(pi.hThread);
+ }
+
+ RegDeleteKey(HKEY_LOCAL_MACHINE,
+
_T("SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\RunOnce\\Setup"));
+
+ PostMessage((HWND)lpDlg, WM_CLOSE, 0, 0);
+
+ return 0;
+}
+
+static
+VOID
+InitDialog(HWND hDlg)
+{
+ TCHAR szAppPath[MAX_PATH], szData[MAX_PATH];
+ DWORD dwIndex, dwSize, dwType, dwData, dwThreadId;
+ HKEY hKey;
+
+ if (RegOpenKeyEx(HKEY_LOCAL_MACHINE,
+
_T("SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\RunOnce\\Setup"),
+ 0,
+ KEY_QUERY_VALUE,
+ &hKey) == ERROR_SUCCESS)
+ {
+ for (dwIndex = 0; ; dwIndex++)
+ {
+ dwSize = sizeof(szAppPath);
+ dwData = sizeof(szData) / sizeof(TCHAR);
+
+ if (RegEnumValue(hKey,
+ dwIndex,
+ szAppPath,
+ &dwSize,
+ NULL,
+ &dwType,
+ (LPBYTE)szData,
+ &dwData) == ERROR_SUCCESS)
+ {
+ if (dwType != REG_SZ) continue;
+
+ SendMessage(GetDlgItem(hDlg, IDC_COMP_LIST), LB_ADDSTRING, 0,
(LPARAM)szData);
+ }
+ }
+
+ RegCloseKey(hKey);
+ }
+
+ CloseHandle(CreateThread(NULL,
+ 0,
+ StartApplication,
+ (LPVOID)hDlg,
+ 0,
+ &dwThreadId));
+}
+
+static
+INT_PTR
+CALLBACK
+RunOnceDlgProc(HWND hDlg, UINT Msg, WPARAM wParam, LPARAM lParam)
+{
+ switch (Msg)
+ {
+ case WM_INITDIALOG:
+ InitDialog(hDlg);
+ break;
+
+ case WM_CLOSE:
+ EndDialog(hDlg, 0);
+ break;
+ }
+
+ return 0;
+}
+
+INT
+WINAPI
+_tWinMain(HINSTANCE hInst, HINSTANCE hPrevInst, LPTSTR lpCmdLine, INT nCmdShow)
+{
+ LPCTSTR lpCmd = GetCommandLine();
+ TCHAR szAppPath[MAX_PATH], szData[MAX_PATH];
+ DWORD dwIndex, dwSize, dwType, dwData;
+ PROCESS_INFORMATION pi;
+ STARTUPINFOW si;
+ BOOL bRunApps = FALSE;
+ HKEY hKey;
+
+ while (*lpCmd)
+ {
+ while (*lpCmd && *lpCmd != _T('/') && *lpCmd !=
_T('-')) lpCmd++;
+ if (!*lpCmd) break;
+ if (*++lpCmd == _T('r')) bRunApps = TRUE;
+ lpCmd++;
+ }
+
+ if (bRunApps)
+ {
+ if (RegOpenKeyEx(HKEY_LOCAL_MACHINE,
+
_T("SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\RunOnce"),
+ 0,
+ KEY_QUERY_VALUE,
+ &hKey) == ERROR_SUCCESS)
+ {
+ for (dwIndex = 0; ; dwIndex++)
+ {
+ dwSize = sizeof(szAppPath);
+ dwData = sizeof(szData) / sizeof(TCHAR);
+
+ if (RegEnumValue(hKey,
+ dwIndex,
+ szAppPath,
+ &dwSize,
+ NULL,
+ &dwType,
+ (LPBYTE)szData,
+ &dwData) == ERROR_SUCCESS)
+ {
+ RegDeleteValue(hKey, szAppPath);
+
+ if (dwType != REG_SZ) continue;
+
+ ZeroMemory(&si, sizeof(si));
+ si.cb = sizeof(si);
+ si.wShowWindow = SW_SHOW;
+
+ if (!CreateProcess(NULL, szData, NULL, NULL, FALSE, 0, NULL, NULL,
&si, &pi))
+ continue;
+
+ WaitForSingleObjectEx(pi.hProcess, INFINITE, TRUE);
+
+ CloseHandle(pi.hProcess);
+ CloseHandle(pi.hThread);
+ }
+ }
+
+ RegCloseKey(hKey);
+ }
+
+ return 1;
+ }
+
+ DialogBox(hInst, MAKEINTRESOURCE(IDD_RUNONCE_DLG), NULL, RunOnceDlgProc);
+
+ return 0;
+}
Propchange: trunk/reactos/base/system/runonce/runonce.c
------------------------------------------------------------------------------
svn:eol-style = native
Added: trunk/reactos/base/system/runonce/runonce.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/system/runonce/runonc…
==============================================================================
--- trunk/reactos/base/system/runonce/runonce.h (added)
+++ trunk/reactos/base/system/runonce/runonce.h [iso-8859-1] Sat Oct 24 14:58:07 2009
@@ -1,0 +1,9 @@
+#ifndef _RUNONCE_H__
+#define _RUNONCE_H__
+
+#include <windows.h>
+#include <tchar.h>
+
+#include "resource.h"
+
+#endif /* _RUNONCE_H__ */
Propchange: trunk/reactos/base/system/runonce/runonce.h
------------------------------------------------------------------------------
svn:eol-style = native
Added: trunk/reactos/base/system/runonce/runonce.rbuild
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/system/runonce/runonc…
==============================================================================
--- trunk/reactos/base/system/runonce/runonce.rbuild (added)
+++ trunk/reactos/base/system/runonce/runonce.rbuild [iso-8859-1] Sat Oct 24 14:58:07
2009
@@ -1,0 +1,8 @@
+<module name="runonce" type="win32gui"
installbase="system32" installname="runonce.exe"
unicode="yes">
+ <include base="runonce">.</include>
+ <library>advapi32</library>
+ <library>kernel32</library>
+ <library>user32</library>
+ <file>runonce.c</file>
+ <file>runonce.rc</file>
+</module>
Propchange: trunk/reactos/base/system/runonce/runonce.rbuild
------------------------------------------------------------------------------
svn:eol-style = native
Added: trunk/reactos/base/system/runonce/runonce.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/system/runonce/runonc…
==============================================================================
--- trunk/reactos/base/system/runonce/runonce.rc (added)
+++ trunk/reactos/base/system/runonce/runonce.rc [iso-8859-1] Sat Oct 24 14:58:07 2009
@@ -1,0 +1,12 @@
+#include "runonce.h"
+
+#define REACTOS_STR_FILE_DESCRIPTION "ReactOS Run Once Wrapper\0"
+#define REACTOS_STR_INTERNAL_NAME "runonce\0"
+#define REACTOS_STR_ORIGINAL_FILENAME "runonce.exe\0"
+#include <reactos/version.rc>
+
+LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL
+
+IDI_ICON ICON DISCARDABLE "res/icon.ico"
+
+#include "rsrc.rc"
Propchange: trunk/reactos/base/system/runonce/runonce.rc
------------------------------------------------------------------------------
svn:eol-style = native
Modified: trunk/reactos/base/system/system.rbuild
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/system/system.rbuild?…
==============================================================================
--- trunk/reactos/base/system/system.rbuild [iso-8859-1] (original)
+++ trunk/reactos/base/system/system.rbuild [iso-8859-1] Sat Oct 24 14:58:07 2009
@@ -25,6 +25,9 @@
<directory name="rundll32">
<xi:include href="rundll32/rundll32.rbuild" />
</directory>
+ <directory name="runonce">
+ <xi:include href="runonce/runonce.rbuild" />
+ </directory>
<directory name="services">
<xi:include href="services/services.rbuild" />
</directory>