Preliminary ManifestSupportedOS and WinVer.nsh Win10 support

git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@6558 212acab6-be3b-0410-9dea-997c60f758d6
This commit is contained in:
anders_k 2014-10-21 23:13:26 +00:00
parent eb5d77214a
commit 46ac05004d
6 changed files with 46 additions and 13 deletions

View file

@ -291,7 +291,7 @@ See \W{http://msdn.microsoft.com/en-us/library/dd464660}{MSDN} for more informat
\S2{amanifestsupportedos} ManifestSupportedOS
\c none|all|WinVista|\\<b\\>Win7|Win8|Win8.1\\</b\\>|{GUID} [...]
\c none|all|WinVista|\\<b\\>Win7|Win8|Win8.1\\</b\\>|Win10|{GUID} [...]
Declare that the installer is compatible with the specified Windows version(s). This adds a SupportedOS entry in the compatibility section of the application manifest. The default list of Win7+Win8+Win8.1 will probably be updated to include newer Windows versions in the future. \e{none} is the default if \R{arequestexecutionlevel}{RequestExecutionLevel} is set to \e{none} for compatibility reasons.

View file

@ -1,5 +1,19 @@
\A{history} Changelog and Release Notes
\H{v3.0b2} 3.0 Beta 2
Released on ?, 201?
\S1{v3.0b2-rl} Release Notes
\b ?
\S1{v3.0b2-cl} Changelog
\S2{} Minor Changes
\b Windows 10 support
\H{v3.0b1} 3.0 Beta 1
Released on October 6th, 2014

View file

@ -36,6 +36,9 @@
; 2012
; 8.1
; 2012R2
; 10
;
; Note: Windows 8.1 and later will be detected as Windows 8 unless ManifestSupportedOS is set correctly!
;
; AtLeastServicePack checks if the installer is running on Windows service pack version at least as specified.
; IsServicePack checks if the installer is running on Windows service pack version exactly as specified.
@ -150,6 +153,8 @@
!define WINVER_8.1 0x06030000 ;6.03.9600
!define WINVER_2012R2_NT 0x86030001 ;6.03.9600
!define WINVER_2012R2 0x06030001 ;6.03.9600
!define WINVER_10_NT 0x86040000 ;6.04.????
!define WINVER_10 0x06040000 ;6.04.????
# use this to make all nt > 9x
@ -410,6 +415,7 @@
!insertmacro __WinVer_DefineOSTest ${Test} 2012 '${Suffix}'
!insertmacro __WinVer_DefineOSTest ${Test} 8.1 '${Suffix}'
!insertmacro __WinVer_DefineOSTest ${Test} 2012R2 '${Suffix}'
!insertmacro __WinVer_DefineOSTest ${Test} 10 '${Suffix}'
!macroend
!insertmacro __WinVer_DefineOSTests AtLeast ""

View file

@ -39,6 +39,20 @@ static bool isstrhexchars(const TCHAR*s,UINT cch)
return true;
}
static const struct { const TCHAR *name, *guidstr; } g_soslmap[] = {
{ _T("WinVista"), _T("{e2011457-1546-43c5-a5fe-008deee3d3f0}") },
{ _T("Win7"), _T("{35138b9a-5d96-4fbd-8e2d-a2440225f93a}") },
{ _T("Win8"), _T("{4a2f28e3-53b9-4441-ba9c-d69d4a4a6e38}") }, //msdn.microsoft.com/en-us/library/hh848036
{ _T("Win8.1"), _T("{1f676c76-80e1-4239-95bb-83d0f6d0da78}") }, //msdn.microsoft.com/en-us/library/windows/desktop/dn481241
{ _T("Win10"), _T("{8e0f7a12-bfb3-4fe8-b9a5-48fd50a15a9a}") } //blogs.msdn.com/b/chuckw/archive/2013/09/10/manifest-madness.aspx
};
void SupportedOSList::addall()
{
for (UINT i = 0; i < COUNTOF(g_soslmap); ++i)
append(g_soslmap[i].name);
}
bool SupportedOSList::append(const TCHAR* osid)
{
const TCHAR *guid = 0;
@ -54,10 +68,15 @@ bool SupportedOSList::append(const TCHAR* osid)
guid = osid;
}
}
else if (!_tcsicmp(osid,_T("WinVista"))) guid = _T("{e2011457-1546-43c5-a5fe-008deee3d3f0}");
else if (!_tcsicmp(osid,_T("Win7"))) guid = _T("{35138b9a-5d96-4fbd-8e2d-a2440225f93a}");
else if (!_tcsicmp(osid,_T("Win8"))) guid = _T("{4a2f28e3-53b9-4441-ba9c-d69d4a4a6e38}");
else if (!_tcsicmp(osid,_T("Win8.1"))) guid = _T("{1f676c76-80e1-4239-95bb-83d0f6d0da78}");
else
{
for (UINT i = 0; i < COUNTOF(g_soslmap); ++i)
if (!_tcsicmp(osid, g_soslmap[i].name))
{
guid = g_soslmap[i].guidstr;
break;
}
}
if (guid)
{

View file

@ -61,18 +61,12 @@ namespace manifest
if (-1 == pos) return 0;
return m_list.get() + pos;
}
void addall();
void deleteall()
{
m_list.deleteall();
m_isdefaultlist = false;
}
void addall()
{
append(_T("WinVista"));
append(_T("Win7"));
append(_T("Win8"));
append(_T("Win8.1"));
}
void setdefault()
{
m_list.deleteall();

View file

@ -242,7 +242,7 @@ static tokenType tokenlist[TOK__LAST] =
{TOK_XPSTYLE, _T("XPStyle"),1,0,_T("(on|off)"),TP_GLOBAL},
{TOK_REQEXECLEVEL, _T("RequestExecutionLevel"),1,0,_T("none|user|highest|admin"),TP_GLOBAL},
{TOK_MANIFEST_DPIAWARE,_T("ManifestDPIAware"),1,0,_T("notset|true|false"),TP_GLOBAL},
{TOK_MANIFEST_SUPPORTEDOS,_T("ManifestSupportedOS"),1,-1,_T("none|all|WinVista|Win7|Win8|Win8.1|{GUID} [...]"),TP_GLOBAL},
{TOK_MANIFEST_SUPPORTEDOS,_T("ManifestSupportedOS"),1,-1,_T("none|all|WinVista|Win7|Win8|Win8.1|Win10|{GUID} [...]"),TP_GLOBAL},
{TOK_P_PACKEXEHEADER,_T("!packhdr"),2,0,_T("temp_file_name command_line_to_compress_that_temp_file"),TP_ALL},
{TOK_P_FINALIZE,_T("!finalize"),1,0,_T("command_with_%1"),TP_ALL},
{TOK_P_SYSTEMEXEC,_T("!system"),1,2,_T("command [<OP retval> | <retvalsymbol>]\n OP=(< > <> =)"),TP_ALL},