diff --git a/Docs/src/attributes.but b/Docs/src/attributes.but index 92c800db..6b4374a1 100644 --- a/Docs/src/attributes.but +++ b/Docs/src/attributes.but @@ -308,9 +308,9 @@ Specifies the output file that the MakeNSIS should write the installer to. This \S2{requestexecutionlevel} RequestExecutionLevel -\c \\none\\|user|admin +\c \\none\\|user|highest|admin -Specifies the requested execution level for Windows Vista. The value is embedded in the installer and uninstaller's XML manifest and tells Vista, and probably future versions of Windows, what privileges level the installer requires. \e{user} requests the current's user level, be it normal user or administrator. \e{admin} requests administrator level and will cause Windows to prompt for the administrator password to verify privilege escalation. Specifying \e{none}, which is also the default, will keep the manifest empty and let Windows decide which execution level is required. Windows Vista automatically identifies NSIS installers and decides administrator privileges are required. Because of this, \e{none} and \e{admin} have virtually the same effect. +Specifies the requested execution level for Windows Vista. The value is embedded in the installer and uninstaller's XML manifest and tells Vista, and probably future versions of Windows, what privileges level the installer requires. \e{user} requests the a normal user's level with no administrative privileges. \e{highest} will request the highest execution level available for the current user and will cause Windows to prompt the user to verify privilege escalation. The prompt might request for the user's password. \e{admin} requests administrator level and will cause Windows to prompt the user as well. Specifying \e{none}, which is also the default, will keep the manifest empty and let Windows decide which execution level is required. Windows Vista automatically identifies NSIS installers and decides administrator privileges are required. Because of this, \e{none} and \e{admin} have virtually the same effect. As Windows Vista is still in development, anything might change. It's recommended, at least by Microsoft, that every application will be marked with the required execution level. Installers that need not install anything into system folders or write to the local machine registry (HKLM) should specify \e{user} execution level. diff --git a/Source/manifest.cpp b/Source/manifest.cpp index 2b9d531b..9abff212 100644 --- a/Source/manifest.cpp +++ b/Source/manifest.cpp @@ -46,6 +46,9 @@ string generate(comctl comctl_selection, exec_level exec_level_selection) case exec_level_user: level = "asInvoker"; break; + case exec_level_highest: + level = "highestAvailable"; + break; case exec_level_admin: level = "requireAdministrator"; break; diff --git a/Source/manifest.h b/Source/manifest.h index adc832df..6811cb20 100644 --- a/Source/manifest.h +++ b/Source/manifest.h @@ -31,6 +31,7 @@ namespace manifest { exec_level_none, exec_level_user, + exec_level_highest, exec_level_admin }; diff --git a/Source/script.cpp b/Source/script.cpp index 85f1cab3..2199e2cd 100644 --- a/Source/script.cpp +++ b/Source/script.cpp @@ -2599,7 +2599,7 @@ int CEXEBuild::doCommand(int which_token, LineParser &line) case TOK_REQEXECLEVEL: { - int k=line.gettoken_enum(1,"none\0user\0admin\0"); + int k=line.gettoken_enum(1,"none\0user\0highest\0admin\0"); switch (k) { case 0: @@ -2609,6 +2609,9 @@ int CEXEBuild::doCommand(int which_token, LineParser &line) manifest_exec_level = manifest::exec_level_user; break; case 2: + manifest_exec_level = manifest::exec_level_highest; + break; + case 3: manifest_exec_level = manifest::exec_level_admin; break; default: diff --git a/Source/tokens.cpp b/Source/tokens.cpp index 09099c91..7f054f87 100644 --- a/Source/tokens.cpp +++ b/Source/tokens.cpp @@ -235,7 +235,7 @@ static tokenType tokenlist[TOK__LAST] = {TOK_WRITEREGEXPANDSTR,"WriteRegExpandStr",4,0,"rootkey subkey entry_name new_value_string\n root_key=(HKCR|HKLM|HKCU|HKU|HKCC|HKDD|HKPD|SHCTX)",TP_CODE}, {TOK_WRITEUNINSTALLER,"WriteUninstaller",1,0,"uninstall_exe_name",TP_CODE}, {TOK_XPSTYLE, "XPStyle",1,0,"(on|off)",TP_GLOBAL}, -{TOK_REQEXECLEVEL, "RequestExecutionLevel",1,0,"none|user|admin",TP_GLOBAL}, +{TOK_REQEXECLEVEL, "RequestExecutionLevel",1,0,"none|user|highest|admin",TP_GLOBAL}, {TOK_P_PACKEXEHEADER,"!packhdr",2,0,"temp_file_name command_line_to_compress_that_temp_file",TP_ALL}, {TOK_P_SYSTEMEXEC,"!system",1,2,"command [<|>|<>|=) retval]",TP_ALL}, {TOK_P_EXECUTE,"!execute",1,0,"command",TP_ALL},