[Tutorial] avast! Home Edition 4.8.x switchless installer

Questions or comments on the switchless installers? Want to create a new one? Talk about it here.
Post Reply
User avatar
beats
Posts: 772
Joined: Tue Nov 27, 2007 4:11 am
Location: Netherlands

[Tutorial] avast! Home Edition 4.8.x switchless installer

Post by beats » Tue Nov 17, 2009 5:54 am

[Tutorial] avast! Home Edition 4.8.x switchless installer

This is a brief but foolproof tutorial to create localized switchless installers for Avast. First you'll have to download Avast in your preferred language. Mind that you need the offline installer; get "avast! Home Edition - [Your Language]". The setup files are about 37MB each.

Do not download the "Universal installation file", because this is a web-based installer.

Second, you'll have to order your free registration key. If you do not register avast, it will work for 60 days only. Avast stores it registration information in the registry location below (export this key to license.reg):

Code: Select all

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\ALWIL Software\Avast\4.0]
"RegData"=hex:ee,xx,xx,xx,xx,xx,xx,xx
Now that you have the required files, you can create the switchless installer. The easiest way to accomplish this, is to create a WinRAR SFX. If you don't have WinRAR, download it here. You may use it freely for 40 days. Copy avast.exe and the exported reg-file to a folder, for example C:\Temp. Browse to C:\Temp and select the avast installer and the reg-file. Right-click them and select "Add to archive". The WinRAR GUI will appear:

ImageImage

Select the General tab, give the archive a name (1), and check "Create SFX archive" (2).
Now select the Comment tab, and paste the code below in the "Enter a command manually" field (3):

Code: Select all

;The comment below contains SFX script commands

Title=avast! AntiVirus
Text
{
Installing avast! AntiVirus, please wait...
}
TempMode
Overwrite=1
Silent=1
Setup=Avast481356.exe /SILENT /SUPPRESSMSGBOXES /NORESTART /SP-
Setup=regedit.exe /s license.reg
Click OK (4). WinRAR will now build your localized and registered SFX

But I want an addon?!

If you want to make an addon of the Avast SFX, here is how to do it:

- If you followed the steps above you'll have an SFX named "Avast481356.exe" in "C:\Temp".
- Make a new folder named "svcpack" in "C:\Temp" and move "Avast481356.exe" in there.
- Copy/paste the code below to notepad and save it in "C:\Temp" as "entries_avast.ini":

Code: Select all

[General]
Title=avast Home Edition
Version=4.8.x
BuildDate=2009/11/17
Website=http://www.avast.com/

[EditFile]
I386\SVCPACK.INF,SetupHotfixesToRun,AddProgram

[AddProgram]
Avast481356.exe
- Right-click "entries_avast.ini" and the "svcpack" folder
- Select "Add to archive", name it "avast_4.8.x_addon.rar" for example, and click OK.
Last edited by beats on Tue Nov 17, 2009 4:09 pm, edited 2 times in total.

User avatar
5eraph
Site Admin
Posts: 4619
Joined: Tue Jul 05, 2005 9:38 pm
Location: Riverview, MI USA

Post by 5eraph » Tue Nov 17, 2009 8:12 am

Nice. Thank you for the registry information. :)

paulyboi
Posts: 22
Joined: Tue Feb 13, 2007 12:49 am
Location: Newcastle NSW Australia

Post by paulyboi » Thu Nov 19, 2009 2:43 am

For Info..
Avast 5.0 has been released in Beta.
Hopefully it won't be too long before general release.

User avatar
beats
Posts: 772
Joined: Tue Nov 27, 2007 4:11 am
Location: Netherlands

Post by beats » Thu Nov 19, 2009 4:00 am

Yes, I'm aware of v5 beta. I'll update the tutorial for v5 (if stuff changes) when it goes final.

yumeyao
Moderator
Posts: 1718
Joined: Sun Aug 27, 2006 9:24 pm
Location: Taiyuan, Shanxi, PR China

Post by yumeyao » Thu Nov 19, 2009 6:05 am

Ironically avast v5 beta is suggested on the Chinese homepage. I don't think most common Chinese users can provide positive feedback.
Image
My work list(Hosted by dumpydooby)

User avatar
beats
Posts: 772
Joined: Tue Nov 27, 2007 4:11 am
Location: Netherlands

Post by beats » Thu Nov 19, 2009 8:34 am

How come? Is it that bad? :o

zilan
Posts: 82
Joined: Fri Sep 04, 2009 12:49 am

Post by zilan » Mon Nov 23, 2009 9:37 pm

i have export avast registry key but when i run avast for first time, it ask to enter license key? what's wrong?

User avatar
beats
Posts: 772
Joined: Tue Nov 27, 2007 4:11 am
Location: Netherlands

Post by beats » Fri Nov 27, 2009 4:43 pm

No idea what's wrong zilan, and ELiTE uses the reg-file method too, see this thread:
http://www.ryanvm.net/forum/viewtopic.php?t=7849

paulyboi
Posts: 22
Joined: Tue Feb 13, 2007 12:49 am
Location: Newcastle NSW Australia

Post by paulyboi » Tue Jan 19, 2010 8:34 pm

Hi beats,

News today.....from Avast website.....

http://blog.avast.com/2010/01/19/avast- ... 0-is-here/

Avast! Version 5.0 is here!!!
Today is the big day—the day we (and many of you) have been waiting for—we are starting the release of the Version 5.0 products today. This is a pretty complicated roll-out so we are staging it. Today we will be releasing the new products (and the new website) in English and French. Over the next 10 days or so, we will be releasing the products and website in 12 additional languages (German, French, Spanish, Portuguese, Czech, Russian, Polish, Chinese, Korean, and Japanese). Other languages will then be added as we have them available.

edit = add website link
Renamed from "HOME" to "Free Antivirus 5.0"

User avatar
alban
Posts: 194
Joined: Sun Feb 08, 2009 11:20 am
Location: aL

Post by alban » Fri Aug 27, 2010 5:14 am

hi I have used this method for a Pro version as I have the key for it I copied the hex from regedit the created a reg file, but when I install it, asks for key !!! when I give the same key it works good, what can the problem be ?

Thanks

User avatar
shiner
Posts: 655
Joined: Sun Nov 08, 2009 4:18 am
Location: SE Asia

Post by shiner » Fri Aug 27, 2010 8:21 am

alban,

I haven't tested this yet, but I think with Avast v. 5 the register value is here:

Code: Select all

    Windows Registry Editor Version 5.00

    [HKEY_LOCAL_MACHINE\SOFTWARE\ALWIL Software\Avast\5.0]
    "Registration"=hex:ee,xx,xx,xx,xx,xx,xx,xx
I use the free version and will test this by tomorrow.
"You can lead a horse to water, but you can't make it drink."

User avatar
alban
Posts: 194
Joined: Sun Feb 08, 2009 11:20 am
Location: aL

Post by alban » Fri Aug 27, 2010 11:07 pm

shiner thanks for the replay, but, I was talking about my 4.8 version of avast pro that I already have a SN and to be more sure I have copy the hex from regedit and still do not work, it only works when I add the serial manually which creates the same hex !!! I don't know what's going on.

Thanks.

User avatar
shiner
Posts: 655
Joined: Sun Nov 08, 2009 4:18 am
Location: SE Asia

Post by shiner » Sat Aug 28, 2010 6:06 am

alban,

I'm not sure what the problem is.
I have encountered the same issue with v. 5.0 Free.
I have tried adding both "RegData" and "Registration" registry values after installing Avast at ROE and I end up with the same result as you.
"You can lead a horse to water, but you can't make it drink."

User avatar
shiner
Posts: 655
Joined: Sun Nov 08, 2009 4:18 am
Location: SE Asia

Post by shiner » Mon Sep 06, 2010 5:22 am

Register Avast5! Free Antivirus at ROE or for 7Zsfx silent installer.

First, I must give credit to pkula , who posted the info last April.
The registration values must be added to the registry before Avast Setup. They are obtained from the registry after using your key to register the program on a system with Avast already installed.

For RunOnceEx silent installation with registration, I found the following entries in the RunOnceEx.cmd file work:

Code: Select all

REG ADD %KEY%\097 /VE /D "Adding Avast 5 Registration Data" /f
REG ADD %KEY%\097 /V 1 /D "%systemdrive%\install\avast\RegistrationData.cmd" /f

REG ADD %KEY%\098 /VE /D "Avast! Free Antivirus v.5.0" /f
REG ADD %KEY%\098 /V 1 /D "%systemdrive%\install\avast\setup_av_free.exe /Silent" /f
REG ADD %KEY%\098 /V 2 /D "%systemdrive%\install\avast\vpsupd.exe /Silent" /f
Where "RegistrationData.cmd" consists of the following:

Code: Select all

@ECHO OFF

reg.exe ADD "HKLM\SOFTWARE\ALWIL Software\Avast\5.0" /v RegData /t REG_BINARY /d [color=yellow][hex value from "RegData" entry without commas, backslashes, or spaces.][/color] /f"
reg.exe ADD "HKLM\SOFTWARE\ALWIL Software\Avast\5.0" /v Registration /t REG_BINARY /d [color=yellow][hex value from "Registration" entry without commas, backslashes, or spaces.][/color] /f"

exit
Pretty much the same as pkula's. Everything inside and including the brackets are replaced with the continuous binary values from the registry.

For a 7Zsfx silent installer, here is a sample config.txt file using the same .cmd file:

Code: Select all

;!@Install@!UTF-8!
ExtractTitle="Avast5! Free Antivirus"
ExtractDialogText="Please wait while the installation routine is extracted"
GUIMode="1"
GUIFlags="1+8+2048"
RunProgram="RegistrationData.cmd"
RunProgram="setup_av_free.exe /Silent"
;!@InstallEnd@!
Tested in VBox and my personal PC running XP SP3.
"You can lead a horse to water, but you can't make it drink."

User avatar
alban
Posts: 194
Joined: Sun Feb 08, 2009 11:20 am
Location: aL

Post by alban » Sat Sep 18, 2010 3:43 pm

Does not work on AvastPro v4.8

User avatar
shiner
Posts: 655
Joined: Sun Nov 08, 2009 4:18 am
Location: SE Asia

Post by shiner » Sat Sep 18, 2010 6:18 pm

Hmmm, I don't have a pro license for v4.8 to test.
The method above does work for v 5.0 Free, I have used it several times now.
"You can lead a horse to water, but you can't make it drink."

User avatar
shiner
Posts: 655
Joined: Sun Nov 08, 2009 4:18 am
Location: SE Asia

Post by shiner » Mon Sep 20, 2010 12:17 am

OK, I think I got this figured out now but I need a little bit of help with the 7zxfx line to accomplish what alban is looking for.

I need to append text to an existing ini file. So, how can I change this:

Code: Select all

RunProgram="hidcon:cmd /c copy /y addentries.txt \"%programfiles%\\myprogram\myfile.ini""
so that the text in "addentries.txt" is appended to an existing file, "myfile.ini"
"You can lead a horse to water, but you can't make it drink."

User avatar
5eraph
Site Admin
Posts: 4619
Joined: Tue Jul 05, 2005 9:38 pm
Location: Riverview, MI USA

Post by 5eraph » Mon Sep 20, 2010 2:15 am

Assuming your use of hidcon is correct, the command line you want is:

Code: Select all

RunProgram="hidcon:cmd /c copy /Y \"%ProgramFiles%\\myprogram\\myfile.ini\" + addentries.txt"
Don't forget any of the backslashes. The destination file must be first in the list, or explicitly stated after the files listed to be combined, in this instance of the Copy command.

User avatar
shiner
Posts: 655
Joined: Sun Nov 08, 2009 4:18 am
Location: SE Asia

Post by shiner » Mon Sep 20, 2010 10:28 am

5eraph
Code:

RunProgram="hidcon:cmd /c copy /Y \"%ProgramFiles%\\myprogram\\myfile.ini\" + addentries.txt"
I've tried this with Avast4Pro as follows:

Code: Select all

;!@Install@!UTF-8!
ExtractTitle="Avast4Pro"
ExtractDialogText="Please wait while the installation routine is extracted"
GUIMode="1"
GUIFlags="1+8+2048"
RunProgram="setupengpro4.exe /Silent"
RunProgram="regedit /s registration.reg" 
RunProgram="hidcon:cmd /c copy /Y \"%ProgramFiles%\\Alwil Software\\Avast4\\DATA\\Avast4.ini\" + Add2ini.txt"
;!@InstallEnd@!
Am I blind and making a mistake somewhere??

The first two "runprograms" are being completed successfully--but the last one is not adding the content of "Add2ini.txt" to the Avast4.ini file.
Add2ini.txt is saved as UTF-8 and contains the following text:

[Splash]
KeyUsage=1
[Simple]
ShowHelpCheckList=1

Is the text added but not saved? or have I got it wrong?
"You can lead a horse to water, but you can't make it drink."

User avatar
5eraph
Site Admin
Posts: 4619
Joined: Tue Jul 05, 2005 9:38 pm
Location: Riverview, MI USA

Post by 5eraph » Mon Sep 20, 2010 12:01 pm

For me with Avast5, write access to the Avast5 folder is denied. Avast4 may have the same restrictions in place.

User avatar
shiner
Posts: 655
Joined: Sun Nov 08, 2009 4:18 am
Location: SE Asia

Post by shiner » Mon Sep 20, 2010 5:05 pm

5eraph,
For me with Avast5, write access to the Avast5 folder is denied. Avast4 may have the same restrictions in place.
Yes, I use Avast5 on my PC as well. With Avast5 writing to an ini file is not necessary for silent install with pre-registration--everything is in the registry.

With Avast4, after initial setup but before system restart, the Avast4.ini file can be written to--I have tested this manually. It is only after system restart that the protection module kicks in.

As alban has stated above, the registration value to enter the license key works--but the registration window still pops up on first run of Avast4. This window popup is controlled by the ini, not the registry value. I can write to that ini manually and everything works--after the system restarts Avast4 is registered and no popup occurs on first run but the ini can no longer be written to because the protection module has initiated.
This whole restart thing was changed with Avast5.

It is not an urgent matter, I am only fiddlin with this as a study--I use Avast5 as well.
I just want to know how to add the text content to the ini file with the 7xsfx module for future cases.
"You can lead a horse to water, but you can't make it drink."

User avatar
shiner
Posts: 655
Joined: Sun Nov 08, 2009 4:18 am
Location: SE Asia

Post by shiner » Tue Sep 21, 2010 11:39 pm

Success of sorts.

beats started this thread on how to create a switchless installer with pre-registration for the FREE version of Avast4.
After working on alban's behalf on a method for the PRO Version, it's quite obvious that Alwil Software has integrated preventative measures to do the pre-registration part with the PRO version.
So, if my previous posts are inappropriate any Mod feel free to delete my posts. I had some free time and simply wanted to learn more about creating switchless installers with the 7zsfx module.

5eraph,
Assuming your use of hidcon is correct, the command line you want is:

Code:

RunProgram="hidcon:cmd /c copy /Y \"%ProgramFiles%\\myprogram\\myfile.ini\" + addentries.txt"
After reading more on the Copy command, the 7z_En.chm manual, and most importantly--extracting the config.txt file from vmanda's Winamp SFX and analyzing his/her work, I did manage to learn how to append text to an existing ini file. 5eraph, your example did not work for me, but the following example shows what did work:

Code: Select all

SetEnvironment="ini=%ProgramFiles%\\ProgramName\\Subfolder1etc\\Program.ini"
RunProgram="hidcon:cmd /c copy /y /a \"%ini%\"+\"Add2ini.txt\" \"%ini%\""
BTW, this will append text to the ini file, but using the info from my previous posts above, is still insufficient to pre-register Avast4Pro successfully. :)
"You can lead a horse to water, but you can't make it drink."

Post Reply