NSIS总结1——以管理权限运行

时间:2022-11-23 11:29:54

在Name "${PRODUCT_NAME} ${PRODUCT_VERSION}" 到第一个Section之间插入一行代码

RequestExecutionLevel admin

完整示例:

Name "${PRODUCT_NAME} ${PRODUCT_VERSION}"
OutFile "setup.exe"
InstallDir "d:\xxx"
InstallDirRegKey HKLM "${PRODUCT_UNINST_KEY}" "UninstallString"
ShowInstDetails show
ShowUnInstDetails show
BrandingText "xxx"
RequestExecutionLevel admin Section "XxxSection" SEC01