7zip 自解压存档 (SFX),无需管理员权限 [英] 7zip Self Extracting Archive (SFX) without administrator privileges

查看:81
本文介绍了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

问题是结果SFXsfxInstaller.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.

推荐答案

我通过 mpursuit answer 解决了这个问题.

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.0VCvcvarsall.bat" x86
mt.exe -manifest manifest.xml -outputresource:"7zS.sfx;#1"
copy /b 7zS.sfx + build.config + archive.7z sfx_archive.exe

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

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆