Jump to content

[Question] WinRAR SFX arguments


Recommended Posts

You need an install script for that (it's written in Comments field of SFX package). Use WinRAR help or search the forums for the thread explaining the command. In short if you want it to install to %ProgramFiles%\MyCoolApp you need something like:




Link to comment
Share on other sites

Thanks for the quick response, but, what I seek is quick customization.... i don't wanna have to repack a 1gb sfx just to modify the paths.. hm, maybe i should just consider 7z or rar directly rather than sfx.

Link to comment
Share on other sites

Only in 3.70 beta though...

5. GUI self-extracting modules support following command line


-d set the destination path

-p specify a password

-s silent mode, hide all

-s1 same as -s

-s2 silent mode, hide start dialog

-sp specify parameters for setup program

Link to comment
Share on other sites

I have tested something with a RARsfx

Example: (TEST.exe rarsfx)

;Het onderstaande commentaar bevat SFX-scriptopdrachten

Setup=Replace.vbs "INFO.txt" ".exe" "%myinput%"

See some strange variables in the above SFX-script?

Well yes, that's what this was about...

This is how I openend that RARsfx with: (install.cmd)

@echo off

SET dirtarget=testdir
SET myinput=First replacement text



Waw, it did exactly what I hoped for...

It 's good to know, because this does open the door to some very nice possibilities...

This simple method can be usefull for running just one and the same RARsfx with different destinations, serialkeys, languages,...

...or even for running different installers in just one RARsfx with something like:


@echo off

SET installchoice=Autoit-v3\autoit-v3-setup.exe /S


Link to comment
Share on other sites

  • 4 years later...

I know this is an old thread, but I thought I would add some info since this thread appears to get a high number of hits with google.

quote biatche,

and how would sp work?

The command line syntax for using the -sp switch with a rarsfx installer which contains another setup installer that can take switches is as follows:

rarsfx.exe -sp" switch"

where "switch" is the argument you want to pass on to the embedded installer.

If the rarsfx has dialogs and the embedded installer supports silent install, then you can make it silent with this command line:

rarsfx.exe -s -sp" silentswitch"

So, some examples could be:

myrarsfx.exe -s -sp" /S"
myrarsfx.exe -s -sp" /quiet"
myrarsfx.exe -s -sp" -silent"


other types of switches should work, but I haven't done extensive testing.

The WinRar SFX documentation on this switch simply describes it without giving any examples on the correct syntax for using it.

Edited by visegrip
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    • No registered users viewing this page.

  • Create New...