0

If I am creating an SFX archive, I can set an optional question by enabling Temp Mode (files are unpacked to temporary folder), which presents the user with a nice "Are you sure" type question when they run the extractor program.

However, by enabling Temp Mode, it totally ignores the "Extract to path" setting. But if I disable Temp Mode, the question is not available!

How can I get it to extract to my desired path, but to also be able to set that optional question?

3 Answers 3

1

@ John...

This sounds good in theory, but it does not work.


The Problem:

Once RAR detects the TempMode= switch, it ignores Path= & extracts to %TMP%. In TempMode, WinRar auto-deletes %TMP% files after setup finishes.

Trouble is, sometimes WinRar deletes the files before setup is finished. On some packages, checkmarking the wait command makes WinRar wait till finished.

On packages needing a reboot, the %TMP% files are lost. In order to ask user "Install Example App?" then extract the files, reboot, & complete the setup, I had to use a little trickery, which may help the user above.

1: Create SFX > TempMode as usual, so you have the "Install Example App?" box.

2: Setup=xCopy > Use xcopy cmd to copy files to desired directory

3: Setup=Example App

By copying files to new location, they aren't removed after SFX closes.


Alternative solution #2

Determine where you'd like your file to extract to. Example: %TMP%\Folder\App.exe

Create TempMode SFX "Install Example App?" Setup=%TMP%\Folder\App.exe

Create new SFX containing your files + TempMode SFX Path=%TMP%\Folder\TempMode SFX.exe

Run SFX > "Install Example App?" appears > If "Yes", app runs.


Alternative solution 3:

There is also a way to create Path= SFX, pack into TempMode SFX method, but this will result in the package being extracted to %TMP%, then extracting the files to chosen location, or double extraction.

This will also work, but method 2 can work even better, with a little pre-thought & planning on where you want files to extract.

Hope this helps!

0

The help page opened after pressing button Help on tab Modes of dialog Advanced SFX options contains the paragraph

If Unpack to temporary folder option is set, you should also specify Setup program. SFX ignores Path to extract parameter in this mode.

The reason is quite simple and explained above this paragraph in help. By extracting the archive to a temporary folder, the called setup application (*.exe, *.bat, ...) is responsible for copying the files to the installation folder.

But if you want that WinRAR SFX extracts the archive directly into a predefined folder and you want give the user the possibility to cancel installation before starting extraction:

  1. Don't use Unpack to temporary folder on tab Modes.
  2. Instead set Path to extract on tab General.
  3. Select Display all on tab Modes.
  4. Select either Extract and replace files or Extract and update files on tab Update and Overwrite all files.
  5. Enter a useful text for the user on tab Text and icon in edit field Text to display in SFX window which contains the information as in question so that the user can decide when pressing button Extract or Install and when pressing button Cancel on execution of the SFX archive.

Another possibility would be to enter on tab License a title and the question text as License text resulting in execution of the SFX archive that first the dialog is displayed with the "license text" being now the question with the buttons Accept and Decline.

The third possibility you have is creating a copy of the SFX you want to use with a different name and use a tool like free Resource Hacker to customize this SFX to your needs, i.e. change icons, bitmaps, text of buttons and position in dialog, size of the dialogs, etc. This is explicitly permitted as you can read in help of WinRAR on page with title GUI RAR and ZIP SFX modules (Default.SFX and Zip.SFX). You could for example redefine the layout of the license dialog to look similar to a question message box with the buttons Yes and No in your customized SFX. I used this solution for 2 applications which are installed/updated with a WinRAR SFX archive and it is really quite easy to create such a customized SFX using Resource Hacker.

0

To create an extract package & retain question box capability:

1: Create extract package just like you want it.

2: Using WinRar, edit comment file to add TempMode="Run App?","Example Title"

Example: TempMode="Install MyApp?","Vista ◦ MyApp 2.0 ◦ x32/64"

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.