How to create a WinRar SFX autorun file from a batch file?

I have a third-party installer that I would like my users to download and run as a prerequisite for the application I wrote. The installer can accept parameters that allow a passive installation, where the user can monitor the progress of the process, but should not interact with the installation.

I used to perform this behavior by creating an SFX file in WinRar. From the WinRAR GUI parameters, you can specify the file to run after unpacking the archive, as well as parameters for the application.

Is there a way to create an SFX file and set these automatic execution properties using the console? I am trying to create a batch file that takes care of all this.

Below is my batch file:

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 

After the last step, what should I hear to update SFX?

+7
source share
1 answer

a simple way is this:

 rar a -r -sfx -z"f:\xfs.conf" auto_install install_me.exe 

It will automatically create the auto_install.exe file in windows. And you need to create the xfs.conf file for the sfx configuration; My example:

 ; 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 have a problem.

+21
source

All Articles