7zip Self Extracting Archive (SFX) without administrator privileges

前端 未结 6 2017
情书的邮戳
情书的邮戳 2021-02-20 05:28

I use 7zip to create the SFX as follows:

7z.exe a -r archive.7z *

Then I do a binary copy with the 7zS.sfx file (used to create a self extracti

6条回答
  •  北海茫月
    2021-02-20 06:15

    You can embed a manifest file in the original 7zs.sfx that informs Windows to run the extractor with the same access token as the parent process. Which will cause the self extractor to run as a normal user if that is what the user is login as.

    The following link describes how to embed a manifest file in an executable using Visual Studio 2005, but the same process applies in later versions. https://support.microsoft.com/kb/944276

    Once you have embedded the manifest file that sets the "requestedExecutionLevel" to "asInvoker", any self extracting archieve created in the normal way with the modified 7sz.sfx will not require administrator privileges.

提交回复
热议问题