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)
18 * Unicode and redirection safe!
20 * 26-Feb-1999 (Eric Kohl)
21 * New version info and some output changes.
25 #include <reactos/buildno.h>
26 #include <reactos/version.h>
28 VOID
ShortVersion (VOID
)
30 OSVERSIONINFO VersionInfo
;
32 ConOutResPrintf(STRING_CMD_SHELLINFO
, _T(KERNEL_RELEASE_STR
), _T(KERNEL_VERSION_BUILD_STR
));
33 VersionInfo
.dwOSVersionInfoSize
= sizeof(OSVERSIONINFO
);
35 memset(VersionInfo
.szCSDVersion
, 0, sizeof(VersionInfo
.szCSDVersion
));
36 if (GetVersionEx(&VersionInfo
))
41 RosVersion
= VersionInfo
.szCSDVersion
+ _tcslen(VersionInfo
.szCSDVersion
) + 1;
42 RosVersionLen
= sizeof(VersionInfo
.szCSDVersion
) / sizeof(VersionInfo
.szCSDVersion
[0]) -
43 (RosVersion
- VersionInfo
.szCSDVersion
);
44 if (7 <= RosVersionLen
&& 0 == _tcsnicmp(RosVersion
, _T("ReactOS"), 7))
46 ConOutResPrintf(STRING_VERSION_RUNVER
, RosVersion
);
53 #ifdef INCLUDE_CMD_VER
56 * display shell version info internal command.
58 INT
cmd_ver (LPTSTR param
)
64 if (_tcsstr (param
, _T("/?")) != NULL
)
66 ConOutResPaging(TRUE
,STRING_VERSION_HELP1
);
72 /* Basic copyright notice */
73 if (param
[0] != _T('\0'))
75 ConOutPuts(_T("Copyright (C) 1994-1998 Tim Norman and others.\n"));
76 ConOutPuts(_T("Copyright (C) 1998-") _T(COPYRIGHT_YEAR
) _T(" ReactOS Team\n"));
78 for (i
= 0; param
[i
]; i
++)
81 if (param
[i
] == _T(' '))
84 if (param
[i
] == _T('/'))
86 /* is this a lone '/' ? */
87 if (param
[i
+ 1] == 0)
89 error_invalid_switch (_T(' '));
95 if (_totupper (param
[i
]) == _T('W'))
98 ConOutResPuts(STRING_VERSION_HELP3
);
100 else if (_totupper (param
[i
]) == _T('R'))
102 /* Redistribution notice */
103 ConOutResPuts(STRING_VERSION_HELP4
);
105 else if (_totupper (param
[i
]) == _T('C'))
107 /* Developer listing */
108 ConOutResPuts(STRING_VERSION_HELP6
);
109 ConOutResPuts(STRING_FREEDOS_DEV
);
110 ConOutResPuts(STRING_VERSION_HELP7
);
111 ConOutResPuts(STRING_REACTOS_DEV
);
115 error_invalid_switch ((TCHAR
)_totupper (param
[i
]));
119 ConOutResPuts(STRING_VERSION_HELP5
);