Added ManifestDPIAware attribute

git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@6266 212acab6-be3b-0410-9dea-997c60f758d6
This commit is contained in:
anders_k 2012-09-20 18:42:21 +00:00
parent da2fe44184
commit 4b62ecbb31
8 changed files with 41 additions and 3 deletions

View file

@ -280,6 +280,15 @@ The default string will be used if a string is empty ("").
Accepts variables. If variables are used, they must be initialized before the license page is created.
\S2{amanifestdpiaware} ManifestDPIAware
\c \\<b\\>notset\\</b\\>|true|false
Declare that the installer is DPI-aware. A DPI-aware application is not scaled by the DWM (DPI virtualization) so the text is never blurry. NSIS does not scale the bitmap used by the tree control on the component page and some plugins might have compatibility issues so make sure that you test your installer at different DPI settings if you select \e{true}.
See \W{http://msdn.microsoft.com/en-us/library/dd464660}{MSDN} for more information about DPI-aware applications.
\S2{amanifestsupportedos} ManifestSupportedOS
\c none|all|WinVista|\\<b\\>Win7|Win8\\</b\\>|{GUID} [...]

View file

@ -278,6 +278,7 @@ CEXEBuild::CEXEBuild() :
manifest_comctl = manifest::comctl_old;
manifest_exec_level = manifest::exec_level_none;
manifest_dpiaware = manifest::dpiaware_notset;
manifest_sosl.setdefault();
enable_last_page_cancel=0;
@ -2341,7 +2342,7 @@ int CEXEBuild::SetManifest()
try {
init_res_editor();
// This should stay ANSI
string manifest = manifest::generate(manifest_comctl, manifest_exec_level, manifest_sosl);
string manifest = manifest::generate(manifest_comctl, manifest_exec_level, manifest_dpiaware, manifest_sosl);
if (manifest == "")
return PS_OK;

View file

@ -507,6 +507,7 @@ class CEXEBuild {
manifest::comctl manifest_comctl;
manifest::exec_level manifest_exec_level;
manifest::dpiaware manifest_dpiaware;
manifest::SupportedOSList manifest_sosl;
CResourceEditor *res_editor;

View file

@ -67,7 +67,7 @@ bool SupportedOSList::append(const TCHAR* osid)
}
string generate(comctl comctl_selection, exec_level exec_level_selection, SupportedOSList& sosl)
string generate(comctl comctl_selection, exec_level exec_level_selection, dpiaware dpia, SupportedOSList& sosl)
{
if (comctl_selection == comctl_old && exec_level_selection == exec_level_none)
return "";
@ -118,6 +118,13 @@ string generate(comctl comctl_selection, exec_level exec_level_selection, Suppor
xml += "</application></compatibility>";
}
if (dpiaware_notset != dpia)
{
xml += "<application xmlns=\"urn:schemas-microsoft-com:asm.v3\"><windowsSettings><dpiAware xmlns=\"http://schemas.microsoft.com/SMI/2005/WindowsSettings\">";
xml += dpiaware_false != dpia ? "true" : "false";
xml += "</dpiAware></windowsSettings></application>";
}
xml += "</assembly>";
return xml;

View file

@ -38,6 +38,13 @@ namespace manifest
exec_level_admin
};
enum dpiaware
{
dpiaware_notset,
dpiaware_false,
dpiaware_true,
};
class SupportedOSList
{
StringList m_list;
@ -74,7 +81,7 @@ namespace manifest
}
};
std::string generate(comctl, exec_level, SupportedOSList&);
std::string generate(comctl, exec_level, dpiaware, SupportedOSList&);
};

View file

@ -2862,6 +2862,17 @@ int CEXEBuild::doCommand(int which_token, LineParser &line)
}
return PS_OK;
case TOK_MANIFEST_DPIAWARE:
switch(line.gettoken_enum(1,_T("none\0notset\0true\0false\0")))
{
case 0: // A lot of attributes use "none" so we support that along with the documented value
case 1: manifest_dpiaware = manifest::dpiaware_notset; break;
case 2: manifest_dpiaware = manifest::dpiaware_true; break;
case 3: manifest_dpiaware = manifest::dpiaware_false; break;
default: PRINTHELP();
}
return PS_OK;
case TOK_MANIFEST_SUPPORTEDOS:
{
manifest_sosl.deleteall();

View file

@ -240,6 +240,7 @@ static tokenType tokenlist[TOK__LAST] =
{TOK_WRITEUNINSTALLER,_T("WriteUninstaller"),1,0,_T("uninstall_exe_name"),TP_CODE},
{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|{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},

View file

@ -61,6 +61,7 @@ enum
TOK_INSTPROGRESSFLAGS,
TOK_XPSTYLE,
TOK_REQEXECLEVEL,
TOK_MANIFEST_DPIAWARE,
TOK_MANIFEST_SUPPORTEDOS,
TOK_CHANGEUI,
TOK_ADDBRANDINGIMAGE,