Starting another process with elevation using different user credentials

前端 未结 5 891
旧巷少年郎
旧巷少年郎 2021-02-04 02:00

I\'m trying to start an elevated process from with a non-elevated process, but I also need to supply the username and password for a user with administrative credentials. I\'ve

5条回答
  •  渐次进展
    2021-02-04 02:19

    If you're authoring a Windows Installer (MSI) application, and updating it using MSPs, then Windows Installer has built-in support for exactly your scenario: - check out User Account Control (UAC) Patching.

    It works basically like this:

    • When you author the original MSI, You generate a certificate, and you put its public key (or something like that) in the MSI.
    • The target machine's admin installs the MSI on the machine.
    • You author an update (MSP), and sign it with the certificate.
    • Any user on the target machine can now install the update - Windows Installer will validate the certificate against the public key in the original MSI, and agree to install if so. I don't think you'll get a UAC prompt at all, though I'm not sure.

提交回复
热议问题