7zip Self Extracting Archive (SFX) without administrator privileges

前端 未结 6 2058
情书的邮戳
情书的邮戳 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:30

    I don't understand how MiscFlags="4" can solve the problem.

    What is the reason of the problem? You use copy /b 7zS.sfx (or 7zS2, or 7zSD, doesn't matter) with your files and it will get you a file with permissions to run only as administrator. The information what role (admin, simple user) can run the application is stored in manifest inside the application. 7zS (or 7zS2, or 7zSD) doesn't have manifest. So if you use Windows Vista or further, the result file will prompt you to enter admin credentials.

    This article will help you. Read from "Getting Rid of UAC Prompt".

    https://www.excelsiorjet.com/kb/35/howto-create-a-single-exe-from-your-java-application

    You can fix the problem using resource editor software such as ResEdit. You should add a manifest to the 7zS.sfx file with the security information:

    
      
        
      
    
    

提交回复
热议问题