本文介绍了7zip自解压存档(SFX),无管理员权限的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用7zip如下创建SFX:

I use 7zip to create the SFX as follows:

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

然后,我使用7zS.sfx文件(用于创建自解压安装程序),配置文件"build.config"和归档文件进行二进制复制.配置文件的内容如下:

Then I do a binary copy with the 7zS.sfx file (used to create a self extracting installer), config file "build.config", and the archive. The contents of config file are as follows:

;!@Install@!UTF-8!
RunProgram="setup.exe"
GUIMode="1"
Path="%tmp%\\mytemp"
;!@InstallEnd@!

二进制复制命令如下:

copy /b 7zS.sfx + build.config + archive.7z sfxInstaller.exe

问题是结果SFX"sfxInstaller.exe"需要执行执行的管理员权限.是否可以使用7-Zip生成不需要管理员权限的自解压存档?如果是这样,我应该使用哪些参数/命令行参数?预先感谢.

Problem is that the result SFX "sfxInstaller.exe" requires admin privileges for executing. Is it possible to generate Self Extracting Archives using 7-Zip that do not require admin privileges? If so, what parameters/command line arguments should I use?Thanks in advance.

推荐答案

我通过 mpsuitsuit答案解决了此问题.

I fixed this problem with mpursuit answer.

要更新7zS.sfx的清单,可以使用以下过程:

To update manifest of 7zS.sfx you can use the following procedure:

manifest.xml

manifest.xml

   <?xml version="1.0" encoding="utf-8"?>
    <assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0" xmlns:asmv3="urn:schemas-microsoft-com:asm.v3">

      <compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1">
        <application>
          <!--application support for Windows Vista -->
          <supportedOS Id="{e2011457-1546-43c5-a5fe-008deee3d3f0}"/>
          <!--application support for Windows 7 -->
          <supportedOS Id="{35138b9a-5d96-4fbd-8e2d-a2440225f93a}"/>
        </application>
      </compatibility>

      <trustInfo xmlns="urn:schemas-microsoft-com:asm.v2">
        <security>
          <requestedPrivileges>
            <requestedExecutionLevel level="asInvoker" uiAccess="false"/>
          </requestedPrivileges>
        </security>
      </trustInfo>

    </assembly>
call "C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\vcvarsall.bat" x86
mt.exe -manifest manifest.xml -outputresource:"7zS.sfx;#1"
copy /b 7zS.sfx + build.config + archive.7z sfx_archive.exe

这篇关于7zip自解压存档(SFX),无管理员权限的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-25 21:37