Jump to content
Strawberry Orange Banana Lime Leaf Slate Sky Blueberry Grape Watermelon Chocolate Marble
Strawberry Orange Banana Lime Leaf Slate Sky Blueberry Grape Watermelon Chocolate Marble

MSFN is made available via donations, subscriptions and advertising revenue. The use of ad-blocking software hurts the site. Please disable ad-blocking software or set an exception for MSFN. Alternatively, register and become a site sponsor/subscriber and ads will be disabled automatically. 


Sign in to follow this  
biatche

[Question] WinRAR SFX arguments

Recommended Posts

apart from sfx.exe /S for silent, what others are there? I'm particularly looking for a switch for output directory

Share this post


Link to post
Share on other sites

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:

Path=MyCoolApp

Silent=1

Overwrite

Share this post


Link to post
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.

Share this post


Link to post
Share on other sites

Yeah, repacking lots of stuff could be a problem. Especially when you have locked archives... Anyway /s is like the only switch out there for SFX archives. Sorry :(

Share this post


Link to post
Share on other sites

I think that the latest WinRAR SFX has additional switches. Check out their site for more info.

Share this post


Link to post
Share on other sites

Only in 3.70 beta though...

5. GUI self-extracting modules support following command line

switches:

-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

Share this post


Link to post
Share on other sites
I think that the latest WinRAR SFX has additional switches. Check out their site for more info.

Thanks for the information :thumbup

shark

Share this post


Link to post
Share on other sites

Nice. Somehow I didn't check their site but I googled over and over.. Thanks fellas! Now what does s1, s2, sp.. or does s2 mean it has the extracting dialog

Share this post


Link to post
Share on other sites

No idea, but probably it is where you put command line parameters for the installer inside SFX archive. But it's a wild guess, mind you.

Share this post


Link to post
Share on other sites

I have tested something with a RARsfx

Example: (TEST.exe rarsfx)

;Het onderstaande commentaar bevat SFX-scriptopdrachten

Path=.\%dirtarget%
SavePath
Setup=Replace.vbs "INFO.txt" ".exe" "%myinput%"
Silent=1
Overwrite=1

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

TEST.exe

EXIT

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:

Setup=%installchoice%

@echo off

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

EXIT

Share this post


Link to post
Share on other sites

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"

etc.

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

Share this post


Link to post
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
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...