OSDN Git Service

move chm dir
[sevenzip/7-Zip.git] / sevenzip.sourceforge.jp / chm / cmdline / switches / sfx.htm
1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">\r
2 <HTML>\r
3 <HEAD>\r
4   <META http-equiv="Content-Type" content="text/html; charset=Windows-1252">\r
5   <TITLE>-sfx (Create SFX archive) switch</TITLE>\r
6   <LINK href="style.css" rel="stylesheet" type="text/css">\r
7 </HEAD>\r
8 \r
9 <BODY>\r
10 \r
11 <H1>-sfx (Create SFX archive) switch</H1>\r
12 \r
13 <P>Creates self extracting archive.</P>\r
14 \r
15 <H4>Syntax</H4>\r
16 \r
17 <PRE class="syntax">\r
18 -sfx[<A class="parameter" href="#SFX_Module">{SFX_Module}</A>]\r
19 </PRE>\r
20 \r
21 <DL>\r
22   <DT><A name="SFX_Module"></A>{SFX_Module}</DT>\r
23   <DD>\r
24     <P>Specifies the SFX module that will be combined with the archive.\r
25        This module must be placed in the same directory as the 7z.exe.\r
26        If {SFX_Module} is not assigned, 7-Zip will use standard console \r
27        SFX module 7zCon.sfx.</P>\r
28     <TABLE>\r
29       <TR> <TH width="60">SFX_Module</TH> <TH>Description</TH> </TR>\r
30       <TR> <TD>7z.sfx</TD> <TD>Windows version.</TD> </TR>\r
31       <TR> <TD>7zCon.sfx</TD> <TD>Console version.</TD> </TR>\r
32       <TR> <TD>7zS.sfx</TD> <TD>Windows version for installers.</TD> </TR>\r
33       <TR> <TD>7zSD.sfx</TD> <TD>Windows version for installers (uses MSVCRT.dll).</TD> </TR>\r
34     </TABLE>\r
35   </DD>\r
36 </DL>\r
37 \r
38 <P>\r
39 All SFX modules are uncompressed. You can use UPX program \r
40 (http://upx.sourceforge.net) \r
41 to compresss such modules. After compressing by the UPX program, the size of the\r
42 sfx module will be reduced to 40-50% of its original size.\r
43 </P>\r
44 \r
45 <H4>SFX modules for installers</H4>\r
46 <P>SFX modules for installers are included in an external package (7z_extra). You can download\r
47 these modules from www.7-zip.org. SFX modules for installers (7zS.sfx and 7zSD.sfx)\r
48 allow you to create your own installation program.\r
49 Such a module extracts the archive to the user's temp folder, and runs a specified program,\r
50 and removes the temp files after the program finishes.\r
51 A self-extracting archive for installers must be created as joining 3 files:\r
52 SFX_Module, Installer_Config, 7z_Archive. \r
53 In addition, an optional file, Installer_Config, is allowed. You can use the following command to\r
54 create an installer self-extracting archive:</P>\r
55 <PRE class="example">\r
56 copy /b 7zS.sfx + config.txt + archive.7z archive.exe\r
57 </PRE>\r
58 \r
59 <P>An optimally small installation package size can be achieved,\r
60 if the installation files are uncompressed before including them in the 7z archive.</P>\r
61 \r
62 <P><SPAN class="filename">-y</SPAN> switch for installer module specifies quiet mode extraction.</P>\r
63 \r
64 <H4>Installer Config file format</H4>\r
65 <P>\r
66 This config file contains commands for the Installer. The file begins with the string\r
67 <B>;!@Install@!UTF-8!</B> and ends with <B>;!@InstallEnd@!</B>.\r
68 The file must be written in UTF-8 encoding.\r
69 The file contains any or all these string pairs:\r
70 <P>ID_String="Value"</P>\r
71 <P>\r
72     <TABLE>\r
73       <TR> <TH width="60">ID_String</TH> <TH>Description</TH> </TR>\r
74       <TR> <TD>Title</TD> <TD>Title for messages</TD> </TR>\r
75       <TR> <TD>BeginPrompt</TD> <TD>Begin Prompt message</TD> </TR>\r
76       <TR> <TD>Progress</TD> <TD>Value can be "yes" or "no". Default value is "yes".</TD> </TR>\r
77       <TR> <TD>RunProgram</TD> <TD>Command for executing. Default value is "setup.exe". Substring <B>%%T</B> \r
78       will be replaced with path to temporary folder, where files were extracted</TD> </TR>\r
79       <TR> <TD>Directory</TD> <TD>Directory prefix for "RunProgram". Default value is ".\\"</TD> </TR>\r
80       <TR> <TD>ExecuteFile</TD> <TD>Name of file for executing</TD> </TR>\r
81       <TR> <TD>ExecuteParameters</TD> <TD>Parameters for "ExecuteFile"</TD> </TR>\r
82     </TABLE>\r
83 </P>\r
84 <P>You may omit any pair.</P>\r
85 \r
86 <P>There are two ways to run a installation program: <B>RunProgram</B> and <B>ExecuteFile</B>.\r
87 Use <B>RunProgram</B>, if you want to run a program from the .7z archive.\r
88 Use <B>ExecuteFile</B>, if you want to open a document from the .7z archive, or\r
89 if you want to execute a command from Windows.</P>\r
90 \r
91 <P>If you use <B>RunProgram</B>, and if you specify empty directory prefix: <B>Directory</B>="",\r
92 the system searches for the executable file in the following sequence:</P>\r
93 <OL>\r
94 <LI>The directory from which the application (installer) loaded. \r
95 <LI>The temporary folder, where files were extracted.\r
96 <LI>The Windows system directory. \r
97 </OL>\r
98 \r
99 <H4>Config file Examples</H4>\r
100 \r
101 <PRE class="example">\r
102 ;!@Install@!UTF-8!\r
103 Title="7-Zip 4.00"\r
104 BeginPrompt="Do you want to install the 7-Zip 4.00?"\r
105 RunProgram="setup.exe"\r
106 ;!@InstallEnd@!\r
107 </PRE>\r
108 \r
109 <BR>\r
110 \r
111 \r
112 <PRE class="example">\r
113 ;!@Install@!UTF-8!\r
114 Title="7-Zip 4.00"\r
115 BeginPrompt="Do you want to install the 7-Zip 4.00?"\r
116 ExecuteFile="7zip.msi"\r
117 ;!@InstallEnd@!\r
118 </PRE>\r
119 \r
120 <BR>\r
121 \r
122 <PRE class="example">\r
123 ;!@Install@!UTF-8!\r
124 Title="7-Zip 4.01 Update"\r
125 BeginPrompt="Do you want to install the 7-Zip 4.01 Update?"\r
126 ExecuteFile="msiexec.exe"\r
127 ExecuteParameters="/i 7zip.msi REINSTALL=ALL REINSTALLMODE=vomus"\r
128 ;!@InstallEnd@!\r
129 </PRE>\r
130 \r
131 <H4>Examples</H4>\r
132 \r
133 <PRE class="example">\r
134 7z a -sfx a.exe *.txt\r
135 </PRE>\r
136 \r
137 <P>adds <SPAN class="filename">*.txt</SPAN> files to self extracting \r
138   archive  <SPAN class="filename">a.exe</SPAN> using the default console SFX module.</P>\r
139 \r
140 <PRE class="example">\r
141 7z a -sfx7z.sfx a.exe *\r
142 </PRE>\r
143 \r
144 <P>adds all files to self extracting archive <SPAN class="filename">a.exe</SPAN>\r
145 with module <SPAN class="filename">7z.sfx</SPAN> using windows version of SFX mudule.</P>\r
146 \r
147 <H4>Commands that can be used with this switch</H4>\r
148 \r
149 <P>\r
150   <A href="../commands/add.htm">a (Add)</A>,\r
151   <A href="../commands/delete.htm">d (Delete)</A>,\r
152   <A href="../commands/update.htm">u (Update)</A>,\r
153 </P>\r
154 \r
155 </BODY>\r
156 </HTML>\r