• Announcements

    • xper

      MSFN Sponsorship and AdBlockers!   07/10/2016

      Dear members, MSFN is made available via subscriptions, donations and advertising revenue. The use of ad-blocking software hurts the site. Please disable ad-blocking software or set an exception for MSFN. Alternatively, become a site sponsor and ads will be disabled automatically and by subscribing you get other sponsor benefits.
keytotime

How to make a 7-Zip Switchless Installer

288 posts in this topic

ok... newbie question coming up... :thumbup

Righty, so my installer has been made (happy days), it all works fine, BUT, where in the folder hierachy for my unattended CD does it go?

Appologies for the horrendous question, but its wednesday and i'm tired!

Jonny :unsure:

0

Share this post


Link to post
Share on other sites

I simply follow the great MSFN unattended guide's RunOnceEx section :

http://unattended.msfn.org/unattended.xp/view/web/31/

So inside your 'XPCD\$OEM$' folder, then make a new folder named '$1' and everything you place in there will be copied to '%systemdrive%' during installation. Then make a new folder in 'XPCD\$OEM$\$1' called e.g. 'install'(you can also make another one called e.g. drivers) and then place all your apps in there + a 'cleanup.cmd' file which amongst other command also includes 'rd /s /q %systemdrive%\install' at the end, so that the '%systemdrive%\install' directory is deleted. Also follow the above linked guide to make yourself a 'RunOnceEx.cmd' file and place it in the 'XPCD\$OEM$' folder and add "RunOnceEx.cmd' to your 'cmdlines.txt' file right under [COMMANDS].

Alternatively, you can make the switchless installers into nLite addons instead and add them as hotfixes, but personally i preffer the above solution...

CU, Martin.

Edit: Corrected 'Additionally' to 'alternatively'.

Edited by Martin H
0

Share this post


Link to post
Share on other sites

thanks for your fast and knowledgeable reply martin!

Few questions,

After following the 7Zip installer method, im left with a file called dotnetfx.exe (for example) is that the app that has to be run through RunOnceEx?

Also, is RunOnceEx the only way to install switchless installers, or is there another way?

Cheers again

Jonny

Sorry, is there no way to call it from cmdlines.txt directly and not have to use runonceex?. appologies for being a berk!

Edited by tech_boy
0

Share this post


Link to post
Share on other sites

You can instead use the GuiRunOnce method for installing apps and which is a little easier than the RunOnceEx method(but a little less professional looking during install). You then remove the 'RunOnceEx.cmd' from your 'cmdlines.txt' and instead add the following to your 'winnt.sif' file :

[GuiRunOnce]

%systemdrive%\install\start.cmd

Then place all your apps/switchless installers into a folder you create called: 'XPCD\$OEM$\$1\install\'. Then you create a batch file which installs all the apps and name the batch file 'start.cmd' and also place it in the 'XPCD\$OEM$\$1\install\' folder.

Please read MSFN's 'Unattended Windows' guide, so that you will understand the basics a litttle better :

http://unattended.msfn.org/unattended.xp/sitemap

CU, Martin.

Edit: Sorry, i apologise for being off-topic...

Edited by Martin H
0

Share this post


Link to post
Share on other sites

Just in case someone didn't knew it, then Oleg_Sch has made a modified version of the 7-Zip SFX installer module, which e.g. gives the possibility of hidding the extraction dialog completely, so that the installation will become totally silent. This is done by adding 'GUIMode="2"' to 'config.txt'.

It's from the same guy which also gave us the two other great tools 'hidcon.exe' and 'msistub.exe'.

http://7zsfx.solta.ru/en/

CU, Martin.

Edited by Martin H
0

Share this post


Link to post
Share on other sites

I have just read up on the docs for the modified 7-Zip SFX installer module and i'm just blown away of how cool it's been made now :)

There are a bunch of commands that can be used in 'config.txt', but most notably, then '.msi' files can be run from 'RunProgram=', so 'msistub.exe' isn't needed anymore.

The console window can be completely hidden if adding the parameter 'hidcon:' to 'RunProgram=', like this : RunProgram="hidcon:setup.cmd", so 'hidcon.exe', 'hidec.exe' and 'cmdow.exe' and the likes isn't needed anymore either.

Finally, then "waiting" is enabled by default for 'RunProgram=', unless 'nowait:' parameter is used, so 'startX.exe' is also not needed anymore.

These examples are all from the latest beta linked to in my previous post.

CU, Martin.

0

Share this post


Link to post
Share on other sites

ok, im completely noob i guess. im pretty good at computers, but im completely new to this. . heres how i interpret this. any help is appreciated. i have read all 11 pages of this.

making winrar 3.7:

1. make the archive - i used universal extractor to extract the .exe and then archived them

made file: winrar.7z

2. from reading i gathered i could use the newest .sfw thinger

downloaded file: 7zSD.sfx

3. make notepad file save in UTF8

file has:

;!@Install@!UTF-8!

RunProgram="winrar.exe /s" (i have no idea what executable it wants. so i assume the final one you make from the 3 files)

GUIMode="2"

;!@InstallEnd@!

4. folder has 3 files now

5. open command prompt CD to folder

type/run : copy /b 7zsd.sfx + config.txt + winrar.7z winrar.exe

then i go and to Run As. im an administrator. and i get "could not open archive file (target file here) access is denied"

so i uncheck the protect my computer box on the run as and do it again. it opens up WinRAR. which is installed already and an old version.

0

Share this post


Link to post
Share on other sites

Sorry, i don't know what the problem is and i also don't know why you need to make extra "run as" changes if your user account has admin rights to begin with, but atleast i can answer this question of yours :

RunProgram="winrar.exe /s" (i have no idea what executable it wants. so i assume the final one you make from the 3 files)

It's the '.exe' or '.cmd' file which you want to have loaded after the '.7z' archive has been extracted, so if you have a folder with: '7ZSD.sfx', 'config.txt' and 'archive.7z', then it's the installation program, or batch file which is packed inside the 7z archive. Basically, what happens is that the '7ZSD.sfx' module will unpack the 7z archive into your Windows Temp folder and then it will look in the 'config.txt' file to see which file you want to have loaded from the newly unpacked 7z archive, which in your case is the 'winrar.exe' installer executable and with the extra '/s' switch to make the installation silent/unattended.

Sorry that i couldn't be of more help, though - but i just thought that i would explain what exactly happens, so that you would understand the answer to your question.

CU, Martin.

Edit: Ahh, i thought that i did remember that the WinRAR installer executable was called 'wrar.exe' or something and not 'winrar.exe' and so i have just downloaded the latest version(WinRAR v3.7b8) to check the name of it(i personally have converted to 7-Zip for all packing/unpacking jobs) and sure enough, it was called 'wrar37b8.exe', so unless you have renamed the installer executable, then this should be the reason why you're having problems :)

Edited by Martin H
0

Share this post


Link to post
Share on other sites

Thank you so much Martin. I think some of that should maybe be incorporated into the first post. I now have a silent installing WinRAR.

0

Share this post


Link to post
Share on other sites

You are very welcome, my friend :)

CU, Martin.

0

Share this post


Link to post
Share on other sites

Ghost's SFX-GUI for creating 7-zip SFX setups - Update 1.5

*Added Drag and drop

**Fixed some bugs

:thumbup

This is a GUI for creating Automated SFX - Archives with setup command! You can visit my website to download it. You can find it in URL REMOVED >> My Shared Downloads<<!

URL's REMOVED - YOU CANNOT LINK TO SITES THAT LEAD TO WAREZ

v1.4 7zs_sfx.exe.exe

Edited by Shark007
removed URL's - edit post accordingly
0

Share this post


Link to post
Share on other sites

I'm a little confused. well thats because i'm totaly new in creating unattended windows cd's. I read keytotime's guide about how to create swichless installer (don't even know what that is), and didn't really understood what to do. could someone please help with a little more detailed version about how to create switchless installer??

0

Share this post


Link to post
Share on other sites
I'm a little confused. well thats because i'm totaly new in creating unattended windows cd's. I read keytotime's guide about how to create swichless installer (don't even know what that is), and didn't really understood what to do. could someone please help with a little more detailed version about how to create switchless installer??

Why would you want to make a switchless installer, if you don't even know what it is? :unsure:

Creating an unattended installation disc does not require you to make any installers for other software, unless you want to include those in your whole installation process. May I suggest simply creating an unattended installation disc first, before looking into installing any other software unattendedly via silent, switchless installers? Once you have created an unattended installation disc which installs to your liking, you can always still add other software to your installation process. The tutorials posted on this forum, on the main web site and on RyanVM's forum are all very clear. Perhaps once you know how to create an unattended installation disc, these tutorials will be more clear to you.

0

Share this post


Link to post
Share on other sites

Keytime's guide is a little old. Take a look at my new tutorial here. If you want help: just ask.

0

Share this post


Link to post
Share on other sites

excuse me guyes ... i have a problem .. i make 7zip files according the procedure define earlier ..than make it cab file .. but as the windows in last stage there is a msg "7.zip The System Cannot fine the file" can any one help me ?

0

Share this post


Link to post
Share on other sites
Post your config.txt file you used.

here is the for silent install and after making exe file of silent install i used this procedure

ADDON METHOD

Copy and paste [between the lines] into Notepad

__________________

[general]

builddate=2006/11/25

description=

language=

title=

version=

website=

[EditFile]

I386\SVCPACK.INF,SetupHotfixesToRun,AddProgram

[AddProgram]

example.exe

____________________

Change example.exe with the actual switch-less installer name you are using

Save this file as Entries_exampleAddon.ini

Put the emample.exe into a folder named SVCPACK

use rar or 7zip to package the ini file and the svcpack folder together with the same name as the ini file

but nlite is not accepting the file for nero :o i dont know why i do same procedure for msn, itunes and winamp.. successfully added to my xp cd .. but in case of nero the error is as follows

Unsupported File

K:\Nero.7z

can't able to understand..

one thing i want to confirum my procedure .. for making silent install 1st i have to install the main exe file into a folder .. then zip it using 7zip. in ultra mode, and put it into a folder.. after it i have to copy a file named as 7zS.sfx and then write the config file as i upload it .. after it i used this command

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

and one exe file is created that is silent instell

kindly tell me is that procedure is right ? plz mention here my mistakes ..

config.7z

0

Share this post


Link to post
Share on other sites

You have your config file named config.TEXT!!! You need it to read config.txt...

Also you don't put the main files into a folder and the 7z that folder you just 7z all of the files like example2

Then you will be left with 3 files like in example 1

Edited by Kelsenellenelvian
0

Share this post


Link to post
Share on other sites

Hi,

this is a really cool thread - but all the information blew my mind away :blink:

I've got some questions that are nearly unsolvable for me as a noob, but maybe not for you guys :whistle:

1) I want to add files and the regarding subfolders to a 7z-archive, that are themselves contained in the subfolder "av8" - but without including this folder-prefix in the archive, meaning I want the archived files and folders to be in the root of the archive. This is my command:

7z a -t7z av8.7z -mx=9 av8\

How can I achieve that the files and subfolders are in the archive-root?

2) I want to make a silent(!) SFX-archive from this 7z-archive. ATM I'm doing this with WinRAR and the SFX-command

Path=%windir%\Temp\Avira
SavePath
Setup=hide.exe "%windir%\Temp\Avira\setup.cmd"
Silent=1
Overwrite=1

so that all files are unextracted to %windir%\Temp\Avira and after that the setup.cmd is called! This is my command:

copy /b 7zS.sfx + config.txt + av8.7z Avira_Antivir_8_Free_Silent.exe

and this is the config.txt:

;!@Install@!UTF-8!
RunProgram="hide.exe ""setup.cmd"""
;!@InstallEnd@!

Note that the command hide.exe needs the parameter "setup.cmd" in quotes (hide.exe is an AutoIt-file that hides the CMD-window).

Do you know what I'm doing wrong?

Best regards and thanks a lot in advance!!!

cool400 :ph34r:

0

Share this post


Link to post
Share on other sites

cool400 use the new 7zip method its much better, you can use multipple RunPrograms and it also has a built in hide CMD window

Here is an example on how to install a program and then copy the updated files after its installed

;!@Install@!UTF-8!
RunProgram="ir32_257_26021.exe /S"
RunProgram="hidcon:cmd /c tskill Ir"
RunProgram="hidcon:cmd /c copy /v /y Irremote.ini %WinDir%"
GUIMode="2"
;!@InstallEnd@!

Here is my 7-zip (the program) I reshack the icons after install to have a Vista look ;)

;!@Install@!UTF-8!
RunProgram="7z457.exe /S"
RunProgram="ResHacker -addoverwrite \"%ProgramFiles%\\7-Zip\\7z.dll\", \"%ProgramFiles%\\7-Zip\\7z.dll\", \"%%T\\7z.dll.res\",,,"
GUIMode="2"
;!@InstallEnd@!

You can do tons of new things, here is a updated tutorial

Also look at this help file, it has tons of examples on how to Reg Add, XCopy, Reg Del and lots of other things

http://7zsfx.solta.ru/en/examples.html

Edited by ricktendo64
0

Share this post


Link to post
Share on other sites
1) I want to add files and the regarding subfolders to a 7z-archive, that are themselves contained in the subfolder "av8" - but without including this folder-prefix in the archive, meaning I want the archived files and folders to be in the root of the archive. This is my command:

7z a -t7z av8.7z -mx=9 av8\

How can I achieve that the files and subfolders are in the archive-root?

First, i would just like to say that ricktendo64's advice about switching to Oleg Sch's modded 7z SFX module is very, very good advice indeed :thumbup

Second, then to answer your actual question, then you need to add the full path and a '*' to get 7-Zip to exclude the folder and only compress the files. 7-Zip's command-line interface is alittle different than standard Win32 CMD syntax, so '*.*' for 7-Zip, only reffers to files with an extension, whereas '*' is any file with and without an extension. Lastly, then the parameter '-t7z' is redundant, as it is the default used format. So, to recap, the complete command-line would be :

7z a -mx=9 av8.7z <path>\av8\*

0

Share this post


Link to post
Share on other sites

Thanks to both of you for your help!!! I really appreciate this :wub:

As I'm really willing to find things out myself I hate it to ask such questions - but I think I'm stuck again :no:

I followed Rick's advice and read tons of information about the modified 7-Zip SFX-module. I think I made a big step into the right direction, but it seems I'm missing something!

First I found out that the 7za.exe is not able to unzip EXE-files, especially the Avira Antivir Setup-EXE :huh: 7z.exe is able to do this - but what is the difference between these both files? I think I read the the 7za.exe contains the librarys and 7z.exe not - do I need any further files when using the 7z.exe? Are there any disadvantages?

I slightly modified the create.cmd this way:

cd av8
..\7z a -mx=9 "..\av8.7z" *
cd ..
copy /b 7zsd.sfx + config.txt + av8.7z Avira_Antivir_8_Free_Silent.exe
del av8.7z

Then I built a config.txt:

;!@Install@!UTF-8!
InstallPath="C:\\Windows\\Temp\\Avira"
RunProgram="basic\\setup.exe /inf=\"setup.inf\""
RunProgram="hidcon:cmd /c tskill avscan"
GUIMode="2"
;!@InstallEnd@!

The folder-structure looks like this:

[root]
7z.exe
7zsd.sfx
config.txt
-- [av8]
{files}
.
.
.
setup.inf
-- [basic]
{files}
.
.
.
setup.exe

When I open the Avira_Antivir_8_Free_Silent.exe first it seems that all went well, but when I take a look into the Antivir-logfile it say that the setup.inf has errors :blink:

This is really strange, because with exactly the same setup.inf it's no problem when using the WinRAR-SFX-methode!

This is my WinRAR-SFX-comment:

;Der folgende Kommentar enthält SFX-Skriptbefehle

Path=%windir%\Temp\Avira
SavePath
Setup=hide.exe "%windir%\Temp\Avira\setup.cmd"
Silent=1
Overwrite=1

After extracing the WinRAR-SFX to C:\Windows\Temp\Avira I call this command in the setup.cmd:

start /wait %windir%\Temp\Avira\basic\setup.exe /inf="%windir%\Temp\Avira\setup.inf"

...and it works - like I said with exactly the same INF-file!

Do you know what I did wrong with the 7-Zip-SFX-method that it not works like the WinRAR does?

Further I had a batch-file that automatically replaced the SFX-icon with a custom one:

reshacker.exe -addoverwrite Avira_Antivir_8_Free_Silent.exe, Avira_Antivir_8_Free_Silent.exe, av8.ico, icongroup,101,1033

But it seems that this destroys my SFX-file! Do you know why? I tried to manually replace the icon, but maybe I need another icon-file (format?).

Best regards and thanks a lot!

cool400 :ph34r:

0

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.