Seite 1 von 1

AVG Business - opsi-setup-detector - unknown typ

Verfasst: 10 Sep 2015, 13:48
von rat
Guten Tag

Weiß jemand wie man diese verpackt?

Folgendes habe ich versucht:

1) Dieses Script ( wiki/doku.php?id=userspace:avg_antivirus ), inklusive einem Syntaxfehler, angepaßt, aber es tut nicht :( Er beginnt zu installieren und läuft und läuft und läuft .....

2) Mit dem opsi-setup-detector die .exe angeschaut, sowohl die avg_ibw_x64_all_ltst_3532a10201.exe auch die avg_rad_x64_all_2013_2901.exe von http://www.avg.com/de-de/download.prd-avb . In beiden Fällen wird der Typ nicht erkannt und das Programm steigt aus.

Welche Möglichkeiten habe ich noch?

Re: AVG Business - opsi-setup-detector - unknown typ

Verfasst: 10 Sep 2015, 15:45
von SisterOfMercy
Those .exe files are just archives.

I have a working script for AVG free (for my home users), which will probably work the same with a few modifications.

mfaconf.txt

Code: Alles auswählen

UILevel=Silent
AppMode=setup
LicenseKey=insert-your-key-here-I-think
ProductType=Free
InstallToolbar=0
InstallSidebar=0
NoToolbarDialog
SelectedLanguage=1033
DisableScan
DontRestart
ParticipateProductImprovement=0
ChangeBrowserSearchProvider=0
StartedByAgent
NIW
FEG
IgnoreCompetitors
InstallFeatures=fea_lng_en;
RemoveFeatures=AvgAddonsFea;fea_GUI__Gadg;fea_Toolbar;EmailPluginsFea;fea_AntiSpm;fea_Emails__EMC;fea_Emails__Outlook;fea_Api;fea_Base__Advis;fea_CfgUpg;fea_Client;fea_FW;DEPfea_FW.fea_TDIDrv;DESfea_FW.fea_iFW;fea_IDP__Self;DEPfea_IDP__Self.fea_Antivir;DEPfea_IDP__Self.fea_ResShld;fea_OnlnSc__VidAclr;fea_Shredder;fea_TuneUp;fea_TuneUp__QTune;IDPGroupFea;fea_Base__IAlert;fea_IDP;LanguagesFea;LinkScnFea;fea_OnlnSc;fea_SrchSrf__Surf;SrvAddInFea;fea_SrvAddI__ExAS;fea_SrvAddI__ExRte;fea_SrvAddI__ExSmtp;fea_SrvAddI__ExVS;fea_SrvAddI__Shrp;
I'm not sure about some options, but including them would not hurt. The RemoveFeatures are the ones found in the .msi files.
Why not installing from the .msi file directly? I couldn't get that to work, and I think there is something the setup does, which the .msi files do not do.

Code: Alles auswählen

[Actions]
requiredWinstVersion >= "4.10.8.6"

DefVar $MsiId32$
DefVar $UninstallProgram32$
DefVar $MsiId64$
DefVar $UninstallProgram64$
DefVar $LogDir$
DefVar $ProductId$  
DefVar $MinimumSpace$
DefVar $InstallDir32$
DefVar $InstallDir64$
DefVar $ExitCode$
DefVar $INST_SystemType$
DefVar $INST_MsVersion$

DefVar $RebootFlag$
DefVar $ActionRequest$

set $INST_MsVersion$ = GetMsVersionInfo
Set $INST_SystemType$ = GetSystemType
Set $LogDir$ = "%SystemDrive%\tmp"

; ----------------------------------------------------------------
; - Please edit the following values                             -
; ----------------------------------------------------------------
;$ProductId$ should be the name of the product in opsi
; therefore please: only lower letters, no umlauts, 
; no white space use '-' as a seperator
Set $ProductId$       = "avg-antivirus-2015"
Set $MinimumSpace$    = "1500 MB"
; the path were we find the product after the installation
Set $InstallDir32$      = "%ProgramFiles32Dir%\AVG\AVG2015"
Set $InstallDir64$      = "%ProgramFiles64Dir%\AVG\AVG2015"
; ----------------------------------------------------------------

if not(HasMinimumSpace ("%SystemDrive%", $MinimumSpace$))
	LogError "Not enough space on %SystemDrive%, " + $MinimumSpace$ + " on drive %SystemDrive% needed for " + $ProductId$
	isFatalError
	; Stop process and set installation status to failed
endif
if $INST_MsVersion$ < "5.1"
	LogError "Windows XP or newer is required for " + $ProductId$  
	isFatalError
endif
	
comment "Show product picture"
ShowBitmap "%ScriptPath%\" + $ProductId$ + ".png" $ProductId$

Set $ActionRequest$ = "setup"

comment "handle Rebootflag"
Set $RebootFlag$ = GetRegistryStringValue32("[HKEY_LOCAL_MACHINE\SOFTWARE\opsi.org\winst] RebootFlag")
if not (($RebootFlag$ = "1") or ($RebootFlag$ = "2") or ($RebootFlag$ = "3"))
	Set $RebootFlag$ = "1"
	Registry_SaveRebootFlag /32bit
endif

if ($RebootFlag$ = "1")
	 if FileExists("%ScriptPath%\delsub3264.ins")
 		comment "Start uninstall sub section"
 		Sub "%ScriptPath%\delsub3264.ins"
 	endif
endif

if ($RebootFlag$ = "1") or ($RebootFlag$ = "2")
	 comment "installing"
 	if ($INST_SystemType$ = "x86 System") 
		Message "Installing " + $ProductId$ + "..."
		comment "Installation of Visual C++ redists"	
		Winbatch_install_vcredist_2012UPD4_32 /32Bit
	 	Sub_check_exitcode
 		comment "Start setup program"
 		Winbatch_install_32 /32Bit /WaitForProcessEnding "avgmfapx.exe"
 		Sub_check_exitcode
 		killtask "launcher.exe"
		comment "Patch Registry"
 		Registry_install /32Bit
		Registry_install_AllProfiles /AllNTUserDats
  		comment "Create shortcuts"
 		 LinkFolder_install
 	endif

	if ($INST_SystemType$ = "64 Bit System") 
 		Message "Installing " + $ProductId$ + "..."
		comment "Installation of Visual C++ redists"	
 		 Winbatch_install_vcredist_2012UPD4_64 /64Bit
 		Sub_check_exitcode
 		Winbatch_install_vcredist_2012UPD4_32 /64Bit	
 		Sub_check_exitcode		
 		comment "Start setup program"
 		Winbatch_install_64 /64Bit /WaitForProcessEnding "avgmfapx.exe"
		Sub_check_exitcode
                killtask "launcher.exe"
		comment "Patch Registry"
 		Registry_install /32Bit
 		Registry_install_AllProfiles /AllNTUserDats
 		comment "Create shortcuts"
 		LinkFolder_install
 	endif
	
 	comment "handle Rebootflag"
 	Set $RebootFlag$ = "3"
 	Registry_SaveRebootFlag /32bit
 	ExitWindows /ImmediateReboot
endif	

if ($RebootFlag$ = "3")
 	if ($INST_SystemType$ = "x86 System") 
 		comment "Copy files"
 		Files_install_32 /32Bit
 		Files_install_AllProfiles /AllNtUserProfiles	
 	endif

 	if ($INST_SystemType$ = "64 Bit System") 
 		comment "Copy files"
 		Files_install_64 /64Bit
 		Files_install_AllProfiles /AllNtUserProfiles	
	endif

	comment "handle Rebootflag"
	Set $RebootFlag$ = "0"
	Registry_SaveRebootFlag /32bit
endif

[Winbatch_install_vcredist_2012UPD4_32]
"%SystemRoot%\system32\msiexec.exe" /qb-! /package "%ScriptPath%\files\x86\vc_red.msi" REBOOT=ReallySuppress

[Winbatch_install_vcredist_2012UPD4_64]	
"%SystemRoot%\system32\msiexec.exe" /qb-! /package "%ScriptPath%\files\x64\crt_x64.msi" REBOOT=ReallySuppress

[Winbatch_install_32]
"%ScriptPath%\files\x86\setup.exe" /TARGETDIR="$InstallDir32$"

[Winbatch_install_64]
"%ScriptPath%\files\x64\setup.exe" /TARGETDIR="$InstallDir64$"

[Winbatch_set_rights_32]
"%ScriptPath%\files\subinacl.exe" /subdirectories "$InstallDir32$\Notification" /setowner=Administrators /deny=everyone=w
"%ScriptPath%\files\subinacl.exe" /subdirectories "%CommonAppdataDir%\Avg_Update_0215pi" /setowner=Administrators /deny=everyone=w

[Winbatch_set_rights_64]
"%ScriptPath%\files\subinacl.exe" /subdirectories "$InstallDir64$\Notification" /setowner=Administrators /deny=everyone=w
"%ScriptPath%\files\subinacl.exe" /subdirectories "%CommonAppdataDir%\Avg_Update_0215pi" /setowner=Administrators /deny=everyone=w

[Files_install_32]
copy -s "%ScriptPath%\files\Cfg\*" "%CommonAppdataDir%\AVG2015\Cfg"
copy -s "%ScriptPath%\files\DB\*" "%CommonAppdataDir%\AVG2015\DB"
copy -s "%ScriptPath%\files\log\*" "%CommonAppdataDir%\AVG2015\log"
copy -s "%ScriptPath%\files\MFADATA\*" "%CommonAppdataDir%\MFAData"

[Files_install_64]
copy -s "%ScriptPath%\files\Cfg\*" "%CommonAppdataDir%\AVG2015\Cfg"
copy -s "%ScriptPath%\files\DB\*" "%CommonAppdataDir%\AVG2015\DB"
copy -s "%ScriptPath%\files\log\*" "%CommonAppdataDir%\AVG2015\log"
copy -s "%ScriptPath%\files\MFADATA\*" "%CommonAppdataDir%\MFAData"

[Files_install_AllProfiles]
copy -s "%ScriptPath%\files\cfgall\*" "%UserProfileDir%\Application Data\AVG2015\cfgall"

[Registry_SaveRebootFlag]
openkey [HKEY_LOCAL_MACHINE\SOFTWARE\opsi.org\winst]
set "RebootFlag" = "$RebootFlag$"

[Registry_install]
;Hopefully stop avg from opening a webpage after installation.
openkey [HKEY_LOCAL_MACHINE\SOFTWARE\Avg\Avg2015\SetupFlags]
set "FF_WD" = REG_DWORD:00000000
set "FF_WD2" = REG_DWORD:00000000
set "FF_WD3" = REG_DWORD:00000000
set "FF_WD4" = REG_DWORD:00000000
set "FF_FV" = REG_DWORD:00000000
set "FF_avguireg2014beta1" = REG_DWORD:00000000
openkey [HKEY_LOCAL_MACHINE\SOFTWARE\Avg\Avg2015\LinkScanner\Prevalence]
set "AVAIL" = REG_DWORD:00000000
set "SERVICES" = REG_DWORD:00000000

[Registry_install_AllProfiles]
; Remove stored start menu order
deletekey [HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\MenuOrder\Start Menu]

[opsiServiceCall_setProductActionRequest]
 "method": "setProductActionRequest"
 "params": [
            "$ProductId$",
            "%HostID%",
            "$ActionRequest$"
           ]

[LinkFolder_install]
; Remove desktop shortcut
set_basefolder common_desktopdirectory
set_subfolder ""
delete_element "AVG 2015"

set_basefolder common_programs
delete_subfolder "AVG"

[Sub_check_exitcode]
comment "Test for installation success via exit code"
set $ExitCode$ = getLastExitCode
; informations to exit codes see
; http://msdn.microsoft.com/en-us/library/aa372835(VS.85).aspx
; http://msdn.microsoft.com/en-us/library/aa368542.aspx
if ($ExitCode$ = "0")
	comment "Looks good: setup program gives exitcode zero"
else
	comment "Setup program gives a exitcode unequal zero: " + $ExitCode$
	if ($ExitCode$ = "1605")
		comment "ERROR_UNKNOWN_PRODUCT	1605	This action is only valid for products that are currently installed."
		comment "Uninstall of a not installed product failed - no problem"
	else
		if ($ExitCode$ = "1641")
			comment "looks good: setup program gives exitcode 1641"
			comment "ERROR_SUCCESS_REBOOT_INITIATED	1641	The installer has initiated a restart. This message is indicative of a success."
		else
			if ($ExitCode$ = "3010")
				comment "looks good: setup program gives exitcode 3010"
				comment "ERROR_SUCCESS_REBOOT_REQUIRED	3010	A restart is required to complete the install. This message is indicative of a success."
			else
				logError "Fatal: Setup program gives an unknown exitcode unequal zero: " + $ExitCode$
				isFatalError
			endif
		endif
	endif
endif
It restarts after uninstalling the previous version, and after installing the first part of the new version. The third (or second) restart is needed to replace a few files. I installed AVG on a test client, and copied the configuration directories off of it. This includes a notepad2 exclusion and a few update settings.

Re: AVG Business - opsi-setup-detector - unknown typ

Verfasst: 10 Sep 2015, 15:47
von SisterOfMercy
Also, you need to unpack those large .exe files you have in the %ScriptPath%\files\x64 and %ScriptPath%\files\x86 directories. You also need to place the modified mfaconf.txt there.

Re: AVG Business - opsi-setup-detector - unknown typ

Verfasst: 10 Sep 2015, 18:23
von rat
Herzlichen Dank

Die Nebel des Unwissens haben sich etwas (ein bißchen) gelichtet :o

Ich habe jetzt die große .exe mit 7zip entpackt und habe mir die Dateien angeschaut. Das mit der mfaconf.txt ist mir klar, das verstehe sogar ich :lol: Der %ScriptPath% ist der Ordner am opsi-server in der workbench, wo die ganzen avg-Dateien drinnenliegen. Den Unterordner x86 werde ich, nachdem ich nur mit der 64bit Version arbeite wohl nicht brauchen, oder muß der sein? T'schuldigung, daß ich so blöd frage, aber Scripting und so, da bin ich blutiger Anfänger.

Ich werde es dann morgen in der Firma ausprobieren.

Many thanks
rat

Re: AVG Business - opsi-setup-detector - unknown typ

Verfasst: 12 Sep 2015, 01:45
von SisterOfMercy
rat hat geschrieben:Ich habe jetzt die große .exe mit 7zip entpackt und habe mir die Dateien angeschaut. Das mit der mfaconf.txt ist mir klar, das verstehe sogar ich :lol: Der %ScriptPath% ist der Ordner am opsi-server in der workbench, wo die ganzen avg-Dateien drinnenliegen. Den Unterordner x86 werde ich, nachdem ich nur mit der 64bit Version arbeite wohl nicht brauchen, oder muß der sein? T'schuldigung, daß ich so blöd frage, aber Scripting und so, da bin ich blutiger Anfänger.
Yeah, no problem, just use any directory you want.
With every new version I replace all files, except for the mfaconf.txt. This has worked since build 53xx, and still works with the current 6140.