Opsi – Package ccleaner

Fichier setup32.ins

[Actions]
requiredWinstVersion >= "4.11.2.6"

DefVar $MsiId$
DefVar $UninstallProgram$
DefVar $LogDir$
DefVar $ProductId$  
DefVar $MinimumSpace$
DefVar $InstallDir$
DefVar $ExitCode$
DefVar $LicenseRequired$
DefVar $LicenseKey$
DefVar $LicensePool$

Set $LogDir$ = "%SystemDrive%\tmp"
Set $ProductId$       = "ccleaner"
Set $MinimumSpace$    = "20 MB"
Set $InstallDir$      = "%ProgramFiles32Dir%\CCleaner"
Set $LicenseRequired$ = "false"
Set $LicensePool$     = "p_" + $ProductId$

if not(HasMinimumSpace ("%SystemDrive%", $MinimumSpace$))
	LogError "Plus assez d'espace sur %SystemDrive%, " + $MinimumSpace$ + " sur le disque %SystemDrive% sont requis pour installer " + $ProductId$
	isFatalError "Plus d'espace disque"
else
	comment "Show product picture"
	ShowBitmap "%ScriptPath%\" + $ProductId$ + ".png" $ProductId$
	
	Message "Installation en cours : " + $ProductId$
	
	if $LicenseRequired$ = "true"
		comment "Licence requise, reserve license and get license key"
		Sub_get_licensekey
	endif
	
	comment "Start setup program"
	ChangeDirectory "%SCRIPTPATH%"
	Winbatch_install
	Sub_check_exitcode
	
	comment "Copy files"
	Files_install /32Bit
	
	comment "Patch Registry"
	Registry_install /32Bit
	
	comment "Create shortcuts"
	LinkFolder_install
	
endif

[Winbatch_install]
"%ScriptPath%\ccsetup505_slim.exe" /S /L=1036
 
[Files_install]
copy "%ScriptPath%\cleaning.bat" "%Systemdrive%\Local\Scripts\"
copy "%ScriptPath%\ccleaner.ini" "$InstallDir$"

[Registry_install]

[LinkFolder_install]
set_basefolder common_startup

set_link
 	name: "launch_cleaning.bat"
 	target: "C:\Local\Scripts\cleaning.bat"
 	parameters:
 	working_dir: C:\Local\Scripts
 	icon_file:
 	icon_index:
end_link

[Sub_get_licensekey]
if opsiLicenseManagementEnabled
	comment "License management is enabled and will be used"

	comment "Trying to get a license key"
	Set $LicenseKey$ = demandLicenseKey ($LicensePool$)
	
	DefVar $ServiceErrorClass$
	set $ServiceErrorClass$ = getLastServiceErrorClass
	comment "Error class: " + $ServiceErrorClass$
	
	if $ServiceErrorClass$ = "None"
		comment "Everything fine, we got the license key '" + $LicenseKey$ + "'"
	else
		if $ServiceErrorClass$ = "LicenseConfigurationError"
			LogError "Fatal: license configuration must be corrected"
			LogError getLastServiceErrorMessage
			isFatalError
		else 
			if $ServiceErrorClass$ = "LicenseMissingError"
				LogError "Fatal: required license is not supplied"
				isFatalError
			endif
		endif
	endif
else
	LogError "Fatal: license required, but license management not enabled"
	isFatalError
endif

[Sub_check_exitcode]
comment "Test for installation success via exit code"
set $ExitCode$ = getLastExitCode
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

 

Ficher batch cleaning.bat

@ECHO OFF
"C:\Program Files\CCleaner\CCleaner.exe" /AUTO

 

Fichier de configuration ccleaner.ini

[Options]
Language=1036
UpdateKey=05/02/2015 12:25:21 PM
(App)Thunderbird - Internet Cache=True
(App)Thunderbird - Internet History=False
(App)Thunderbird - Cookies=False
(App)Thunderbird - Download History=False
(App)Thunderbird - Session=False
(App)Mozilla - Internet Cache=True
(App)Mozilla - Internet History=False
(App)Mozilla - Cookies=True
(App)Mozilla - Download History=False
(App)Mozilla - Session=False
(App)Safari - Internet Cache=False
(App)Safari - Internet History=False
(App)Safari - Cookies=False
(App)Google Chrome - Internet Cache=True
(App)Google Chrome - Internet History=False
(App)Google Chrome - Cookies=True
(App)Google Chrome - Download History=False
(App)Google Chrome - Session=False
(App)Adobe Acrobat XI=False
(App)Adobe Photoshop CS2=False
(App)Adobe Reader 11.0=False
(App)MS Office Picture Manager=False
(App)Office 2010=False
(App)FileZilla=False
(App)Google Toolbar IE=False
(App)Adobe Flash Player=False
(App)Microsoft Silverlight=False
(App)VLC Media Player=False
(App)Windows Media Center=False
(App)Windows Media Player=False
(App)7-Zip=False
(App)Windows Defender=False
(App)MS Management Console=False
(App)MS Search=False
(App)RegEdit=False
(App)Remote Desktop=False
(App)Temporary Internet Files=False
(App)History=False
(App)Cookies=False
(App)Recently Typed URLs=False
(App)Delete Index.dat files=False
(App)Last Download Location=False
(App)Recent Documents=False
(App)Run (in Start Menu)=False
(App)Other Explorer MRUs=False
(App)Thumbnail Cache=False
(App)Taskbar Jump Lists=False
(App)Empty Recycle Bin=False
(App)Temporary Files=False
(App)Clipboard=False
(App)Memory Dumps=False
(App)Chkdsk File Fragments=False
(App)Windows Log Files=False
WINDOW_LEFT=795
WINDOW_TOP=60
WINDOW_WIDTH=800
WINDOW_HEIGHT=600
WINDOW_MAX=1
(App)Custom Folders=True
(App)Missing Shared DLLs=False
(App)Invalid File Extensions=False
(App)ActiveX and Class Issues=False
(App)Interface=False
(App)Applications=False
(App)Fonts=False
(App)Application Paths=False
(App)Help Files=False
(App)Installer=False
(App)Obsolete Software=False
(App)Run At Startup=False
(App)Start Menu Ordering=False
(App)MUI Cache=False
(App)Sound Events=False
(App)Windows Services=False
NewVersion=
Include1=PATH|C:\Windows\Temp\|*.*|REMOVESELF
WipeFreeSpaceDrives=C:\
CookiesToSave=*.piriform.com
RunICS=0
Monitoring=0
SystemMonitoring=0
CheckTrialOffer=0
SystemMonitoringRunningNotification=0
LastMonitoringNotificationTime=05/13/2015 11:17:09 AM
LMN=2|3|0|0|0|0|1|0|0|0||||
AnalyzerTypes=1|1|1|1|0|0|0
SystemAnalyzerDrives=C:\
UpdateCheck=0
(App)Java=True
Fermer le menu
%d blogueurs aiment cette page :