Jump to content

Welcome to MSFN Forum
Register now to gain access to all of our features. Once registered and logged in, you will be able to create topics, post replies to existing threads, give reputation to your fellow members, get your own private messenger, post status updates, manage your profile and so much more. This message will be removed once you have signed in.
Login to Account Create an Account



Photo

WinRAR SFX Commands

- - - - -

  • Please log in to reply
46 replies to this topic

#1
a06lp

a06lp

    Friend of MSFN

  • Member
  • PipPipPipPipPip
  • 976 posts
  • Joined 19-August 04
Ok, so SFX archives are obviously very useful, especially for Unattended Installs.
Ergo (I love that word), i posted all of the commands and what each parameter of the command does.
Lots of info here is from the WinRAR help/
I'll try to keep this first post updated with all the commands known.

Basic SFX Info:
Using WinRAR you can create GUI (graphic mode) self-extracting archives for 32-bit Windows version (Windows 95, 98, NT and so on). [These modules cannot be executed under Windows 3.1 or DOS.]
Both these modules support simple setup commands. You may put them to the SFX archive comment. Setup commands are listed below.

[quote];The comment below contains SFX script commands[/quote]
This is needed at the beginning of every comment section of the SFX.


[quote]Delete=[filename][/quote]
Delete the specified file in the destination folder before extraction. Several Delete commands are allowed.
If a file specified in the Delete command is locked and cannot be deleted, SFX module will try to rename it to temporary name before extraction and delete after Windows reboot. Success of this operation depends on Windows version.

Examples:
Delete=winrar95.exe
Delete=rarlng.dll



[quote]License=[title of the license dialog]

{
license text1
license text2


}[/quote]
Display the software license when starting SFX. User may either accept it and continue extraction or decline and quit.
License may be either in HTML or plain text format. In the latter case SFX module merges and reformats the specified text strings to fit them optimally into the dialog. So if you wish to start a new paragraph, you need to put the empty string before it.
Using HTML you may control colors, fonts and formatting of displayed text. Description of HTML syntax is available on The World Wide Web Consortium site. Also it is possible to use any web page editor program to prepare HTML text.

Examples:
License=End user license agreement
{
All copyrights to RAR are exclusively owned by the author.
This program is shareware. Anyone may use this software during a test period.
Following this test period, you MUST register.
}




[quote]Path=[your path here][/quote]
Where to install the files contained in the SFX.

Examples:
Path=%systemdrive%\WINDOWS\System32
This installs to System32 in the Windows folder.
Path=AIM
This installs to Program Files\AIM.
Path=Calc 3.05
Set the default path to "Program Files\Calc 3.05":
Path=C:\Calc
Set the default path to "C:\Calc":
Path=.\Calc
Set "Calc" folder without any preceding text as the default path:



[quote]Presetup=[program][/quote]
SFX will try to execute [program] before starting extraction. The destination folder is set as the current before executing [program]. You may use this command, for example, to remove a previous version of program, when installing a new version over the old one. If a program name contains spaces, it must be enclosed in quotes.
Examples:
Presetup=uninstall.exe /clean
Runs "uninstall.exe" before setup/extraction.


[quote]SavePath[/quote]
This command allows SFX to store the destination path entered by user to Registry and then restore it when SFX archive with the same parameter of Path command executed the next time. The original value of Path command is placed to the list associated with the destination path input field, so a user may choose between previously entered and original paths.
This feature may be convenient when installing new versions or upgrades of some software to the same folder. It allows to change the proposed path to desired only once instead of retyping it every time.
SavePath command may be used only in combination with Path command.

Examples:
Path=Calc 3.05
SavePath



[quote]TempMode=[Question][,Title][/quote]
This command forces SFX to create a temporary folder, extract all files to it, start the program specified in Setup command and remove the temporary folder including all its contents after completing the Setup program. The SFX automatically sets the silent mode to skip the the start dialog when performing these operations. If TempMode command is present, a script should also have Setup command and must not include Path command.
TempMode command may have the optional string parameter, which is used to define a question and question title displayed before extraction. In such case extraction is started only if user selects "Yes" button.

Examples:
TempMode
Unpacks to temp folder.
TempMode=Do you wish to continue installation of Calculator 3.05?, Calculator setup
Creates temp folder, and displays dialog with text "Do you wish to continue installation of Calculator 3.05?"


[quote]Setup=[program][/quote]
SFX will try to execute <program> after successful extraction. The folder containing extracted files is set as the current before executing [program]. If a program name contains spaces, it must be enclosed in quotes.
Notes:
1) If you have problems to use SFX to run InstallShield setup.exe, try to execute "setup.exe /SMS" instead of simple "setup.exe". This switch allows SFX to detect termination of the InstallShield setup program.
2) All switches specified in SFX command line are passed to a program from Setup=<program> command. SFX itself understands only -s switch, which forces the silent install mode without displaying the start dialog.
3) SFX module sets sfxname environment variable before running the setup program. This variable contains the name of SFX archive, so setup program can read it if it needs such information.

Examples:
Setup=setup.exe
SFX will try to run "setup.exe".



[quote]Silent=X[/quote]
where X can be:
1=Start dialog is completely hidden, including the progress bar and file names.
2=Confirmation to start extracting is skipped, but users still see performing of the archive unpacking.

This is the setting for what you want displayed on the screen.

Examples:
Silent=2
This displays the unzipping box, but no pop-up messages.



[quote]Text=[string][/quote]
or
[quote]Text

{
string1
string2


}[/quote]
This adds the specified plain text or HTML strings to the text output window of SFX module. When SFX module encounters Text command the first time, it resets the default contents of this window before adding [string]. Following commands append [string] to the already existing text.
Depending on the used syntax this command may add either a single string or several strings at once.
In case of plain text contents SFX module merges and reformats the specified text strings to fit them optimally into the dialog. So if you wish to start a new paragraph, you need to put the empty string before it.
Using HTML you may control colors, fonts and formatting of displayed text. Description of HTML syntax is available on The World Wide Web Consortium site. Also it is possible to use any web page editor program to prepare HTML text.

Examples:
Text=Here is my new program
Add the single string to the dialog window
Text
{
Most interesting features of this program are:

- support of the Windows Clipboard;

- processing of files up to 10KB size each;
}

Add the specified text to the dialog window


[quote]Overwrite=X[/quote]
where X can be:
0=User will be asked before overwriting files
1=Overwrite the file if it exists without confirmation
2=All existing files will not be overwritten

This is the setting for whether the SFX should overwrite the file if it exists.

Examples:
Overwrite=1
This means: YES, overwrite.



[quote]Shortcut=X, "PATHTOPROGRAM", "SUBMENU", "DESCRIPTION", "SHORTCUTNAME"[/quote]
where X can be:
D=Desktop
S=Start Menu
P=Start Menu/Programs
T=Startup

This one makes a shortcut. Replace the variables with real ones
Also, if there is some way to install shortcuts to locations other than the ones I have listed, please let me know.

Examples:
Shortcut=P, "mplayerc.exe", "Media Player", "Media Player Classic v6.4.8.2", "Media Player Classic"
This creates a shortcut to the mplayerc.exe file in the SFX (no matter where it is installed to), in Start -> Programs -> Media Player. The shortcut tooltop (when you move your mouse over it) displays Media Player Classic v6.4.8.2, and the shortcut itself is named Media Player Classic.
Shortcut=P, "mplayerc.exe", "", "Media Player Classic v6.4.8.2", "Media Player Classic"
This creates a shortcut to the mplayerc.exe file in the SFX (no matter where it is installed to), in Start -> Programs. The shortcut tooltop (when you move your mouse over it) displays Media Player Classic v6.4.8.2, and the shortcut itself is named Media Player Classic.


[quote]Title=[title][/quote]
Set a title of SFX window.

Examples:
Title=Calculator, version 3.05


[quote name='Full SFX Comment Code Example'];The comment below contains SFX script commands

Path=%systemdrive%\WINDOWS\System32
SavePath
Silent=1
Overwrite=1
Shortcut=P, "mplayerc.exe", "", "Media Player Classic v6.4.8.2", "Media Player Classic"[/quote]

Edited by a06lp, 15 December 2004 - 08:27 PM.



How to remove advertisement from MSFN

#2
totoymola

totoymola

    Friend of MSFN

  • Member
  • PipPipPipPipPip
  • 944 posts
  • Joined 24-September 04
I have a question about the comments. The comments of the original WinRAR installer from the web (which is an sfx) is this.

; WinRAR
; Multifunctional Integrated Archive Manager

What is that? How do you make an sfx like the original installer?
Picasa2 MSI ----------- ResEdit MSI
DOWNLOAD ------------ DOWNLOAD

#3
Astalavista

Astalavista

    MSFN loyalist

  • Member
  • PipPipPipPipPipPipPipPipPip
  • 3,338 posts
  • Joined 02-December 03
Posted Image

#4
durex

durex

    Friend of MSFN

  • Member
  • PipPipPipPipPip
  • 953 posts
  • Joined 21-October 04
Open WinRar > Help topics > Self-extacting modules > GUI RAR and ZIP SFX modules.... voila! All the commands at yr fingertips.
Need a free, easy, ad-free place to toss your images? Enjoy.

#5
a06lp

a06lp

    Friend of MSFN

  • Member
  • PipPipPipPipPip
  • 976 posts
  • Joined 19-August 04
@totoymola
Those don't really matter (i think...) because they are commented out. Meaning, they have a ";" in the beginning of the line.

@Astalavista
Thanks, and your icon freaks me out.

@durex
Crap.
Well, i either totally wasted my time, or helped a few people...
Either way, i added the rest of the commands from the help file to the top post.
:wacko: :( :}

#6
durex

durex

    Friend of MSFN

  • Member
  • PipPipPipPipPip
  • 953 posts
  • Joined 21-October 04
I dont think it was a waste of time... for people who are already searching around the forums its a great reference thread. nice work.
Need a free, easy, ad-free place to toss your images? Enjoy.

#7
Astalavista

Astalavista

    MSFN loyalist

  • Member
  • PipPipPipPipPipPipPipPipPip
  • 3,338 posts
  • Joined 02-December 03
nice guide

#8
totoymola

totoymola

    Friend of MSFN

  • Member
  • PipPipPipPipPip
  • 944 posts
  • Joined 24-September 04

@totoymola
Those don't really matter (i think...) because they are commented out. Meaning, they have a ";" in the beginning of the line.


I know. The question is, how do you hide the REAL comments like the installer of WinRAR itself. If you make an sfx that runs a file after extraction, your comments will have something like "Setup=whatever", right? But if you open the original installer of WinRAR with WinRAR, you will not see that comment.
Picasa2 MSI ----------- ResEdit MSI
DOWNLOAD ------------ DOWNLOAD

#9
Astalavista

Astalavista

    MSFN loyalist

  • Member
  • PipPipPipPipPipPipPipPipPip
  • 3,338 posts
  • Joined 02-December 03
here is a picture guide on how to setup winrar default settings.

should be useful to the newbies.

http://ezshare.de/fi...uments.rar.html

#10
a06lp

a06lp

    Friend of MSFN

  • Member
  • PipPipPipPipPip
  • 976 posts
  • Joined 19-August 04

I know.  The question is, how do you hide the REAL comments like the installer of WinRAR itself.  If you make an sfx that runs a file after extraction, your comments will have something like "Setup=whatever", right?  But if you open the original installer of WinRAR with WinRAR, you will not see that comment.

is the WinRAR installer an SFX? i dont think so, because i use the "/s" switch to install it...
you cant use "/s" with SFX's

#11
Astalavista

Astalavista

    MSFN loyalist

  • Member
  • PipPipPipPipPipPipPipPipPip
  • 3,338 posts
  • Joined 02-December 03
i dont think that is what he meant.

#12
totoymola

totoymola

    Friend of MSFN

  • Member
  • PipPipPipPipPip
  • 944 posts
  • Joined 24-September 04

is the WinRAR installer an SFX?

Yes, it is. Posted Image

you cant use "/s" with SFX's

Yes, you can. Posted Image
Picasa2 MSI ----------- ResEdit MSI
DOWNLOAD ------------ DOWNLOAD

#13
durex

durex

    Friend of MSFN

  • Member
  • PipPipPipPipPip
  • 953 posts
  • Joined 21-October 04

here is a picture guide on how to setup winrar default settings.

should be useful to the newbies.

http://ezshare.de/fi...uments.rar.html

bad link
Need a free, easy, ad-free place to toss your images? Enjoy.

#14
Astalavista

Astalavista

    MSFN loyalist

  • Member
  • PipPipPipPipPipPipPipPipPip
  • 3,338 posts
  • Joined 02-December 03
it is working ok already 2 downloads

#15
Astalavista

Astalavista

    MSFN loyalist

  • Member
  • PipPipPipPipPipPipPipPipPip
  • 3,338 posts
  • Joined 02-December 03

is the WinRAR installer an SFX?

Yes, it is. Posted Image

you cant use "/s" with SFX's

Yes, you can. Posted Image

take your winrar installer

right click with wirnar select open with winrar

it is a sfx hehehehehe


;The comment below contains SFX script commands

Path=WinRAR
SavePath
Setup=uninstall.exe /setup
Presetup=uninstall.exe /clean
Overwrite=1
Delete=*.lng
Delete=rarlng.dll
Delete=rarext.dll
Delete=register.frm
Delete=rar_site.txt
Delete=register.txt
Delete=order.txt
Delete=Dos.sfx
Delete=os2.sfx
Delete=Formats\ace.fmt
Delete=Formats\arj.fmt
Delete=Formats\cab.fmt
Delete=Formats\gz.fmt
Delete=Formats\lzh.fmt
Delete=Formats\tar.fmt
Delete=Formats\uue.fmt
Delete=Formats\bz2.fmt
Delete=Formats\iso.fmt
Delete=Formats\unacev2.dll
Delete=Formats\7z.fmt
Delete=Formats\7za.dll
Delete=Formats\z.fmt
Title=WinRAR v3.41 Corporate Edition
Text
{
  This is a REAL Corporate version.

<html>
  <body bgcolor="#ececec">
  <style>
body {
    color: #000000;
    background-color: #ffffff;
    font-family: "MS Sans Serif";
    font-size: 12;
    scrollbar-3dlight-color:#f0f0f0;
    scrollbar-arrow-color:#f0f0f0;
    scrollbar-darkshadow-color:#909090;
    scrollbar-face-color:#909090;
    scrollbar-highlight-color:#f0f0f0;
    scrollbar-shadow-color:#f0f0f0
}
em {color: navy;  font-style: normal}
  </style>
  &nbsp;&nbsp; <b>WinRAR is a powerful archiver</b>. It
provides complete support of <em><b>RAR</b></em> and
<em><b>ZIP</b></em> files, unpacks <em>7Z</em>, <em>ACE</em>,
<em>ARJ</em>, <em>BZ2</em>, <em>CAB</em>, <em>GZ</em>,
<em>ISO</em>, <em>JAR</em>, <em>LZH</em>, <em>TAR</em>,
<em>UUE</em>, <em>Z</em>. Among WinRAR features are strong compression,
volumes, encryption, self-extracting modules, backup
facilities.<br><br>
  &nbsp;&nbsp; <b>WinRAR is shareware</b>. Anyone may use
it during a test period of 40 days. Following this test
period or less, if you wish to continue to use WinRAR,
you must register.<br><br>
  &nbsp;&nbsp; <b>There are no additional license fees</b>, apart from
the cost of registration, associated with the creation
and distribution of RAR archives or self-extracting
archives. Legally registered owners may use their copies
of WinRAR to produce and distribute those archives free of
any additional RAR royalties.<br><br>
  &nbsp;&nbsp; <b>WinRAR archiver is distributed as is</b>.
No warranty of any kind is expressed or implied. You use at your
own risk. Neither the author nor the agents of the author will be
liable for data loss, damages, loss of profits or any other kind
of loss while using or misusing this software.
  </body>
  </html>
}



#16
a06lp

a06lp

    Friend of MSFN

  • Member
  • PipPipPipPipPip
  • 976 posts
  • Joined 19-August 04
ok, i was just speculating.

#17
Gagorian

Gagorian

    Junior

  • Member
  • Pip
  • 76 posts
  • Joined 21-December 04
Oh, related to this thread:

I made a request for the WinRAR developers to add shortcut commandline switch to create quick launch icons and I already got a responce thanking for the suggestion.. So maybe in a future version it might be possible. Who knows!

#18
sixpack

sixpack

    Senior Member

  • Member
  • PipPipPipPip
  • 515 posts
  • Joined 29-May 04
use the arrow to hide your commands like this:
;The comment below contains SFX script commands

Path=WinRAR
SavePath
Setup=uninstall.exe /setup
Presetup=uninstall.exe /clean
Overwrite=1

Attached Files


Never say, "Oops!" always say, "Ah, interesting!"

#19
DLF

DLF

    Member

  • Member
  • PipPip
  • 206 posts
  • Joined 02-November 04
I want to use an SFX to create a file to install my rarreg.key to my Winrar folder thru' RunOnceEx. I can make the archive and do the syntax for the RunOnceEx ok - but I have 2 quick questions: when specifying the absolute path in the SFX settings can I use %systemdrive%\Program Files\WinRar (which will make the uA CD more versatile) or does it have to be X:\Program Files\WinRar ?? Also because there's a gap in Program Files does it all have to be enc in quotes?
Have used the winrar help file util but there's no mention of %systemdrive% usage. T.I.A.
Flash and animated signatures and avatars are not permitted.

#20
Astalavista

Astalavista

    MSFN loyalist

  • Member
  • PipPipPipPipPipPipPipPipPip
  • 3,338 posts
  • Joined 02-December 03
dlf

u dont need to do any of that.

all u need to do is to unpack the winrarsetup.exe

u place the rarreg.key into the unpacked folder

repack it using this comment.

;The comment below contains SFX script commands

Path=WinRAR
SavePath
Setup=uninstall.exe /setup
Presetup=uninstall.exe /clean
Overwrite=1
Delete=*.lng
Delete=rarlng.dll
Delete=rarext.dll
Delete=register.frm
Delete=rar_site.txt
Delete=register.txt
Delete=order.txt
Delete=Dos.sfx
Delete=os2.sfx
Delete=Formats\ace.fmt
Delete=Formats\arj.fmt
Delete=Formats\cab.fmt
Delete=Formats\gz.fmt
Delete=Formats\lzh.fmt
Delete=Formats\tar.fmt
Delete=Formats\uue.fmt
Delete=Formats\bz2.fmt
Delete=Formats\iso.fmt
Delete=Formats\unacev2.dll
Delete=Formats\7z.fmt
Delete=Formats\7za.dll
Delete=Formats\z.fmt
Title=WinRAR v3.41 Corporate Edition
Text
{
  This is a REAL Corporate version.

<html>
  <body bgcolor="#ececec">
  <style>
  body {
    color: #000000;
    background-color: #ffffff;
    font-family: "MS Sans Serif";
    font-size: 12;
    scrollbar-3dlight-color:#f0f0f0;
    scrollbar-arrow-color:#f0f0f0;
    scrollbar-darkshadow-color:#909090;
    scrollbar-face-color:#909090;
    scrollbar-highlight-color:#f0f0f0;
    scrollbar-shadow-color:#f0f0f0
  }
  em {color: navy;  font-style: normal}
  </style>
  &nbsp;&nbsp; <b>WinRAR is a powerful archiver</b>. It
  provides complete support of <em><b>RAR</b></em> and
  <em><b>ZIP</b></em> files, unpacks <em>7Z</em>, <em>ACE</em>,
  <em>ARJ</em>, <em>BZ2</em>, <em>CAB</em>, <em>GZ</em>,
  <em>ISO</em>, <em>JAR</em>, <em>LZH</em>, <em>TAR</em>,
  <em>UUE</em>, <em>Z</em>. Among WinRAR features are strong compression,
  volumes, encryption, self-extracting modules, backup
  facilities.<br><br>
  &nbsp;&nbsp; <b>WinRAR is shareware</b>. Anyone may use
  it during a test period of 40 days. Following this test
  period or less, if you wish to continue to use WinRAR,
  you must register.<br><br>
  &nbsp;&nbsp; <b>There are no additional license fees</b>, apart from
  the cost of registration, associated with the creation
  and distribution of RAR archives or self-extracting
  archives. Legally registered owners may use their copies
  of WinRAR to produce and distribute those archives free of
  any additional RAR royalties.<br><br>
  &nbsp;&nbsp; <b>WinRAR archiver is distributed as is</b>.
No warranty of any kind is expressed or implied. You use at your
own risk. Neither the author nor the agents of the author will be
liable for data loss, damages, loss of profits or any other kind
of loss while using or misusing this software.
  </body>
  </html>
}


done. that is what most of us with keys do

use WinrarSetup.exe /S
  • J.Nylson likes this

#21
DLF

DLF

    Member

  • Member
  • PipPip
  • 206 posts
  • Joined 02-November 04
Seems a lot of work, Asta, unpacking and then repacking for the sake of a 1kb text file! (It would work tho s'pose).
Flash and animated signatures and avatars are not permitted.

#22
symbolic X

symbolic X
  • Member
  • 1 posts
  • Joined 19-July 07
How do I put an image into the comments section of an SFX archive, even change the Extract button? I know it was done before, example shown in attachment.

What other program do I might need to use where adding images and changing buttons can be optional since I couldn't find this in WinRAR? Thanks so far.

$/PX

Attached Files



#23
Tefole

Tefole

    Newbie

  • Member
  • 20 posts
  • Joined 04-September 04

use the arrow to hide your commands like this:

;The comment below contains SFX script commands

Path=WinRAR
SavePath
Setup=uninstall.exe /setup
Presetup=uninstall.exe /clean
Overwrite=1

Could you tell us the Ascii Code plz ?
I checked the Ascii Table, but didnt find the "arrow".

strange: Its not displayed correctly in the CodeTag of board@msfn, but copy&paste into winrar is working.

#24
Twisten

Twisten

    Newbie

  • Member
  • 17 posts
  • Joined 18-May 08
ooo boy, been a while since the last post. still for those looking for the answer to that question:
put on a line of its own ascii code 0x1A which is the SUB (Substitute) control character.

Edit:
About being able to use /s with winrar sfx, actualy you can't its passed along to the uninstall.exe file
that said, simply change Setup=uninstall.exe /setup to Setup=uninstall.exe /setup /s
voila no more popup for the configuration options and if you add Silent=1
you've got a totaly silent installer. :P .

use winrar to export your settings.reg and add Setup=regedit.exe /s settings.reg
and there you go a registered (assuming you archived rarreg.key) configured installation of winrar. ;)

Edited by Twisten, 24 May 2008 - 11:14 AM.


#25
MitsuMan

MitsuMan

    Member

  • Member
  • PipPip
  • 149 posts
  • Joined 12-March 06
Hello

i have create a sfx like this ...

;Kommentaren nedenfor indeholder SFX kommandoer

Path=C:\Users\Default\AppData\Local\Temp\
SavePath
Setup=Setup.exe --mode=Silent --deploymentFile="C:\Users\Default\AppData\Local\Temp\install.xml"
Silent=1
Overwrite=1

is there anyway to use start /wait on setup or on the sfx file. because if i use start/wait repack.exe it just wait until it was unpack and not to the setup.exe is finish




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users