2 * VER.C - ver internal command.
8 * rewrote ver command to accept switches, now ver alone prints
9 * copyright notice only.
11 * 27-Jul-1998 (John P Price <linux-guru@gcfl.net>)
12 * added config.h include
14 * 30-Jul-1998 (John P Price <linux-guru@gcfl.net>)
15 * added text about where to send bug reports and get updates.
17 * 20-Jan-1999 (Eric Kohl <ekohl@abo.rhein-zeitung.de>)
18 * Unicode and redirection safe!
20 * 26-Feb-1999 (Eric Kohl <ekohl@abo.rhein-zeitung.de>)
21 * New version info and some output changes.
28 VOID
ShortVersion (VOID
)
30 OSVERSIONINFO VersionInfo
;
31 unsigned RosVersionLen
;
36 VersionInfo
.dwOSVersionInfoSize
= sizeof(OSVERSIONINFO
);
38 ConOutPrintf(_T("%S"), SHELLVER
);
40 ConOutPrintf(_T("%s"), SHELLVER
);
42 memset(VersionInfo
.szCSDVersion
, 0, sizeof(VersionInfo
.szCSDVersion
));
43 if (GetVersionEx(&VersionInfo
))
45 RosVersion
= VersionInfo
.szCSDVersion
+ _tcslen(VersionInfo
.szCSDVersion
) + 1;
46 RosVersionLen
= sizeof(VersionInfo
.szCSDVersion
) / sizeof(VersionInfo
.szCSDVersion
[0]) -
47 (RosVersion
- VersionInfo
.szCSDVersion
);
48 if (7 <= RosVersionLen
&& 0 == _tcsnicmp(RosVersion
, _T("ReactOS"), 7))
50 ConOutPrintf(_T(" running on %s"), RosVersion
);
53 ConOutPuts (_T("\n"));
57 #ifdef INCLUDE_CMD_VER
60 * display shell version info internal command.
64 INT
cmd_ver (LPTSTR cmd
, LPTSTR param
)
68 if (_tcsstr (param
, _T("/?")) != NULL
)
70 ConOutResPuts(STRING_VERSION_HELP1
);
75 ConOutPuts (_T("Copyright (C) 1994-1998 Tim Norman and others."));
76 ConOutPuts (_T("Copyright (C) 1998-2005 Eric Kohl and others."));
78 /* Basic copyright notice */
79 if (param
[0] == _T('\0'))
81 ConOutPuts(_T("\n"SHELLINFO
));
82 ConOutResPuts(STRING_VERSION_HELP2
);
86 for (i
= 0; param
[i
]; i
++)
89 if (param
[i
] == _T(' '))
92 if (param
[i
] == _T('/'))
94 /* is this a lone '/' ? */
95 if (param
[i
+ 1] == 0)
97 error_invalid_switch (_T(' '));
103 if (_totupper (param
[i
]) == _T('W'))
105 /* Warranty notice */
106 ConOutResPuts(STRING_VERSION_HELP3
);
108 else if (_totupper (param
[i
]) == _T('R'))
110 /* Redistribution notice */
111 ConOutResPuts(STRING_VERSION_HELP4
);
113 else if (_totupper (param
[i
]) == _T('C'))
115 /* Developer listing */
116 ConOutResPuts(STRING_VERSION_HELP6
);
117 ConOutResPuts(STRING_FREEDOS_DEV
);
118 ConOutResPuts(STRING_VERSION_HELP7
);
119 ConOutResPuts(STRING_REACTOS_DEV
);
123 error_invalid_switch ((TCHAR
)_totupper (param
[i
]));
129 ConOutResPuts(STRING_VERSION_HELP5
);