🗜️ WinRAR SFX Installer

WinRAR Self-Extracting (SFX) Installer

Package an application into a single .exe using WinRAR SFX, including a post-install script to create shortcuts and optionally launch the app.

1) Requirements

2) Prepare the Source Folder

Package\
  AppLauncher.exe
  icon.ico              (optional)
  postinstall.vbs       (script below)

Rename files as needed. The guide uses neutral names.

3) postinstall.vbs — Create Shortcuts & Launch

Save this file in the source folder.

' Post-install: create shortcuts and launch application
Option Explicit
Dim WshShell, fso, instDir, scDesk, smDir, lnk
Set WshShell = CreateObject("WScript.Shell")
Set fso      = CreateObject("Scripting.FileSystemObject")

' Use the extracted folder (where this VBS is located)
instDir = fso.GetParentFolderName(WScript.ScriptFullName)

' Desktop shortcut
scDesk = WshShell.SpecialFolders("Desktop") & "\Your App.lnk"
Set lnk = WshShell.CreateShortcut(scDesk)
lnk.TargetPath = instDir & "\AppLauncher.exe"
lnk.WorkingDirectory = instDir
If fso.FileExists(instDir & "\icon.ico") Then lnk.IconLocation = instDir & "\icon.ico"
lnk.Save

' Start Menu shortcut
smDir = WshShell.SpecialFolders("Programs") & "\Your App"
If Not fso.FolderExists(smDir) Then fso.CreateFolder(smDir)
Set lnk = WshShell.CreateShortcut(smDir & "\Your App.lnk")
lnk.TargetPath = instDir & "\AppLauncher.exe"
lnk.WorkingDirectory = instDir
If fso.FileExists(instDir & "\icon.ico") Then lnk.IconLocation = instDir & "\icon.ico"
lnk.Save

' Auto launch application (optional)
WshShell.Run """" & instDir & "\AppLauncher.exe" & """", 1, False

Replace Your App and AppLauncher.exe with your own names if needed.

4) Build the SFX in WinRAR

  1. Open WinRAR and browse into the Package folder.
  2. Select all files → click Add.
  3. In the dialog, set:
    • Archive format: RAR
    • Create SFX archive: checked
    • Advanced SFX options… → Text and icon → Load SFX icon from file → choose icon.ico (optional)
  4. Open the Comment tab and paste one of the following blocks.

A) Interactive Mode

;The comment below contains SFX script commands
Title=Application Installer
Path=%ProgramFiles%\Your App
Overwrite=1
Setup=wscript.exe postinstall.vbs

B) Silent Mode

;The comment below contains SFX script commands
Title=Application Installer
Path=%ProgramFiles%\Your App
Silent=1
Overwrite=1
Setup=wscript.exe postinstall.vbs

To avoid UAC, install per-user instead: Path=%UserProfile%\Apps\Your App.

5) Test

6) Troubleshooting

7) Notes & Options

8) Quick Checklist

  • Place AppLauncher.exe, icon.ico, and postinstall.vbs in the source folder.
  • WinRAR → Add → check Create SFX archive → choose RAR5.
  • Comment tab → paste the Title/Path/Setup block (no quotes).
  • Build the .exe → test → shortcuts + launch ready.