7zip self-extracted executable: To extract file to specific directory

1) Install 7-zip (7zS.sfx will be installed to C:\Program Files\7-Zip):

http://7zsfx.solta.ru/en/

2) Copy following script snippet into notepad and save as config.txt with UTF-8 encouding by selecting File -> Save As... -> Switch Encoding to "UTF-8"

;[email protected]@!UTF-8!
CancelPrompt="Are you sure you want to cancel?"
FinishMessage="Hi, file has been successfully extracted! "
GUIFlags="8+128"
InstallPath="%Programfiles%\\MyFolder\\Contain Space"
ExtractPathText="Please select extraction path:"
ExtractPathTitle="Welcome to use 7zip self-extracting archive"
ExtractCancelText="Abort"
;[email protected]@!

3) Make a folder for placing the file(s) you expect to extract.

4) Select all and right-click on any one of them, select "Add to archive...", Change archive name, set compression level to Ultra, click OK

5) Copy 7zs.sfx and config.txt to the same folder

6) Open a command line, CD to this folder (Or, press SHIFT [do not let go] and right-click in the blanks inside this folder, select Open command window here)
enter following command line
copy /b 7zs.sfx + config.txt + ArchiveName.7z Self-Extract-Executable-Name.exe

Reference:

http://sevenzip.sourceforge.jp/chm/cmdline/switches/sfx.htm

http://www.msfn.org/board/topic/99843-7-zip-sfx-extract-to-this-folder/

http://sourceforge.net/p/sevenzip/discussion/45797/thread/31dc880f

时间: 2024-10-12 09:21:18

7zip self-extracted executable: To extract file to specific directory的相关文章

python在使用MySQLdb模块时报Can't extract file(s) to egg cacheThe following error occurred while trying to extract file(s) to the Python eggcache的错误。

这个是因为python使用MySQLdb模块与mysql数据库交互时需要一个地方作为cache放置暂存的数据,但是调用python解释器的用户(常常是服务器如apache的www用户)对于cache所指向的位置没有访问权限. 解决方式有很多,这里介绍一个. 创建一个文件夹并给予该文件夹对应用户w的权限(不确定是哪个用户的情况下可以直接给other置以w权限(linux下用户及权限机制自行百度)). 然后在每个python的脚本文件中加入 import osos.environ['PYTHON_E

PaodingAnalysis 提示 "dic home should not be a file, but a directory"

Exception in thread "main" net.paoding.analysis.exception.PaodingAnalysisException: dic home should not be a file, but a directory! at net.paoding.analysis.knife.PaodingMaker.setDicHomeProperties(PaodingMaker.java:338) at net.paoding.analysis.kn

File类和Directory类

File类和Directory类分别用来对文件和各种目录进行操作,这两类可以被实例化,但不能被其他类集成. 1. File类(静态类) File类支持对文件的基本操作,它包括用于创建.复制.删除.移动和打开文件的静态方法,并协助创建FileStream对象. 2. Directory类(静态类) Directory类公开了用于创建.移动.枚举.删除目录和子目录的静态方法. 举例1:文件的创建 using System; using System.Collections.Generic; usin

.net 平台下的File.Exists和directory .Exists()

File.Exists(path + "a.txt")) //判断某个目录下是否存在某个文件 System.IO.Directory.Exists(@"E:\Files")) //判断文件夹是否存在,不存在则创建文件夹   C#中判断文件夹或文件是否存在的方法 2014年10月30日 11:35:54 chenyq2008 阅读数:17489 c#中操作IO非常简单,下面介绍如何判断文件夹或文件是否存在的方法.  代码如下: //判断文件夹是否存在,不存在则创建文件

The Portable Executable File Format from Top to Bottom(每个结构体都非常清楚)

The Portable Executable File Format from Top to Bottom Randy KathMicrosoft Developer Network Technology Group Created: June 12, 1993 Click to open or copy the files in the EXEVIEW sample application for this technical article. Click to open or copy t

JVMS Specification(3)-The class File Format

Subsections 3 The class File Format 3.1 The ClassFile Structure 3.2 The Internal Form of Names 3.2.1 Binary Class and Interface Names 3.2.2 Unqualified Names 3.3 Descriptors and Signatures 3.3.1 Grammar Notation 3.3.2 Field Descriptors 3.3.3 Method D

How to Create an OCM Response file to Apply a Patch (文档 ID 966023.1)

How to Create an OCM Response file to Apply a Patch in Silent Mode - opatch silent (文档 ID 966023.1) APPLIES TO: Oracle Universal Installer - Version 10.2.0.1 to 11.2.0.4 [Release 10.2 to 11.2]Oracle Database - Enterprise Edition - Version 10.2.0.1 to

Linux CentOS 7 中find命令、三个Time、快捷键及file判断文件类型

一. find命令 locate 查找命令,从本地生成的数据库中查找文件 如果没有locate命令,安装软件包:mlocate [[email protected]_46_188_centos ~]# which locate /usr/bin/locate [[email protected]_46_188_centos ~]# rpm -qf /usr/bin/locatemlocate-0.26-5.el7.x86_64 [[email protected]_46_188_centos ~

How to detect the types of executable files

How to detect the types of executable files type { IMAGE_DOS_HEADER: DOS .EXE header. } IMAGE_DOS_HEADER = packed record e_magic : Word; // Magic number ("MZ") e_cblp : Word; // Bytes on last page of file e_cp : Word; // Pages in file e_crlc : W