se_pavel
se_pavel

Reputation: 2208

NSIS, run one action as administator

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 administrator?

Upvotes: 0

Views: 705

Answers (1)

Anders
Anders

Reputation: 101606

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.

Upvotes: 2

Related Questions