Skip to content

Conversation

justanotheranonymoususer

I tried to implement RequestUninstallerExecutionLevel, see https://sourceforge.net/p/nsis/feature-requests/560/

It's a small change, but helps me get rid of a large hack. Please accept this change to help me avoid maintaining a fork, and to help others who need this small feature.

@sredna
Copy link
Member

sredna commented Oct 16, 2021

This does not actually work.

@justanotheranonymoususer
Copy link
Author

Maybe now? Added the enum value

@sredna
Copy link
Member

sredna commented Oct 16, 2021

Maybe now?

Have you actually verified that this works? I would expect changes to build.cpp.

@justanotheranonymoususer
Copy link
Author

Frankly, no, haven't had the time to set up a dev environment. But it looks simple enough, and I'll happily test the resulting pre-release binaries.

I would expect changes to build.cpp.

Why?

@sredna
Copy link
Member

sredna commented Oct 16, 2021

Why?

Because the uninstaller is generated from the installer. Your code changes probably have zero effect.

@kichik
Copy link
Member

kichik commented Oct 16, 2021

There is only one manifest_exec_level. Being in uninstall_mode doesn't make it point somewhere else. If you want a different manifest, you would have to edit it as the uninstaller is being written. That happens when the installer runs, not in compile time.

https://github.com/kichik/nsis/blob/de09827b5b651b1d467c17be17bc7e5a98dae70f/Source/exehead/exec.c#L1554

@justanotheranonymoususer
Copy link
Author

So I read a bit more of the code. As far as I understand, the uninstaller is created by the installer as a delta of its own, which is something I didn't realize before. I thought of a solution, and I think what can be done is changing the code here:
https://github.com/kichik/nsis/blob/HEAD/Source/manifest.cpp#L177-L190
so that all options will take the same amount of bytes (pad with spaces). Then, it can be changed by the installer at runtime. But I can see how it's not easy as I thought.

I might get back to it later. Now, I have two options that I see: use the old hack, or change the uninstaller code to elevate at startup, without a manifest. The "elevate at startup" option has pros: less disk space in the installer, less hacks in the code, and cons: the process is being launched twice, Windows doesn't show shield icon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants