7zip Silent Install Creator

dbdawn

New Member
Reaction score
9
A user asked in another post for a free self-extracting compression program for packaging his remote support exe files.

I will show you my method for creating 7zip self extracting exe's.

Here is my folder layout.



1. Download 7zSD. Extract and place the 7zsd.sfx in the folder.
2. Download the latest 7za***.zip (where *** is the version number). Extract and place only the 7za.exe in the same folder as 7zSD.
3. Download UPX, extract and place only the upx.exe in the folder where 7zSD and 7za are placed.
4. Make a subdirectory with the name Bin and copy all your installation files to it. I usually create install.bat and use that to pass parameters to the installer.
5. Create a Config.txt in the same folder as 7zSD, 7za and UPX.

Config.txt
;!@Install@!UTF-8!
GUIMode="2"
Title="Program"
Directory=""
RunProgram="isntall.bat"
;!@InstallEnd@!

Create.cmd
upx --ultra-brute 7zsd.sfx
cd Bin
..\7za a -mx=9 "..\Program.7z" *
cd ..
copy /b 7zsd.sfx + Config.txt + Program.7z Program_Name.exe
del Program.7z

upx.cmd
upx --ultra-brute 7zsd.sfx

More info.
 
Last edited by a moderator:
7-zip has that feature already. Just create an archive and check the 'create SFX archive' to create a self extrating .exe file. Am I wrong?
 
It has the self extracting file feature already built in, but you can't do a silent install that way from what I have found. Maybe I am doing something wrong?
 
Ya, I am still confused though. Most of my installers have switches that I pass to the .exe or .msi and I do that by putting them in a .bat and calling that .bat from the self extracting 7zip archive. I think my method is easier, lol.
 
What is the code in the install.bat file?

And in your directory, where did the 7zS.sfx file come from?
 
Last edited:
What is the code in the install.bat file?

And in your directory, where did the 7zS.sfx file come from?

7zS.sfx is part of the "extra" downloads on the site.

Example contents of the install.bat, the following is a customized Adobe reader install.
start /wait msiexec /i AcroRead.msi ALLUSERS=2 EULA_ACCEPT=YES REBOOT=ReallySuppress /qn

rem Do not start anything unless necessary
reg delete HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Run /f /v "Adobe Reader Speed Launcher"
reg delete HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Run /f /v "Adobe ARM"

rem Turn off automatic updates
reg add "HKLM\Software\Adobe\Adobe ARM\1.0\ARM" /f /v iCheck /t REG_DWORD /d 0

rem Disable Acrobat.com services
reg add "HKLM\Software\Adobe\Acrobat Reader\10.0\Workflows" /f /v bEnableAcrobatHS /t REG_DWORD /d 0
reg add "HKLM\Software\Adobe\Adobe ARM\1.0\ARM" /f /v iCheck /t REG_DWORD /d 0

rem Remove desktop shortcuts
for /f "tokens=3*" %%i IN ('reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion" /v ProductName ^| Find "ProductName"') DO set vers=%%i %%j

echo %vers% | find "XP" > nul
if %ERRORLEVEL% == 0 goto xp

echo %vers% | find "Windows 7" > nul
if %ERRORLEVEL% == 0 goto win7

:XP
del "%AllUsersProfile%\Desktop\Adobe Reader X.lnk"

:win7
del "%Public%\Desktop\Adobe Reader X.lnk"

echo.
echo.
echo Adobe Reader 10 is now installed.
 
Last edited by a moderator:
Back
Top