码迷,mamicode.com
首页 > 其他好文 > 详细

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

时间:2015-02-25 21:02:24      阅读:139      评论:0      收藏:0      [点我收藏+]

标签:

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"

;!@Install@!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"
;!@InstallEnd@!

 

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

 

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

标签:

原文地址:http://www.cnblogs.com/cindy-hu-23/p/4300069.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!