Jump to content

Welcome to MSFN Forum
Register now to gain access to all of our features. Once registered and logged in, you will be able to create topics, post replies to existing threads, give reputation to your fellow members, get your own private messenger, post status updates, manage your profile and so much more. This message will be removed once you have signed in.
Login to Account Create an Account



Photo

How to make a 7-Zip Switchless Installer

* * * * * 3 votes

  • Please log in to reply
287 replies to this topic

#1
keytotime

keytotime

    Advanced Member

  • Member
  • PipPipPip
  • 400 posts
  • Joined 05-October 04
  • 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.
    Posted Image
  • You can make the archive name to whatever you want it to be. Set the compression level to Ultra.
    Posted 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.
    Posted 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:
    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.
    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:
    ;!@Install@!UTF-8!
    RunProgram="program.exe –switch"
    ;!@InstallEnd@!
    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:
    ;!@Install@!UTF-8!
    RunProgram="msistub program.msi /qb-!"
    ;!@InstallEnd@!
    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.
    Posted Image
  • The folder should now look something like this:
    Posted Image
  • Open a command prompt. CD to the folder. Then enter the following command:
    copy /b 7zs.sfx + config.txt + (whatever the archive name).7z (Installer_Name).exe
    Posted Image
That's it, you're done. Try it out.


Thanks Mavericks choice and RyanVM. Added .msi information.

Attached Files


Edited by keytotime, 06 November 2005 - 09:18 AM.



How to remove advertisement from MSFN

#2
Bâshrat the Sneaky

Bâshrat the Sneaky

    aka Wim Leers

  • Member
  • PipPipPipPipPipPipPipPip
  • 2,214 posts
  • Joined 29-October 03
  • OS:none specified
  • Country: Country Flag
Very clear guide!

Bâshrat the Sneaky has added a bookmark!

#3
Astalavista

Astalavista

    MSFN loyalist

  • Member
  • PipPipPipPipPipPipPipPipPip
  • 3,338 posts
  • Joined 02-December 03
excellent!

why do u need this?

"msiexec /i program.msi /qb-!\""

what is the purpose of the msiexec?

i hv several msi installers and i never use this and it still works.

#4
keytotime

keytotime

    Advanced Member

  • Member
  • PipPipPip
  • 400 posts
  • Joined 05-October 04
@ Astalavista, a .msi is an install package that calls on msiexec. msiexec /i tells windows to install the .msi. Since 7-zip can not call on msiexec directly we need StartX to call on msiexec for us. Type in msiexec /? at run to see more.

#5
Astalavista

Astalavista

    MSFN loyalist

  • Member
  • PipPipPipPipPipPipPipPipPip
  • 3,338 posts
  • Joined 02-December 03
thanks keytotime for explaining that to me.

i use a quick batch file converter to make my "Installer.exe"

remember u told me i dont hv to use it anymore.

My Installer.exe is much smaller than StartX.exe and i can put multiple
commands in it. Just like evilvoice's method.

good job man... great to hv a new guide to help everyone make their own
7zip applications. Hopefully we will be seeing a rise in pre 7zip applications in the future.

#6
keytotime

keytotime

    Advanced Member

  • Member
  • PipPipPip
  • 400 posts
  • Joined 05-October 04
I used startx becuase it is free and i know that o some machines batch files converted using quick batch file coverter does not work. My machine being one of them :whistle: . Also startx compressed with upx is 90Kb while your installer.exe for office is 144. I atached the compressed startx in my original post.

#7
Astalavista

Astalavista

    MSFN loyalist

  • Member
  • PipPipPipPipPipPipPipPipPip
  • 3,338 posts
  • Joined 02-December 03
Actually i did not upx my installer.exe

if i did it would only be 80kb

thanks for reminding me. i will update it now

#8
keytotime

keytotime

    Advanced Member

  • Member
  • PipPipPip
  • 400 posts
  • Joined 05-October 04
bah this is retarded, we're arguing over 10kb. Startx is free and works better than qbf for me. A for the multiple commands. That why we can do

REG ADD %KEY%\020 /VE /D "Symantec Antivirus 9.3" /f
REG ADD %KEY%\020 /V 1 /D "%CDROM%\Apps\sav.exe" /f
REG ADD %KEY%\020 /V 2 /D "REGEDIT /S %CDROM%\Apps\1.reg" /f

#9
Astalavista

Astalavista

    MSFN loyalist

  • Member
  • PipPipPipPipPipPipPipPipPip
  • 3,338 posts
  • Joined 02-December 03
I agree if u dont hv quick batch file converter, startX.exe is for you.

#10
Derkan

Derkan

    Newbie

  • Member
  • 12 posts
  • Joined 15-January 05
There is an MSI installer of 7-zip? I was actually looking for one a few days ago but didn't find anything. Not on the official site, not somewhere else. Maybe it's in the new beta, but I can't extract or test that file without getting an error that it's unsupported and the process cancelling.

Can you shed some light on this?

#11
keytotime

keytotime

    Advanced Member

  • Member
  • PipPipPip
  • 400 posts
  • Joined 05-October 04
This is a tutorial how to make a switchless for any program using 7-Zip. The new 7-zip uses /S.

#12
Derkan

Derkan

    Newbie

  • Member
  • 12 posts
  • Joined 15-January 05
For, not of. Got it. :) Anyway, I've got this thread bookmarked. :D

#13
moo

moo

    Junior

  • Member
  • Pip
  • 86 posts
  • Joined 29-July 04
Nice and clear guide!
I think that admin schould bookmark it in point of interests, because similar guide was published on this site long time ago, but was lost.

@Astalavista
And keytotime right about the StartXP - it always works, plus free. Btw, why do you use it if your applications better when repacked switcheless acrobat7?
regards, moo

#14
Astalavista

Astalavista

    MSFN loyalist

  • Member
  • PipPipPipPipPipPipPipPipPip
  • 3,338 posts
  • Joined 02-December 03
moo u must be mistaken i dont use it. u can't check my latest Adobe Acrobat build.

#15
moo

moo

    Junior

  • Member
  • Pip
  • 86 posts
  • Joined 29-July 04
@astalavista
boom...
sorry man and thanks for good job too on another posts.
moo

#16
Astalavista

Astalavista

    MSFN loyalist

  • Member
  • PipPipPipPipPipPipPipPipPip
  • 3,338 posts
  • Joined 02-December 03
no problem moo moo.

#17
Mekrel

Mekrel

    Advanced Member

  • Member
  • PipPipPip
  • 372 posts
  • Joined 17-November 04
I got a problem, nice guide though :)

the problem is this

Im converting all my WinRAR SFX installers to 7-Zip SFX installer, and im using 7-Zip on some Install Shield installers.

One of them is Anti virus Kit 2004 from GData, and I had it installing fine before with the switches i use in the config.txt which is saved with UTF-8 encoding like stated in the guide.

;!@Install@!UTF-8!
RunProgram="Setup.exe -s -f2\"%systemdrive%\avk.log\""
;!@InstallEnd@!

The setup.iss is in the archive aswell, and being as its ran from %CDROM% variable, it needs to have the avk.log assigned to it too according to the unattended guide made by Allanol.

Any ideas?
AMD64 Opteron 146 300*10 | OCZ Platinums Rev2 5/6 1T 2.5-3-3-5 @ 2.8v | DFI NF4 SLI-DR | X1800XL @ XT | X-Mystique 7.1 Soundcard | 2*36Gb Raptor Raid0 | NEC DVD-Rw | Tagan TG580-U15 PSU | Lian-Li PC7SE | Viewsonic VP171s

#18
batman75

batman75

    Alive and kicking

  • Member
  • Pip
  • 58 posts
  • Joined 12-December 04
Excellent Tut.
Thanks for the work

#19
Rico.JohnnY

Rico.JohnnY

    Member

  • Member
  • PipPip
  • 246 posts
  • Joined 02-June 04
  • OS:Windows 7 x64
  • Country: Country Flag
Is it possible to run multiple commands in config.txt?

For example, applying reg tweak after running setup.exe

#20
Mekrel

Mekrel

    Advanced Member

  • Member
  • PipPipPip
  • 372 posts
  • Joined 17-November 04

Is it possible to run multiple commands in config.txt?

For example, applying reg tweak after running setup.exe

<{POST_SNAPBACK}>


Well for the problem i posted above, I have sorted it using a .cmd file.

Seems to you cant run a installer which needs. iss from the config.txt.

So to do what you want make a .cmd and include it in the Archive.7z

setup.exe /switch /anotherswitch
/wait REGEDIT settings.reg

Then call the .cmd file from config.txt
AMD64 Opteron 146 300*10 | OCZ Platinums Rev2 5/6 1T 2.5-3-3-5 @ 2.8v | DFI NF4 SLI-DR | X1800XL @ XT | X-Mystique 7.1 Soundcard | 2*36Gb Raptor Raid0 | NEC DVD-Rw | Tagan TG580-U15 PSU | Lian-Li PC7SE | Viewsonic VP171s

#21
keytotime

keytotime

    Advanced Member

  • Member
  • PipPipPip
  • 400 posts
  • Joined 05-October 04
Updated the guide to make it clearer.

#22
Astalavista

Astalavista

    MSFN loyalist

  • Member
  • PipPipPipPipPipPipPipPipPip
  • 3,338 posts
  • Joined 02-December 03
It keeps getting better and better keytotime. Posted Image

#23
FrankE9999

FrankE9999

    Member

  • Member
  • PipPip
  • 115 posts
  • Joined 16-March 04

I got a problem, nice guide though :)

the problem is this

Im converting all my WinRAR SFX installers to 7-Zip SFX installer, and im using 7-Zip on some Install Shield installers.

One of them is Anti virus Kit 2004 from GData, and I had it installing fine before with the switches i use in the config.txt which is saved with UTF-8 encoding like stated in the guide.

;!@Install@!UTF-8!
RunProgram="Setup.exe -s -f2\"%systemdrive%\avk.log\""
;!@InstallEnd@!

The setup.iss is in the archive aswell, and being as its ran from %CDROM% variable, it needs to have the avk.log assigned to it too according to the unattended guide made by Allanol.

Any ideas?

<{POST_SNAPBACK}>



Try ising the /SMS switch with the setup. Note this switch should be upper case as shown. RunProgram="Setup.exe -s -SMS -f2\"%systemdrive%\avk.log\""

Install Shield Command Line Parameters
http://zacky.cleveri.../is_cmdline.htm

MSI Online Commandline Generator ("CleverMSI-OCG")
http://zacky.cleveri...msi_cmdline.htm

#24
Mekrel

Mekrel

    Advanced Member

  • Member
  • PipPipPip
  • 372 posts
  • Joined 17-November 04
Thats for network usage though, anyway i sorted it running it from a batch which aint a biggie.
AMD64 Opteron 146 300*10 | OCZ Platinums Rev2 5/6 1T 2.5-3-3-5 @ 2.8v | DFI NF4 SLI-DR | X1800XL @ XT | X-Mystique 7.1 Soundcard | 2*36Gb Raptor Raid0 | NEC DVD-Rw | Tagan TG580-U15 PSU | Lian-Li PC7SE | Viewsonic VP171s

#25
FrankE9999

FrankE9999

    Member

  • Member
  • PipPip
  • 115 posts
  • Joined 16-March 04
With 7Zip the files are extracted to the temp folder, the setup.exe is run and then the files are removed from the temp folder. The SMS option prevents setup.exe from returning before all child process have completed. This way your files aren't deleted until your install finishes.




2 user(s) are reading this topic

1 members, 1 guests, 0 anonymous users


    suchthefool