Table of Contents

Virtual CloneDrive

Download Virtual ClondeDrive from http://www.slysoft.com/de/download.html You have to extract the Certificate from the installer for uanttended install. Save it under CLIENT_DATA/cert/$ProductId$.p7b Try: http://www.win-lite.de/wbb/board195-windows-7/board197-win7-addons/15357-howto-programme-ohne-treibernachfrage-in-windows7-silent-installieren/ Same method for VirtualBox, Virtual CloneDrive and many other…

setup.ins

; Copyright (c) itsystems Deutschland AG http://www.itsd.de
; Template from uib 
 
[Actions]
requiredWinstVersion >= "4.10.5"
 
DefVar $MsiId$
DefVar $UninstallProgram$
DefVar $LogDir$
DefVar $ProductId$
DefVar $MinimumSpace$
DefVar $InstallDir$
DefVar $ExitCode$
DefVar $LicenseRequired$
DefVar $LicenseKey$
DefVar $LicensePool$
 
Set $LogDir$ = "%SystemDrive%\tmp"
 
; ----------------------------------------------------------------
; - Please edit the following values                             -
; ----------------------------------------------------------------
Set $ProductId$       = "VirtualCloneDrive"
Set $MinimumSpace$    = "50 MB"
; the path were we find the product after the installation
Set $InstallDir$      = "%ProgramFilesDir%\Elaborate Bytes\VirtualCloneDrive"
Set $LicenseRequired$ = "false"
Set $LicensePool$     = "p_" + $ProductId$
; ----------------------------------------------------------------
 
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
else
	comment "Show product picture"
	ShowBitmap "%ScriptPath%\" + $ProductId$ + ".png" $ProductId$
 
	if FileExists("%ScriptPath%\delsub.ins")
		comment "Start uninstall sub section"
		Sub "%ScriptPath%\delsub.ins"
	endif
 
	Message "Installing " + $ProductId$ + " ..."
 
	comment "Copy files"
	Files_install
	comment "temp trusted cert for driver install"
	Winbatch_addcert
	comment "Start setup program"
	Winbatch_install
	Sub_check_exitcode
	comment "delete temp cert"
	Winbatch_delcert
	Files_loeschen
 
	comment "Create shortcuts"
	LinkFolder_install
 
endif
 
[Winbatch_addcert]
certutil.exe -f -addstore "TrustedPublisher" "%SYSTEMDRIVE%\cert\$ProductId$.p7b"
 
[Winbatch_install]
;
; === Nullsoft Scriptable Install System ================================================================
 "%ScriptPath%\SetupVirtualCloneDrive5440.exe" /S
 
[Winbatch_delcert]
 certutil.exe -delstore TrustedPublisher 0100000000011e643e96d0
 
; === Zertifikate ================================================================
[Files_install]
 copy -s "%ScriptPath%\cert\*.*" "%SYSTEMDRIVE%\cert"
[Files_loeschen]
delete -sf "c:\cert"
 
[LinkFolder_install]
 set_basefolder common_desktopdirectory
 set_subfolder ""
 delete_element "Virtual CloneDrive"
 
; Example of deleting a folder from AllUsers startmenu:
;
 set_basefolder common_programs
 delete_subfolder "Elaborate Bytes"
;
 
[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

delsub.ins

; Copyright (c) itsystems Deutschland AG http://www.itsd.de
; Template from uib
 
Set $UninstallProgram$ = $InstallDir$ + "\vcd-uninst.exe"
 
Message "Uninstalling " + $ProductId$ + " ..."
 
if FileExists($UninstallProgram$)
	comment "Uninstall program found, starting uninstall"
	Winbatch_uninstall
	sub_check_exitcode
endif
 
 
 
[Winbatch_uninstall]
;"C:\Program Files\Elaborate Bytes\VirtualCloneDrive\vcd-uninst.exe" /D="C:\Program Files\Elaborate Bytes\VirtualCloneDrive"
"$UninstallProgram$" /S /D="$InstallDir$" 
 
[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

uninstall.ins

[Actions]
requiredWinstVersion >= "4.10.5"
 
DefVar $MsiId$
DefVar $UninstallProgram$
DefVar $LogDir$
DefVar $ExitCode$
DefVar $ProductId$
DefVar $InstallDir$
DefVar $LicenseRequired$
DefVar $LicensePool$
 
Set $LogDir$ = "%SystemDrive%\tmp"
 
; ----------------------------------------------------------------
; - Please edit the following values                             -
; ----------------------------------------------------------------
Set $ProductId$       = "VirtualCloneDrive"
Set $InstallDir$      = "%ProgramFilesDir%\Elaborate Bytes\VirtualCloneDrive"
Set $LicenseRequired$ = "false"
Set $LicensePool$     = "p_" + $ProductId$
; ----------------------------------------------------------------
 
 
comment "Show product picture"
ShowBitmap "%ScriptPath%\" + $ProductId$ + ".png" $ProductId$
 
Message "Uninstalling " + $ProductId$ + " ..."
 
if FileExists("%ScriptPath%\delsub.ins")
	comment "Start uninstall sub section"
	Sub "%ScriptPath%\delsub.ins"
endif