WinCert.net Forums: [Tutorial] Making A 7-Zip Switchless Installer - WinCert.net Forums

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

[Tutorial] Making A 7-Zip Switchless Installer New Updated by arco

#1 User is offline ricktendo64 

  • Group: Banned Members
  • Group: Global Mods
  • Posts: 5,662
  • Joined: 09-August 06
  • Location:La Ceiba
  • OS:Windows 7

Posted 25 October 2007 - 07:20 PM

Time for a new Tutorial. At first there are new versions of all the stuff that's needed. Secondly are there much improvements and is there an easier way to make a 7-Zip Installer now. Third: I think most people don't know this all.

Tutorial:
1. Download the right 7zSD (always linked to latest version). Extract and place the 7zsd.sfx in a new folder.
2. Go to here and download the 7za***.zip (where *** is the version number) from the latest 7-Zip command line version. Extract and place only the 7za.exe in the same folder as 7zSD.
3. Download UPX here. 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 installation files to.
5. If you want, you can change the icon of the installer by replacing the icon in 7zsd.sfx using ResHacker as described here.
6. You can also change the version info of the executable using ResHacker. Go to the folder Version Info in ResHacker by opening 7zsd.sfx and rename the values of "CompanyName" and "FileDescription".
7. Create a Config.txt in the same folder as 7zSD, 7za and UPX.

Open it and set:

Quote

RunProgram="program.exe -switch"

Replace program.exe with the name of your installer (including the extension). Replace -switch with the desired switch(es) to be used. Many switches of different programs can be found here.

For a full silent 7-Zip install you add:

Quote

GUIMode="2"

It's not needed any more to add StartX.exe, msistub.exe or other supplementary tools. Then "waiting" is enabled by default for 'RunProgram=', unless 'nowait:' parameter is used. Also reg-files aren't needed any more. They can be configured in the Config.txt.

For a Register Entry (If you use a lot of Register Entries it's smart to use the parameter SetEnvironment to save time):

Quote

RunProgram="hidcon:cmd Register Entry"

Keep this in mind: you MUST use DOUBLE backslashes (\\) wherever you normally use backslashes (\) (e.g. in paths or dialog texts). Similarly, if the Value contains double quotes ("), you MUST precede them with a backslash (\").

Now, your Config.txt looks like this:

Quote

;!@Install@!UTF-8!
GUIMode="2"
RunProgram="program.exe -switch"
RunProgram="hidcon:cmd Register Entry"
;!@InstallEnd@!

You can add, edit and remove lines if you want.

* All available configuration parameters and other helpful information can be found here (site is just translated from Russian to English).

8. Save Config.txt with UTF-8 encoding by selecting "UTF-8" from the dropdown menu in the "Save As..." dialog in Notepad.
9. Make a Create.cmd in the same folder as the Config.txt and past the following:
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

10. Rename Program_Name to your own program name and run your Create.cmd.
11. Congratulations: you have guaranteed the littlest 7-Zip Installer as possible.

Tool:
Utility that can extract 7z archive and config file (Config.txt) as well as SFX module (7zsd.sfx) from 7z SFX archive. It has the name 7z SFX Archive Splitter (from the 7z SFX creator) and you can download it here (always linked to latest version).

EnJoy. :D
1

#2 User is offline DarkNite 

  • Lurker
  • Pip
  • Group: Members
  • Posts: 3
  • Joined: 10-April 07
  • Location:Purgatory

Posted 07 November 2007 - 10:56 AM

Thank you! That was much easier for me than the last time I made one. :)
0

#3 User is offline DEViANCE 

  • Advanced Member
  • PipPipPip
  • Group: Members
  • Posts: 58
  • Joined: 05-December 07
  • OS:Windows 7

Posted 07 December 2007 - 04:10 AM

This works great for me but i have a question, say i wanted to copy a file/folder from the bin directory to the install directory of the app after i had run the install.. how would i do that?? For example i have some updated NOD32 files i want to add after running the install (replacing out of date ones) so i don't have to download them again.
0

#4 User is offline ricktendo64 

  • Group: Banned Members
  • Group: Global Mods
  • Posts: 5,662
  • Joined: 09-August 06
  • Location:La Ceiba
  • OS:Windows 7

Posted 07 December 2007 - 04:50 AM

You can find manny examples on how to do that in the help file http://7zsfx.solta.r...parameters.html

Example:
;!@Install@!UTF-8!
GUIMode="2"
RunProgram="setup.exe /s"
RunProgram="hidcon:cmd /c xcopy FolderName \"%ProgramFiles%\\FolderName\" /s /e /i /y"
;!@InstallEnd@!

0

#5 User is offline DEViANCE 

  • Advanced Member
  • PipPipPip
  • Group: Members
  • Posts: 58
  • Joined: 05-December 07
  • OS:Windows 7

Posted 07 December 2007 - 06:55 AM

Thanks for the link and example! I tried that and it all worked well apart from ther are two files in the update folder "lastupd.var" ad "upd.var" its copying all the other files but those two are not getting over writen. could you kindly tell me how to delete/overwrite the two files, thanks ;-)
0

#6 User is offline ricktendo64 

  • Group: Banned Members
  • Group: Global Mods
  • Posts: 5,662
  • Joined: 09-August 06
  • Location:La Ceiba
  • OS:Windows 7

Posted 07 December 2007 - 01:43 PM

1st Try these other xcopy switches (to see more in the CMD prompt type xcopy /?)
;!@Install@!UTF-8!
GUIMode="2"
RunProgram="setup.exe /s"
RunProgram="hidcon:cmd /c xcopy FolderName \"%ProgramFiles%\\FolderName\" /s /e /i /y /h /r /k"
;!@InstallEnd@!


2nd If that does not work try to rename the files before xcopy
;!@Install@!UTF-8!
GUIMode="2"
RunProgram="setup.exe /s"
RunProgram="hidcon:cmd /c  ren \"%ProgramFiles%\\FolderName\\lastupd.var\" lastupd.bak"
RunProgram="hidcon:cmd /c  ren \"%ProgramFiles%\\FolderName\\upd.var\" upd.bak"
RunProgram="hidcon:cmd /c xcopy FolderName \"%ProgramFiles%\\FolderName\" /s /e /i /y /h /r /k"
;!@InstallEnd@!

0

#7 User is offline DEViANCE 

  • Advanced Member
  • PipPipPip
  • Group: Members
  • Posts: 58
  • Joined: 05-December 07
  • OS:Windows 7

Posted 07 December 2007 - 08:58 PM

Nice one, this code worked fine:

;!@Install@!UTF-8!
GUIMode="2"
RunProgram="setup.exe /s"
RunProgram="hidcon:cmd /c xcopy FolderName \"%ProgramFiles%\\FolderName\" /s /e /i /y /h /r /k"
;!@InstallEnd@!


I have now finished my first silent install and nlite addon now, thanks for your help ;-)

EDIT: can you please show me an example of how to add reg entries:

RunProgram="hidcon:cmd Register Entry"


I need to convert file this to the above format as it don't seem to work as a file:

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\Eset\Nod\CurrentVersion\Info]
"Build"="0x00002c76 (11382)"
"CurrentVersion"="2711 (20071207)"
"Date"="0x060c07d7 (101451735)"


The Build, and CurrentVersion need adding, the date needs updating. Sorry for all the questions.

EDIT: think i got it now:

RunProgram="hidcon:cmd REG ADD HKLM\SOFTWARE\Eset\Nod\CurrentVersion\Info /v Build /t REG_DWORD d/ 0x00002c76 (11382)"
RunProgram="hidcon:cmd REG ADD HKLM\SOFTWARE\Eset\Nod\CurrentVersion\Info /v CurrentVersion /t REG_SZ d/ 2711 (20071207)"
RunProgram="hidcon:cmd REG ADD HKLM\SOFTWARE\Eset\Nod\CurrentVersion\Info /v Date /t REG_DWORD d/ 0x060c07d7 (101451735) /f"


EDIT: sigh.. it don't seem to work if i do it from .reg file or config.txt... if i run the reg file or commands in windows it works.. why won't it work in the install?? What am i doing wrong?

This post has been edited by DEViANCE: 08 December 2007 - 12:29 AM

0

#8 User is offline Raoul 

  • WinCert Friend
  • PipPipPipPip
  • Group: Members
  • Posts: 278
  • Joined: 17-January 08
  • Location:The Netherlands
  • OS:Windows 7

Posted 12 May 2008 - 08:35 AM

I cant find any switches on de UAwiki?

I need switches for:
- CCleaner --> /S
- Raxco PerfectDisk --> /qn
- Foxit Editor


Doing it right like this? Only need to fill in switches, im new with those silent installers.

;!@Install@!UTF-8!
GUIMode="2"
RunProgram="ccsetup207.exe -switch"
;!@InstallEnd@!

This post has been edited by Raoul: 12 May 2008 - 10:22 AM

0

#9 User is offline ricktendo64 

  • Group: Banned Members
  • Group: Global Mods
  • Posts: 5,662
  • Joined: 09-August 06
  • Location:La Ceiba
  • OS:Windows 7

Posted 12 May 2008 - 01:16 PM

CMenu can find many switches

*Right Click* More Options->Installer Tools->Identify Installer
0

#10 User is offline loren 

  • Member
  • PipPip
  • Group: Members
  • Posts: 19
  • Joined: 02-May 08
  • OS:Windows XP Pro

Posted 24 October 2008 - 07:31 AM

http://www.uawiki.org/doku.php?id=silent_a...db%3a%6fverview

this url for switches is not available,could you give me the other one?

thanks
0

#11 User is offline loren 

  • Member
  • PipPip
  • Group: Members
  • Posts: 19
  • Joined: 02-May 08
  • OS:Windows XP Pro

Posted 24 October 2008 - 07:52 AM

and how to del any reg?
0

#12 User is offline YumeYao 

  • Member
  • PipPip
  • Group: Members
  • Posts: 25
  • Joined: 12-February 08
  • Location:Taiyuan, Shanxi Province, PR China
  • OS:Windows 7

Posted 24 October 2008 - 08:31 AM

use "REG DELETE HKxx\xxxx"
0

#13 User is offline ricktendo64 

  • Group: Banned Members
  • Group: Global Mods
  • Posts: 5,662
  • Joined: 09-August 06
  • Location:La Ceiba
  • OS:Windows 7

Posted 24 October 2008 - 03:49 PM

View Postloren, on Oct 24 2008, 01:52 AM, said:

and how to del any reg?
Will show you in my series of videos http://www.wincert.n...?showtopic=4659

Look inside SilentSwitchMaker you will find a CHM help file with an example of how to use REG DELETE with this, it goes something like this

RunProgram="InstallerName.exe /switch"
RunProgram="hidcon:reg delete \"hkcu\\Software\\Example\" /f"

0

#14 User is offline Gunso 

  • Lurker
  • Pip
  • Group: Members
  • Posts: 1
  • Joined: 08-November 08
  • OS:Windows XP Home

Posted 08 November 2008 - 01:49 PM

Sorry for the stupid question... looks very complicated and need a lot of utilities to create a 7z Switchless Installer using this method, why not use the AutoIt method then a create 7zSFX or RARSFX, size will be more or less the same?
0

#15 User is offline ricktendo64 

  • Group: Banned Members
  • Group: Global Mods
  • Posts: 5,662
  • Joined: 09-August 06
  • Location:La Ceiba
  • OS:Windows 7

Posted 08 November 2008 - 03:09 PM

View PostGunso, on Nov 8 2008, 07:49 AM, said:

Sorry for the stupid question... looks very complicated and need a lot of utilities to create a 7z Switchless Installer using this method, why not use the AutoIt method then a create 7zSFX or RARSFX, size will be more or less the same?

Heres a vid, will probably help explain a bit better

http://www.wincert.n...?showtopic=4659
0

#16 User is offline Geej 

  • WinCert Friend
  • Group: Platinum Sponsor
  • Posts: 237
  • Joined: 21-April 08
  • OS:Windows XP Pro

Posted 24 September 2009 - 04:48 AM

I have tried other GUI-based 7zfx maker. This commandline method suits me best. :D
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users