Commit ba02ae41 authored by Dan Kegel's avatar Dan Kegel Committed by Alexandre Julliard

Added Windows-compatible start.exe.

parent 49e1b691
......@@ -15640,7 +15640,7 @@ MAKE_TEST_RULES=dlls/Maketest.rules
MAKE_PROG_RULES=programs/Makeprog.rules
ac_config_files="$ac_config_files Make.rules dlls/Makedll.rules dlls/Maketest.rules programs/Makeprog.rules Makefile dlls/Makefile dlls/advapi32/Makefile dlls/advapi32/tests/Makefile dlls/avicap32/Makefile dlls/avifil32/Makefile dlls/cabinet/Makefile dlls/comcat/Makefile dlls/comctl32/Makefile dlls/commdlg/Makefile dlls/crtdll/Makefile dlls/crypt32/Makefile dlls/ctl3d/Makefile dlls/d3d8/Makefile dlls/d3dx8/Makefile dlls/dciman32/Makefile dlls/ddraw/Makefile dlls/devenum/Makefile dlls/dinput/Makefile dlls/dinput8/Makefile dlls/dplay/Makefile dlls/dplayx/Makefile dlls/dsound/Makefile dlls/dsound/tests/Makefile dlls/gdi/Makefile dlls/gdi/tests/Makefile dlls/glu32/Makefile dlls/icmp/Makefile dlls/imagehlp/Makefile dlls/imm32/Makefile dlls/kernel/Makefile dlls/kernel/tests/Makefile dlls/lzexpand/Makefile dlls/mapi32/Makefile dlls/mpr/Makefile dlls/msacm/Makefile dlls/msacm/imaadp32/Makefile dlls/msacm/msadp32/Makefile dlls/msacm/msg711/Makefile dlls/msacm/winemp3/Makefile dlls/msdmo/Makefile dlls/msimg32/Makefile dlls/msisys/Makefile dlls/msnet32/Makefile dlls/msvcrt/Makefile dlls/msvcrt/tests/Makefile dlls/msvcrt20/Makefile dlls/msvideo/Makefile dlls/msvideo/msrle32/Makefile dlls/netapi32/Makefile dlls/netapi32/tests/Makefile dlls/ntdll/Makefile dlls/ntdll/tests/Makefile dlls/odbc32/Makefile dlls/ole32/Makefile dlls/oleaut32/Makefile dlls/oleaut32/tests/Makefile dlls/olecli/Makefile dlls/oledlg/Makefile dlls/olepro32/Makefile dlls/olesvr/Makefile dlls/opengl32/Makefile dlls/psapi/Makefile dlls/qcap/Makefile dlls/quartz/Makefile dlls/rasapi32/Makefile dlls/richedit/Makefile dlls/rpcrt4/Makefile dlls/rpcrt4/tests/Makefile dlls/serialui/Makefile dlls/setupapi/Makefile dlls/shdocvw/Makefile dlls/shell32/Makefile dlls/shell32/tests/Makefile dlls/shfolder/Makefile dlls/shlwapi/Makefile dlls/shlwapi/tests/Makefile dlls/snmpapi/Makefile dlls/sti/Makefile dlls/tapi32/Makefile dlls/ttydrv/Makefile dlls/twain/Makefile dlls/url/Makefile dlls/urlmon/Makefile dlls/urlmon/tests/Makefile dlls/user/Makefile dlls/user/tests/Makefile dlls/version/Makefile dlls/win32s/Makefile dlls/winaspi/Makefile dlls/winedos/Makefile dlls/wineps/Makefile dlls/wininet/Makefile dlls/wininet/tests/Makefile dlls/winmm/Makefile dlls/winmm/joystick/Makefile dlls/winmm/mcianim/Makefile dlls/winmm/mciavi/Makefile dlls/winmm/mcicda/Makefile dlls/winmm/mciseq/Makefile dlls/winmm/mciwave/Makefile dlls/winmm/midimap/Makefile dlls/winmm/tests/Makefile dlls/winmm/wavemap/Makefile dlls/winmm/winealsa/Makefile dlls/winmm/winearts/Makefile dlls/winmm/wineaudioio/Makefile dlls/winmm/winenas/Makefile dlls/winmm/winejack/Makefile dlls/winmm/wineoss/Makefile dlls/winnls/Makefile dlls/winsock/Makefile dlls/winsock/tests/Makefile dlls/winspool/Makefile dlls/winspool/tests/Makefile dlls/wintab32/Makefile dlls/wintrust/Makefile dlls/wow32/Makefile dlls/wsock32/Makefile dlls/x11drv/Makefile documentation/Makefile include/Makefile library/Makefile miscemu/Makefile ole/Makefile programs/Makefile programs/avitools/Makefile programs/clock/Makefile programs/cmdlgtst/Makefile programs/control/Makefile programs/expand/Makefile programs/notepad/Makefile programs/osversioncheck/Makefile programs/progman/Makefile programs/regapi/Makefile programs/regedit/Makefile programs/regsvr32/Makefile programs/regtest/Makefile programs/rpcss/Makefile programs/rundll32/Makefile programs/uninstaller/Makefile programs/view/Makefile programs/wcmd/Makefile programs/wineboot/Makefile programs/wineconsole/Makefile programs/winedbg/Makefile programs/winefile/Makefile programs/winemine/Makefile programs/winepath/Makefile programs/winhelp/Makefile programs/winver/Makefile server/Makefile tools/Makefile tools/widl/Makefile tools/winapi/Makefile tools/winebuild/Makefile tools/winedump/Makefile tools/wmc/Makefile tools/wpp/Makefile tools/wrc/Makefile unicode/Makefile"
ac_config_files="$ac_config_files Make.rules dlls/Makedll.rules dlls/Maketest.rules programs/Makeprog.rules Makefile dlls/Makefile dlls/advapi32/Makefile dlls/advapi32/tests/Makefile dlls/avicap32/Makefile dlls/avifil32/Makefile dlls/cabinet/Makefile dlls/comcat/Makefile dlls/comctl32/Makefile dlls/commdlg/Makefile dlls/crtdll/Makefile dlls/crypt32/Makefile dlls/ctl3d/Makefile dlls/d3d8/Makefile dlls/d3dx8/Makefile dlls/dciman32/Makefile dlls/ddraw/Makefile dlls/devenum/Makefile dlls/dinput/Makefile dlls/dinput8/Makefile dlls/dplay/Makefile dlls/dplayx/Makefile dlls/dsound/Makefile dlls/dsound/tests/Makefile dlls/gdi/Makefile dlls/gdi/tests/Makefile dlls/glu32/Makefile dlls/icmp/Makefile dlls/imagehlp/Makefile dlls/imm32/Makefile dlls/kernel/Makefile dlls/kernel/tests/Makefile dlls/lzexpand/Makefile dlls/mapi32/Makefile dlls/mpr/Makefile dlls/msacm/Makefile dlls/msacm/imaadp32/Makefile dlls/msacm/msadp32/Makefile dlls/msacm/msg711/Makefile dlls/msacm/winemp3/Makefile dlls/msdmo/Makefile dlls/msimg32/Makefile dlls/msisys/Makefile dlls/msnet32/Makefile dlls/msvcrt/Makefile dlls/msvcrt/tests/Makefile dlls/msvcrt20/Makefile dlls/msvideo/Makefile dlls/msvideo/msrle32/Makefile dlls/netapi32/Makefile dlls/netapi32/tests/Makefile dlls/ntdll/Makefile dlls/ntdll/tests/Makefile dlls/odbc32/Makefile dlls/ole32/Makefile dlls/oleaut32/Makefile dlls/oleaut32/tests/Makefile dlls/olecli/Makefile dlls/oledlg/Makefile dlls/olepro32/Makefile dlls/olesvr/Makefile dlls/opengl32/Makefile dlls/psapi/Makefile dlls/qcap/Makefile dlls/quartz/Makefile dlls/rasapi32/Makefile dlls/richedit/Makefile dlls/rpcrt4/Makefile dlls/rpcrt4/tests/Makefile dlls/serialui/Makefile dlls/setupapi/Makefile dlls/shdocvw/Makefile dlls/shell32/Makefile dlls/shell32/tests/Makefile dlls/shfolder/Makefile dlls/shlwapi/Makefile dlls/shlwapi/tests/Makefile dlls/snmpapi/Makefile dlls/sti/Makefile dlls/tapi32/Makefile dlls/ttydrv/Makefile dlls/twain/Makefile dlls/url/Makefile dlls/urlmon/Makefile dlls/urlmon/tests/Makefile dlls/user/Makefile dlls/user/tests/Makefile dlls/version/Makefile dlls/win32s/Makefile dlls/winaspi/Makefile dlls/winedos/Makefile dlls/wineps/Makefile dlls/wininet/Makefile dlls/wininet/tests/Makefile dlls/winmm/Makefile dlls/winmm/joystick/Makefile dlls/winmm/mcianim/Makefile dlls/winmm/mciavi/Makefile dlls/winmm/mcicda/Makefile dlls/winmm/mciseq/Makefile dlls/winmm/mciwave/Makefile dlls/winmm/midimap/Makefile dlls/winmm/tests/Makefile dlls/winmm/wavemap/Makefile dlls/winmm/winealsa/Makefile dlls/winmm/winearts/Makefile dlls/winmm/wineaudioio/Makefile dlls/winmm/winenas/Makefile dlls/winmm/winejack/Makefile dlls/winmm/wineoss/Makefile dlls/winnls/Makefile dlls/winsock/Makefile dlls/winsock/tests/Makefile dlls/winspool/Makefile dlls/winspool/tests/Makefile dlls/wintab32/Makefile dlls/wintrust/Makefile dlls/wow32/Makefile dlls/wsock32/Makefile dlls/x11drv/Makefile documentation/Makefile include/Makefile library/Makefile miscemu/Makefile ole/Makefile programs/Makefile programs/avitools/Makefile programs/clock/Makefile programs/cmdlgtst/Makefile programs/control/Makefile programs/expand/Makefile programs/notepad/Makefile programs/osversioncheck/Makefile programs/progman/Makefile programs/regapi/Makefile programs/regedit/Makefile programs/regsvr32/Makefile programs/regtest/Makefile programs/rpcss/Makefile programs/rundll32/Makefile programs/start/Makefile programs/uninstaller/Makefile programs/view/Makefile programs/wcmd/Makefile programs/wineboot/Makefile programs/wineconsole/Makefile programs/winedbg/Makefile programs/winefile/Makefile programs/winemine/Makefile programs/winepath/Makefile programs/winhelp/Makefile programs/winver/Makefile server/Makefile tools/Makefile tools/widl/Makefile tools/winapi/Makefile tools/winebuild/Makefile tools/winedump/Makefile tools/wmc/Makefile tools/wpp/Makefile tools/wrc/Makefile unicode/Makefile"
cat >confcache <<\_ACEOF
......@@ -16314,6 +16314,7 @@ do
"programs/regtest/Makefile" ) CONFIG_FILES="$CONFIG_FILES programs/regtest/Makefile" ;;
"programs/rpcss/Makefile" ) CONFIG_FILES="$CONFIG_FILES programs/rpcss/Makefile" ;;
"programs/rundll32/Makefile" ) CONFIG_FILES="$CONFIG_FILES programs/rundll32/Makefile" ;;
"programs/start/Makefile" ) CONFIG_FILES="$CONFIG_FILES programs/start/Makefile" ;;
"programs/uninstaller/Makefile" ) CONFIG_FILES="$CONFIG_FILES programs/uninstaller/Makefile" ;;
"programs/view/Makefile" ) CONFIG_FILES="$CONFIG_FILES programs/view/Makefile" ;;
"programs/wcmd/Makefile" ) CONFIG_FILES="$CONFIG_FILES programs/wcmd/Makefile" ;;
......
......@@ -1520,6 +1520,7 @@ programs/regsvr32/Makefile
programs/regtest/Makefile
programs/rpcss/Makefile
programs/rundll32/Makefile
programs/start/Makefile
programs/uninstaller/Makefile
programs/view/Makefile
programs/wcmd/Makefile
......
......@@ -19,6 +19,7 @@ SUBDIRS = \
regtest \
rpcss \
rundll32 \
start \
uninstaller \
view \
wcmd \
......@@ -43,6 +44,7 @@ INSTALLSUBDIRS = \
regsvr32 \
rpcss \
rundll32 \
start \
uninstaller \
wcmd \
wineboot \
......
Makefile
rsrc.res
start.exe.dbg.c
start.exe.spec.c
/*
* Start
* English Language Support
*
* Copyright 2003 Dan Kegel
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
#pragma code_page(850)
STRINGTABLE DISCARDABLE LANGUAGE LANG_ENGLISH, SUBLANG_DEFAULT
{
STRING_USAGE, "Start a program, or open a document in the program normally used for files with that suffix. \n\
Usage: \n\
start [options] program_filename [...] \n\
start [options] document_filename \n\
\n\
Options: \n\
/M[inimized] Start the program minimized. \n\
/MAX[imized] Start the program maximized. \n\
/R[estored] Start the program normally (neither minimized nor maximized). \n\
/W[ait] Wait for started program to finish, then exit with its exit code. \n\
/L Show end-user license. \n\
\n\
start.exe version 0.2 Copyright (C) 2003, Dan Kegel \n\
Start comes with ABSOLUTELY NO WARRANTY; for details run with /L option. \n\
This is free software, and you are welcome to redistribute it \n\
under certain conditions; run 'start /L' for details. \n\
"
STRING_LICENSE, "start.exe version 0.2 Copyright (C) 2003, Dan Kegel \n\
This program is free software; you can redistribute it and/or \n\
modify it under the terms of the GNU Lesser Public License \n\
as published by the Free Software Foundation; either version 2.1 \n\
of the License, or (at your option) any later version. \n\
\n\
This program is distributed in the hope that it will be useful, \n\
but WITHOUT ANY WARRANTY; without even the implied warranty of \n\
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the \n\
GNU Lesser Public License for more details. \n\
\n\
You should have received a copy of the GNU Lesser Public License \n\
along with this program; if not, write to the Free Software \n\
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. \n\
\n\
See the COPYING.LIB file for license information. \n\
"
STRING_EXECFAIL "Application could not be started, or no application associated with the specified file.\nShellExecuteEx failed"
}
TOPSRCDIR = @top_srcdir@
TOPOBJDIR = ../..
SRCDIR = @srcdir@
VPATH = @srcdir@
MODULE = start.exe
APPMODE = cui
IMPORTS = shell32 user32 kernel32
C_SRCS = start.c
RC_SRCS = rsrc.rc
@MAKE_PROG_RULES@
### Dependencies:
/*
* Resource id definitions
*
* Copyright 2003 Dan Kegel
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#define STRING_USAGE 101
#define STRING_LICENSE 102
#define STRING_EXECFAIL 103
/*
* Copyright 2003 Dan Kegel
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include <windows.h>
#include "resources.h"
LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL
#include "En.rc"
/*
* Start a program using ShellExecuteEx, optionally wait for it to finish
* Compatible with Microsoft's "c:\windows\command\start.exe"
*
* Copyright 2003 Dan Kegel
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include <windows.h>
#include <winuser.h>
#include <stdio.h>
#include <stdlib.h>
#include <shlobj.h>
#include "resources.h"
/**
Output given message to stdout without formatting.
*/
static void output(const char *message)
{
DWORD count;
WriteFile(GetStdHandle(STD_OUTPUT_HANDLE), message, strlen(message), &count, NULL);
}
/**
Output given message,
followed by ": ",
followed by description of given GetLastError() value to stdout,
followed by a trailing newline,
then terminate.
*/
static void fatal_error(const char *msg, DWORD error_code)
{
LPVOID lpMsgBuf;
int status;
output(msg);
output(": ");
status = FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM, NULL, error_code, 0, (LPTSTR) & lpMsgBuf, 0, NULL);
if (!status) {
output("FormatMessage failed\n");
} else {
output(lpMsgBuf);
LocalFree((HLOCAL) lpMsgBuf);
output("\n");
}
ExitProcess(1);
}
/**
Output given message from string table,
followed by ": ",
followed by description of given GetLastError() value to stdout,
followed by a trailing newline,
then terminate.
*/
static void fatal_string_error(int which, DWORD error_code)
{
char msg[2048];
if (!LoadString(GetModuleHandle(NULL), which,
msg, sizeof(msg)))
fatal_error("LoadString failed", GetLastError());
fatal_error(msg, error_code);
}
static void fatal_string(int which)
{
char msg[2048];
if (!LoadString(GetModuleHandle(NULL), which,
msg, sizeof(msg)))
fatal_error("LoadString failed", GetLastError());
output(msg);
ExitProcess(1);
}
static void usage()
{
fatal_string(STRING_USAGE);
}
static void license()
{
fatal_string(STRING_LICENSE);
}
int main(int argc, char *argv[])
{
char arguments[MAX_PATH];
char *p;
SHELLEXECUTEINFO sei;
int argi;
memset(&sei, 0, sizeof(sei));
sei.cbSize = sizeof(sei);
sei.lpVerb = "open";
sei.nShow = SW_SHOWNORMAL;
/* Dunno what these mean, but it looks like winMe's start uses them */
sei.fMask = SEE_MASK_FLAG_DDEWAIT|SEE_MASK_FLAG_NO_UI;
/* Canonical Microsoft commandline flag processing:
* flags start with /, are case insensitive,
* and may be run together in same word.
*/
for (argi=1; argi<argc; argi++) {
int ci;
if (argv[argi][0] != '/')
break;
/* Handle all options in this word */
for (ci=0; argv[argi][ci]; ) {
/* Skip slash */
ci++;
switch(argv[argi][ci]) {
case 'l':
case 'L':
license();
break; /* notreached */
case 'm':
case 'M':
if (argv[argi][ci+1] == 'a' || argv[argi][ci+1] == 'A')
sei.nShow = SW_SHOWMAXIMIZED;
else
sei.nShow = SW_SHOWMINIMIZED;
break;
case 'r':
case 'R':
/* sei.nShow = SW_SHOWNORMAL; */
break;
case 'w':
case 'W':
sei.fMask |= SEE_MASK_NOCLOSEPROCESS;
break;
default:
printf("Option '%s' not recognized\n", argv[argi]+ci-1);
usage();
}
/* Skip to next slash */
while (argv[argi][ci] && (argv[argi][ci] != '/'))
ci++;
}
}
if (argi == argc)
usage();
sei.lpFile = argv[argi++];
/* FIXME - prone to overflow */
arguments[0] = 0;
for (p = arguments; argi < argc; argi++)
p += sprintf(p, " %s", argv[argi]);
sei.lpParameters = arguments;
if (!ShellExecuteEx(&sei))
fatal_string_error(STRING_EXECFAIL, GetLastError());
if (sei.fMask & SEE_MASK_NOCLOSEPROCESS) {
DWORD exitcode;
DWORD waitcode;
waitcode = WaitForSingleObject(sei.hProcess, INFINITE);
if (waitcode)
fatal_error("WaitForSingleObject", GetLastError());
if (!GetExitCodeProcess(sei.hProcess, &exitcode))
fatal_error("GetExitCodeProcess", GetLastError());
/* fixme: haven't tested whether exit code works properly */
ExitProcess(exitcode);
}
ExitProcess(0);
}
......@@ -101,6 +101,7 @@ function conf_string_answer {
function create_windows_directories {
for tdir in "$CROOT/windows" "$CROOT/windows/system" \
"$CROOT/windows/command" \
"$CROOT/windows/Start Menu" "$CROOT/windows/Start Menu/Programs" \
"$CROOT/Program Files" "$CROOT/Program Files/Common Files" \
"$CROOT/windows/Profiles" "$CROOT/windows/Profiles/Administrator" \
......@@ -129,6 +130,7 @@ function link_app {
#puts windows applications replacements to windows directories,
#configures them
function configure_wine_applications {
link_app start "$CROOT/windows/command/start.exe"
link_app notepad "$CROOT/windows/notepad.exe"
link_app regedit "$CROOT/windows/regedit.exe"
link_app rundll32 "$CROOT/windows/rundll32.exe"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment