Old 3rd February 2020, 15:32   #1
TinyNiceWolf
Junior Member
 
Join Date: Feb 2020
Posts: 3
Signing an uninstaller without a UAC prompt during build?

I'm having some trouble code-signing my uninstaller, following the directions here. (I'm using NSIS 3.04, MUI2, and the Advanced Uninstall Log header.)

The uninstaller signing code on the linked page constructs an "inner" install using "RequestExecutionLevel User", which prevents an undesired UAC prompt during the build process.

But that constructs an uninstaller which does not request Admin privileges, and this uninstaller is then packaged by the outer installer, which does request Admin privileges. The result is an uninstaller with no privileges, which therefore fails to delete files from within "\Program Files". I need my uninstaller to have Admin privileges to be able to delete the files my installer put there.

I can fix this by building the inner installer with "RequestExecutionLevel Admin". This constructs a proper uninstall executable for the outer installer to incorporate, one with Admin requested. But it also requires me to respond to a UAC prompt during the build process, when the outer build invokes the installer made by the inner build.

I'd like a build process that doesn't require me to respond to a UAC prompt each time, yet still works properly. Any ideas?
TinyNiceWolf is offline   Reply With Quote
Old 3rd February 2020, 19:05   #2
Anders
Moderator
 
Anders's Avatar
 
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 5,194
PHP Code:
!system 'set __COMPAT_LAYER=RunAsInvoker&"$temp\tempinstaller.exe"' 
or something like that to prevent elevation prompt.

IntOp $PostCount $PostCount + 1
Anders is offline   Reply With Quote
Old 3rd February 2020, 19:17   #3
TinyNiceWolf
Junior Member
 
Join Date: Feb 2020
Posts: 3
Works perfectly. Thanks!
TinyNiceWolf is offline   Reply With Quote
Reply
Go Back   Winamp & Shoutcast Forums > Developer Center > NSIS Discussion

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump