The Ruby Devkit is a 7-zip based self-extracting archive.
I would like to invoke it silently without having to install 7-Zip to extract the files to a folder of my choosing, so that I can script the installation. I imagine it to be something like:
cmd> DevKit-tdm-32-4.5.2-20111229-1559-sfx.exe /silent /dir="C:\DevKit"
But that, of course, doesn't work. What command line flags must I use to silently extract this archive into a folder of my choice?
To extract an . 7z archive file, use "e" option, which will extract the archive in the present working directory. 4. To see a list of files in an archive, use "l" (list) function, which will displays the type of archive format, method used, files in the archive among other information as shown.
try this:
C:\> DevKit-tdm-32-4.5.2-20111229-1559-sfx.exe -o"C:\DevKit" -y
Update 2017: The tool from 7zsfx.info is now dead and gone.
Original, old post from 08-2015:
If you are trying to extract an 7zip SFX (http://7zsfx.info/) archive:
sfx.exe -y -gm2 -InstallPath="C:\\your\\target\\path"
Switches Docu
-y
hide some prompts-gm2
hides the extraction dialog completely (silent mode)-InstallPath
sets the target path (you need double backslashes)7z SFX Guide
The official way to create a SFX package is to use -sfx[{name}] : Create SFX archive
.
And that means the created SFX packages uses two kinds of CLI options:
the passed through options you configured in your config, before creating the package.
You can think of it as parameter forwarding to the packaged executable. This parameter forwarding depends on the SetEnvironment
and RunProgramm
configuration!
The full process:
Package.7z
: Installer.msi
and additional crap.cab
file.Create config file config.txt
:
;!@Install@!UTF-8! Title="Installation" SetEnvironment="strInstall=hidcon:Installer.msi /qn" RunProgram="%strInstall%" ;!@InstallEnd@!
Now we generate Test.exe
by combining sfx+config+archive into an executable.
copy /b 7zS.sfx + config.txt + Package.7z SfxInstaller.exe
Note: 7zS.sfx is from the official 7zip extra package.
Now, when you run SfxInstaller.exe
you can pass for instance /lv InstallerLog.txt
to create a install log, e.g.
SfxInstaller.exe /lv InstallerLog.txt
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With