How to build SVF2EXE

Post Reply
tong
Site Admin
Posts: 2386
Joined: Fri 01 May 2009 8:55 pm

How to build SVF2EXE

Post by tong »

SVF2EXE SVFtoEXE SVF2SFX SVFtoSFX
SVF2EXE.exe SVFtoEXE.exe SVF2SFX.exe SVFtoSFX.exe

-----

7-Zip Extra 18.01
7-Zip Extra is package of extra modules of 7-Zip.

7za.exe is reduced version of 7z.exe. formats support.
7za.exe supports only format with these codecs: Z, LZMA, CAB.

-----

LZMA SDK 18.01
LZMA Software Development Kit

7zr.exe is reduced version of 7za.exe.
7zr.exe supports only format with these codecs: LZMA, LZMA2, BCJ, BCJ2, ARM, Copy.

7-Zip for installers 9.38
7-Zip for installers is part of LZMA SDK.

7zSD.sfx is SFX module for installers. 7zSD.sfx uses msvcrt.dll.
The original 7zSD.sfx can't extract to the current folder. It's always extract to TEMP folder.

-----

The modified version 7zSD.sfx
1.6 develop (build 2712) December 30, 2012
https://olegscherbakov.github.io/7zSFX/
The modified version 7zSD.sfx can extract to the current folder. But it's very old.

-----

Example

7zr.exe a -mx=9 archive.7z *.*
copy /b 7zSD.sfx + config.txt + archive.7z installer.exe
tong
Site Admin
Posts: 2386
Joined: Fri 01 May 2009 8:55 pm

Re: How to build SVF2EXE

Post by tong »

1. Download smv.exe from http://www.smartversion.com/smartvs37.zip

2. Download 7zr.exe from https://www.7-zip.org/a/lzma1900.7z

3. Download 7zSD.sfx from https://olegscherbakov.github.io/7zSFX/files/7zsd_160_2712.7z

4. Modify 7zSD.sfx icon for the Windows 10 patcher. In this example, I rename to 7zSD_W10.sfx.

5. Modify 7zSD.sfx icon for the SVF2EXE utility. In this example, I rename to 7zSD_SVF.sfx.

6. SVF2EXE.cmd

Code: Select all

@echo off
color 1f

title SVF to SFX creation tool - L0L and murphy78 (Modified by Tong) 2018-03-21


dir /b %1\*.svf >NUL 2>NUL

IF %ERRORLEVEL% NEQ 0 (
echo.
echo -------------------------------------------------------------------------------
echo Unable to locate .SVF files in the current directory.
echo Press any key to exit, or close the window.
echo -------------------------------------------------------------------------------
pause>NUL
EXIT /b)

:CHOICE
set VERBOSE=0
echo.
echo -------------------------------------------------------------------------------
echo This script will create SFX patches for all SVF files in the current folder.
echo Option V is for Verbose output.
echo -------------------------------------------------------------------------------
choice /c YNV /N /M "Proceed ? (Y/N/V): "

IF %ERRORLEVEL% EQU 2 EXIT /b
IF %ERRORLEVEL% EQU 3 set VERBOSE=1

FOR %%i IN (%1\*.svf) DO (

echo.
echo -------------------------------------------------------------------------------
echo Creating .7z file for %%~ni.svf
echo -------------------------------------------------------------------------------
IF %VERBOSE% EQU 0 (
7zr.exe a -m0=copy "%%~ni.7z" "%%i" "smv.exe" >NUL 2>NUL
)

IF %VERBOSE% EQU 1 (
7zr.exe a -m0=copy "%%~ni.7z" "%%i" "smv.exe"
)

echo.
echo -------------------------------------------------------------------------------
echo Creating .exe file for %%~ni.7z
echo -------------------------------------------------------------------------------
echo ;!@Install@!UTF-8! > config.txt
echo InstallPath="%%%%S" >> config.txt
echo ExecuteFile="smv.exe" >> config.txt
echo ExecuteParameters="x \"%%~ni.svf\" -br \"%%%%S\"" >> config.txt
echo Delete="smv.exe" >> config.txt
echo Delete="%%~ni.svf" >> config.txt
echo ;!@InstallEnd@! >> config.txt

IF %VERBOSE% EQU 0 (
copy /b 7zSD_W10.sfx + config.txt + "%%~ni.7z" "%%~dpni.exe" >NUL 2>NUL
)

IF %VERBOSE% EQU 1 (
copy /b 7zSD_W10.sfx + config.txt + "%%~ni.7z" "%%~dpni.exe"
)

echo.
echo -------------------------------------------------------------------------------
echo Cleanup the config.txt and %%~ni.7z
echo -------------------------------------------------------------------------------
IF %VERBOSE% EQU 0 (
if exist config.txt del /q /s "config.txt" >NUL 2>NUL
if exist %%~ni.7z   del /q /s "%%~ni.7z"   >NUL 2>NUL
)

IF %VERBOSE% EQU 1 (
if exist config.txt del /q /s "config.txt"
if exist %%~ni.7z   del /q /s "%%~ni.7z"
)

)

echo.
echo -------------------------------------------------------------------------------
echo Process complete. Press any key to exit.
echo -------------------------------------------------------------------------------
pause>NUL
exit /b
7. config.txt

Code: Select all

;!@Install@!UTF-8!
Progress="no"
ExecuteFile="SVF2EXE.cmd"
ExecuteParameters="\"%%S\""
;!@InstallEnd@!
8. make.bat

Code: Select all

7zr.exe a -mx=9 SVF2EXE.7z 7zr.exe 7zSD_W10.sfx SVF2EXE.cmd smv.exe
copy /b 7zSD_SVF.sfx + config.txt + SVF2EXE.7z SVF2EXE.exe
Post Reply