如何创建批处理文件自动执行,WinRAR的SFX文件? [英] How can I create an auto-executing, WinRar SFX file from a batch file?
问题描述
我有一个第三方安装程序,我想为我的用户能够下载并运行为pre-必要给我写的应用程序。安装者可以采取参数,允许被动安装,其中用户可以观看该过程的进展,但不必与安装交互。
I have a 3rd-party installer program that I would like for my users to be able to download and run as a pre-requisite to an application that I have written. The installer can take parameters that allows for a passive installation, where the user can watch the progress of the process but doesn't have to interact with the installation.
previously,我已经通过创建在WinRAR的SFX文件来完成此行为。从WinRAR的图形用户界面的选项之内,你可以指定一个文件启动后归档已经DECOM pressed,以及作为参数传递给应用程序。
Previously, I've accomplished this behavior by creating an SFX file in WinRar. From within the options of the WinRAR GUI, you can specify a file to launch after the archive has been decompressed, as well as parameters to the application.
有没有一种方法来创建一个自解压文件,并使用控制台设置这些自动执行的属性?我想创建一个批处理文件,负责这一切。
Is there a way to create an SFX file and set these auto-execution properties using the console? I am trying to create a batch file that takes care of all of this.
下面是我的批处理文件内容至今:
Below is my batch file content so far:
C:\Progra~1\WinRAR\rar a -m0 installer_archive.rar install_me.exe
C:\Progra~1\WinRAR\rar s installer_archive.rar installer_auto_extractor.exe
最后一步之后,我应该怎么做听到更新SFX?
After the final step, what should I do hear to update the SFX?
推荐答案
最简单的方式是这样的:
the easy way is like this:
rar a -r -sfx -z"f:\xfs.conf" auto_install install_me.exe
它会自动在windows.And创建auto_install.exe您需要创建自解压配置的xfs.conf文件;我的例子是:
It will automatically create auto_install.exe in windows.And you need to create a xfs.conf file for sfx configuration; My example is:
; The path to the setup executable
Setup=install_me.exe
; Extract the files to a temporary directory
TempMode
; Use semi-silent mode
Silent=1
; Overwrite any existing files
Overwrite=1
; The title of the SFX archive
Title=Running
; The text to show initially when the user clicks on the SFX archive (will only matter if using Silent=0)
Text
{
The book is preparing to start.
}
告诉我,如果你仍然有问题。
Tell me if you still have problem.
这篇关于如何创建批处理文件自动执行,WinRAR的SFX文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!