Skip to content

Add RequestUninstallerExecutionLevel #18

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions Source/script.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2646,12 +2646,26 @@ int CEXEBuild::doCommand(int which_token, LineParser &line)
DefineInnerLangString(NLF_CREATED_UNINST);
}
return add_entry(&ent);
case TOK_REQUNINSTEXECLEVEL:
if (uninstall_mode)
{
switch (line.gettoken_enum(1,_T("none\0user\0highest\0admin\0")))
{
case 0: manifest_exec_level = manifest::exec_level_none; break;
case 1: 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: PRINTHELP();
}
}
return PS_OK;
#else //! NSIS_CONFIG_UNINSTALL_SUPPORT
case TOK_WRITEUNINSTALLER:
case TOK_UNINSTCAPTION:
case TOK_UNINSTICON:
case TOK_UNINSTTEXT:
case TOK_UNINSTSUBCAPTION:
case TOK_REQUNINSTEXECLEVEL:
ERROR_MSG(_T("Error: %") NPRIs _T(" specified, NSIS_CONFIG_UNINSTALL_SUPPORT not defined.\n"), line.gettoken_str(0));
return PS_ERROR;
#endif
Expand Down
1 change: 1 addition & 0 deletions Source/tokens.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,7 @@ static tokenType tokenlist[TOK__LAST] =
{TOK_PESUBSYSVER,_T("PESubsysVer"),1,0,_T("major.minor"),TP_GLOBAL},
{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_REQUNINSTEXECLEVEL,_T("RequestUninstallerExecutionLevel"),1,0,_T("none|user|highest|admin"),TP_GLOBAL},
{TOK_MANIFEST_APPENDCUSTOMSTRING,_T("ManifestAppendCustomString"),2,0,_T("path string"),TP_GLOBAL},
{TOK_MANIFEST_DPIAWARE,_T("ManifestDPIAware"),1,0,_T("notset|true|false"),TP_GLOBAL},
{TOK_MANIFEST_DPIAWARENESS,_T("ManifestDPIAwareness"),1,0,_T("comma_separated_string"),TP_GLOBAL},
Expand Down
1 change: 1 addition & 0 deletions Source/tokens.h
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ enum
TOK_PESUBSYSVER,
TOK_XPSTYLE,
TOK_REQEXECLEVEL,
TOK_REQUNINSTEXECLEVEL,
TOK_MANIFEST_APPENDCUSTOMSTRING,
TOK_MANIFEST_DPIAWARE,
TOK_MANIFEST_DPIAWARENESS,
Expand Down