开发者

NSIS, run one action as administator

开发者 https://www.devze.com 2023-03-24 01:16 出处:网络
I have an installation that require only user privilegies, but this installation should remove previous files or call uninstaller if it exists

I have an installation that require only user privilegies, but this installation should remove previous files or call uninstaller if it exists

Is there way in NSIS to run one action(DeleteFile, RunExe) as admin开发者_开发知识库istrator?


Elevation is per process and you cannot go back down once you have elevated.

You should create a little helper nsis app that performs your required actions (RequestExecutionLevel admin alone is not enough, you also need to use UserInfo::GetAccountType) Use ShellExecute with the runas verb to start a elevated process.

0

精彩评论

暂无评论...
验证码 换一张
取 消