Where Customization Begins 

  • Making A 7-Zip Switchless Installer

 #671  by Razorsedge
 20 Dec 2009, 22:52
# Download and install the latest version of 7-Zip.
# Make a folder to copy all of the installation files to. If you are using a .msi include Msistub.exe in the folder. Make sure the installer name is under 8 character and has no spaces.
# Select all of them and right click on any file.
# Select "Add to archive...", which is under the select option.

Image

You can make the archive name to whatever you want it to be. Set the compression level to Ultra.

Image

# Hit OK. Once the archive is created, you can delete all files except the archive.
# Copy 7zs.sfx to the folder containing the archive. This one has no cancel button.
# If you want, you can change the icon of the installer by replacing the icon in 7zS.sfx using ResHacker. For example, you can use the icon from the main program. Remember to save 7zS.sfx when you're finished

Image

# In order to get rid of the cancel button and the close button, go to Dialog→500→1033. Select all then paste in this code:
Code:

Code: Select all    500 DIALOG 0, 0, 186, 26
    STYLE DS_FIXEDSYS | DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_CAPTION
    CAPTION "Progress"
    LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
    FONT 8, "MS Shell Dlg"
    {
       CONTROL "Progress1", 1000, "msctls_progress32", PBS_SMOOTH | WS_CHILD | WS_VISIBLE | WS_BORDER, 7, 7, 172, 14
    }


In order to get rid of everthing paste in this code.
Code:

Code: Select all  500 DIALOG 0, 0, 0, 0
    STYLE WS_POPUP
    CAPTION "Progress"
    LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
    FONT 8, "MS Shell Dlg"
    {
    }


Select compiles and then save
# Open Notepad and add the following:
Code:

Code: Select all   ;[email protected]@!UTF-8!
    RunProgram="program.exe –switch"
    ;[email protected]@!


Replace program.exe with the name of your installer (including the extension). Replace -switch with the desired switch(es) to be used. You can also use a .cmd.

If you are using a .msi package you will need to use Msistub.exe. Msistub.exe will have to be inside the archive. The code for config.txt will be:
Code:

Code: Select all    ;[email protected]@!UTF-8!
    RunProgram="msistub program.msi /qb-!"
    ;[email protected]@!


Where program.msi is the name of the msi. You can use /qb-! for an install with a progress screen and /qn for a install with no screen.
# Save as config.txt with UTF-8 encoding by selecting "UTF-8" from the dropdown menu in the "Save As..." dialog in Notepad. Save it to the same folder as 7zS.sfx and the 7z archive.

Image

The folder should now look something like this:

Image

12. Open a command prompt. CD to the folder. Then enter the following command:
Code:

Code: Select all copy /b 7zs.sfx + config.txt + (whatever the archive name).7z (Installer_Name).exe


Image

That's it, you're done. Try it out.
Thanks Mavericks choice and RyanVM. Added .msi information.
 #1216  by nice_guy75
 01 Jan 2010, 01:21
Thanks man you are really a life saver, I was having problem with iconpackager, as the one I have is not a silent installer exe and now with the help of this tutorial I would make a silent installer.

Hey brother what is dictionary size in the first screenshot, here you set 32mb and when I tried the default was 64 mb I had to set it to 32 mb, can you please explain what it does and what should I use 32mb or 64mb?????????????
 #1224  by Angel
 01 Jan 2010, 12:35
The higher dictionary size means the better compression, but it is slower and needs more memory.

I always leave it at 64MB.