Using a self-extracting RAR (SFX_RAR)
for running programs from the RAM drive
(using WinRAR 3.30)

Using a SFX_RAR is a simple and efficient way of executing programs that require being run from the RAM drive. You can define absolute paths (B:\ for example) or relative paths (%ramdrv% for example). There is perhaps, no better way to enable applications that must be run from the RAM drive - RAR allows the advantages of ease-of-use, high compression, and simpler plugin construction.

To follow the examples exactly, you'll need to have WinRAR configured with context-menus (right-clicking) activated. You can navigate there by opening WinRAR and choosing Options | Settings | Integration

Place checks in the boxes under "Shell integration."

Now we're ready to begin. We'll use Ad-aware for our example. Open Windows explorer and navigate to your Ad-aware plugin folder. It should look similar to this:

Highlight the three files and the folder to be included in the SFX_RAR, then right-click and select "Add to archive":

Place a check in the box "Create SFX archive" and rename the file to what you want - in this case AdAware_SFX.exe.

Now select the "Advanced" tab and choose SFX options.

In "Advanced SFX options", we'll be defining where to extract the files to, and what program to run automatically immediately after extraction. In the "Path to extract" box, type in your RAM drive path and folder you want to extract to - in this case, we'll be extracting Ad-aware to B:\AdAware. In the "Run after extraction" box, type in the name of the program you want to execute after extraction, in this case ad-aware.exe.

Please note that you can also define a relative path, for example: %ramdrv%AdAware, which will extract to wherever you have defined %ramdrv%.

Now select the "Modes" tab.
Tick "Hide all" and "skip existing files." Click OK twice to create your SFX_RAR archive.

That's it! Success! You can delete the 3 files if you wish and keep only the SFX_RAR.

It is also easy to update a file within a SFX_RAR without rebuilding from the beginning (programs which might require frequent updating, such as antivirus or spyware apps) - simply right-click on the SFX_RAR file and choose "Open with WinRAR" from the context menu. Using Windows explorer, just drag & drop the file you want to update into WinRAR, and the old file will be replaced with the new file.

You can now write your plugin using only one file:

Your adaware.inf file would look similar to:

; adaware.inf
; PE Builder v3 plug-in INF file for adaware
; plugin by DigiWiz

[Version]
Signature= "$Windows NT$"

[PEBuilder]
Name="Ad Aware 6.181"
Enable=1
Help="adaware.htm"

[WinntDirectories]
a=Programs\adaware,2

[SourceDisksFiles]
files\AdAware_SFX.exe=a,,1

[Append]
nu2menu.xml, adaware_nu2menu.xml

and your adaware_nu2menu.xml file might look like:

<!-- Nu2Menu entry for Ad-Aware v6 -->
<NU2MENU>
<MENU ID="Programs">
<MITEM TYPE="ITEM" DISABLED="@Not(@FileExists(@GetProgramDrive()\Programs\adaware\AdAware_SFX.exe))" CMD="RUN" FUNC="@GetProgramDrive()\Programs\adaware\AdAware_SFX.exe">Ad-Aware Pro 6.181</MITEM>
</MENU>
</NU2MENU>