Skip to content

opsi.orgheader image

opsi.org
Views
WinstScripts >>

coreldraw

Document Actions
last edited 11 months ago by sehlers
Qualified for opsi 3.4

Three scripts (coreldraw12.ins, delcoreldraw12.ins, delsub.ins)

coreldraw12.ins
----------------------------------------------------------------------
; Copyright (c) uib gmbh (www.uib.de)
; This sourcecode is owned by uib
; and published under the Terms of the General Public License.
; credits: http://www.opsi.org/credits/

[Initial]
requiredWinstVersion >= "4.8.6"
LogLevel=2
;  Log Errors in Logfile but don't abort:
ExitOnError=false
; Show syntax errors in the script:
ScriptErrorMessages=on
; Dont trace step by step through the script:
TraceMode=off
; let started programs run in front of the winst window
StayOnTop=false
 
[Aktionen]
DefVar $TEMP$ 
DefVar $ProductId$
DefVar $MinimumSpace$
DefVar $NewExe$
DefVar $InstallDir$
DefVar $ExitCode$
DefVar $LicenseRequired$
DefVar $LicenseKey$
DefVar $LicensePool$
 

; This should be edited
set $ProductId$ = "%installingProduct%"
set $MinimumSpace$ = "1 MB"
set $InstallDir$="%ProgramFilesDir%\Corel\Corel Graphics 12\Programs"
set $NewExe$=$InstallDir$+"\CorelDRW.exe"
set $LicenseRequired$ = "false"
set $LicensePool$ = "p_" + $ProductId$


Set $TEMP$ = EnvVar("TEMP")

; Message at install time:
Message "Installing "+$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 /3 "%scriptpath%\"+$ProductId$+".bmp" $ProductId$

	if FileExists("%ScriptPath%\delsub.ins")
		comment  "start uninstall sub section"
		sub "%ScriptPath%\delsub.ins"
	endif

	;Message at install time:
	Message "Installing "+$ProductId$+" ..."

	comment "if license management enabled, reserve license and get license key"
	if ($LicenseRequired$ = "true")
		sub_get_licensekey
	else
		Set $LicenseKey$ = Inivar ("serialnumber")
	endif
	
	comment "start setup program"  
	Winbatch_install
	sub_check_exitcode
	
	comment "copy files"
	Files_install
	
	comment "set Registry"
	Registry_install
	
	comment "set start menu"
	LinkFolder_install
	
	comment "test for installation success"
	if not(FileExists($NewExe$))
		logError "Fatal: After Installation "+$NewExe$+" not found"
		isFatalError
	endif

endif

[Winbatch_install]
; something like
; "%SCRIPTPATH%\Setup.exe" /S additional_parameters
; $licensekey$ may be inserted into the additional parameters string 
%SCRIPTPATH%\files\setup.exe /L1031 /S /v"AgreeToLicense=Yes SERIALNUMBER=$LicenseKey$  DELANG=1 /qb"

[Files_install]
; something like
; copy -sv "%SCRIPTPATH%\files\*.*" "%ProgramFilesDir%\$ProductId$"
delete -sf "c:\CorelDRAW Graphics Suite 12\"

[Registry_install]
; something like
openkey [HKEY_LOCAL_MACHINE\SOFTWARE\Corel\CorelDRAW\12.0]
set "ShowEULA"=REG_DWORD:00000000

[LinkFolder_install]
set_basefolder common_programs
set_subfolder "CorelDRAW Graphics Suite 12"

set_link
 name:Bitstream Font Navigator
 target:%ProgramFilesDir%\Corel\Corel Graphics 12\FontNav\FontNav.exe
 parameters: 
 working_dir:
 icon_file: 
 icon_index:
end_link

set_link
 name:Corel CAPTURE 12
 target:%ProgramFilesDir%\Corel\Corel Graphics 12\Programs\Capture.exe
 parameters: 
 working_dir:
 icon_file: 
 icon_index:
end_link

set_link
 name:Corel PHOTO-PAINT 12
 target:%ProgramFilesDir%\Corel\Corel Graphics 12\Programs\CorelPP.exe
 parameters: 
 working_dir:
 icon_file: 
 icon_index:
end_link

set_link
 name:Corel R.A.V.E. 3
 target:%ProgramFilesDir%\Corel\Corel Graphics 12\Programs\RAVE.exe
 parameters: 
 working_dir:
 icon_file: 
 icon_index:
end_link

set_link
 name:Corel Update
 target:%ProgramFilesDir%\Corel\Corel Graphics 12\Programs\CorUpd.exe
 parameters:/r="Software\Corel\CorelDRAW\12.0"
 working_dir:%ProgramFilesDir%\Corel\Corel Graphics 12\Programs\
 icon_file: 
 icon_index:
end_link

set_link
 name:CorelDRAW 12
 target:%ProgramFilesDir%\Corel\Corel Graphics 12\Programs\CorelDRW.exe
 parameters: 
 working_dir:
 icon_file: 
 icon_index:
end_link

set_link
 name:CorelTRACE 12
 target:%ProgramFilesDir%\Corel\Corel Graphics 12\Programs\trace.exe
 parameters: 
 working_dir:
 icon_file: 
 icon_index:
end_link

set_link
 name:Duplexing Wizard
 target:%ProgramFilesDir%\Corel\Corel Graphics 12\Programs\PrintWiz.exe
 parameters: 
 working_dir:
 icon_file: 
 icon_index:
end_link

set_link
 name:SB Profiler
 target:%ProgramFilesDir%\Corel\Corel Graphics 12\Programs\CSBProf.exe
 parameters: 
 working_dir:%ProgramFilesDir%\Corel\Corel Graphics 12\Programs\
 icon_file: 
 icon_index:
end_link

; subfolder Dokumentation
set_subfolder "CorelDRAW Graphics Suite 12\Dokumentation"

set_link
 name:Corel PHOTO-PAINT 12-Lernprogramme
 target:%ProgramFilesDir%\Corel\Corel Graphics 12\Languages\DE\Tutorials\PHOTO-PAINT Tutorials\pp_tut.htm
 parameters: 
 working_dir:%ProgramFilesDir%\Corel\Corel Graphics 12\Languages\DE\Tutorials\PHOTO-PAINT Tutorials\
 icon_file: 
 icon_index:
end_link

set_link
 name:Corel PHOTO-PAINT 12-Schnellübersicht (PDF)
 target:%ProgramFilesDir%\Corel\Corel Graphics 12\Languages\DE\Help\PP12_Quick_Reference_Card.pdf
 parameters: 
 working_dir:%ProgramFilesDir%\Corel\Corel Graphics 12\Languages\DE\Help\
 icon_file: 
 icon_index:
end_link

set_link
 name:Corel R.A.V.E. 3-Lernprogramme
 target:%ProgramFilesDir%\Corel\Corel Graphics 12\Languages\DE\Tutorials\Corel RAVE Tutorials\rv_tut.htm
 parameters: 
 working_dir: %ProgramFilesDir%\Corel\Corel Graphics 12\Languages\DE\Tutorials\Corel RAVE Tutorials\
 icon_file: 
 icon_index:
end_link

set_link
 name:Corel R.A.V.E. 3-Schnellübersicht (PDF)
 target:%ProgramFilesDir%\Corel\Corel Graphics 12\Languages\DE\Help\RAVE3_Quick_Reference_Card.pdf
 parameters: 
 working_dir:%ProgramFilesDir%\Corel\Corel Graphics 12\Languages\DE\Help\
 icon_file: 
 icon_index:
end_link

set_link
 name:CorelDRAW 12-Lernprogramme
 target:%ProgramFilesDir%\Corel\Corel Graphics 12\Languages\DE\Tutorials\CorelDRAW Tutorials\dr_tut.htm
 parameters: 
 working_dir:%ProgramFilesDir%\Corel\Corel Graphics 12\Languages\DE\Tutorials\CorelDRAW Tutorials\
 icon_file: 
 icon_index:
end_link

set_link
 name:CorelDRAW 12-Schnellübersicht
 target:%ProgramFilesDir%\Corel\Corel Graphics 12\Languages\DE\Help\DRAW12_Quick_reference_Card.pdf
 parameters: 
 working_dir:%ProgramFilesDir%\Corel\Corel Graphics 12\Languages\DE\Help\
 icon_file: 
 icon_index:
end_link

set_link
 name:CorelDRAW Graphics Suite 12-Infodatei
 target:%ProgramFilesDir%\Corel\Corel Graphics 12\Languages\DE\Infodatei.html
 parameters: 
 working_dir:%ProgramFilesDir%\Corel\Corel Graphics 12\Languages\DE\
 icon_file: 
 icon_index:
end_link

set_link
 name:VBA-Objektmodell für Corel PHOTO-PAINT 12 (PDF)
 target:%ProgramFilesDir%\Corel\Corel Graphics 12\Programs\PP VBA Object Model.pdf
 parameters: 
 working_dir:%ProgramFilesDir%\Corel\Corel Graphics 12\Programs\
 icon_file: 
 icon_index:
end_link

set_link
 name:VBA-Objektmodell für CorelDRAW 12 (PDF)
 target:%ProgramFilesDir%\Corel\Corel Graphics 12\Programs\CorelDRAW VBA Object Model.pdf
 parameters: 
 working_dir:%ProgramFilesDir%\Corel\Corel Graphics 12\Programs\
 icon_file: 
 icon_index:
end_link

set_link
 name:VBA-Programmierungsanleitung für CorelDRAW Graphics Suite 12 (PDF)
 target:%ProgramFilesDir%\Corel\Corel Graphics 12\Programs\dvba_pg.pdf
 parameters: 
 working_dir:%ProgramFilesDir%\Corel\Corel Graphics 12\Programs\
 icon_file: 
 icon_index:
end_link



[sub_get_licensekey]
if opsiLicenseManagementEnabled
	comment "license management is enabled and will be used"

	comment "try to to get license key"
	Set $licensekey$ = demandLicenseKey ($licensepool$)
	; if there is an assignment of exactly one licensepool to the product the following call is possible:
	; Set $licensekey$ = demandLicenseKey ("", $ProductId$)
	; if there is an assignment of a license pool to a windows software id, it is possible to use
	; DefVar $windowsSoftwareId$ 
	; $windowsSoftwareId$ = "..."
	; Set $licensekey$ = demandLicenseKey ("", "", $windowsSoftwareId$)

	DefVar $serviceErrorClass$ 
	set $serviceErrorClass$ = getLastServiceErrorClass 
	comment "error class: " + $serviceErrorClass$   

	if $serviceErrorClass$ = "None"
		comment "everything fine"
		comment "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
; 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

-------------------------------------------------------------------

delcoreldraw12.ins

-------------------------------------------------------------------
; Copyright (c) uib gmbh (www.uib.de)
; This sourcecode is owned by uib gmbh
; and published under the Terms of the General Public License.
; credits: http://www.opsi.org/credits/

[Initial]
requiredWinstVersion >= "4.8.6"
LogLevel=2
;  Log Errors in Logfile but don't abort:
ExitOnError=false
; Show syntax errors in the script:
ScriptErrorMessages=on
; Dont trace step by step through the script:
TraceMode=off
; let started programs run in front of the winst window
StayOnTop=false
 
[Aktionen]
DefVar $ProductId$
DefVar $InstallDir$
DefVar $ExitCode$
DefVar $licensepool$

; This should be edited
set $ProductId$ = "%installingProduct%"
set $InstallDir$="%ProgramFilesDir%\Corel\Corel Graphics 12\Programs"
Set $licensepool$ = "p_" + $ProductId$

DefVar $TEMP$ 
Set $TEMP$ = EnvVar("TEMP")

comment "show product picture"
ShowBitmap /3 "%scriptpath%\"+$ProductId$+".bmp" $ProductId$

if FileExists("%ScriptPath%\delsub.ins")
   comment  "start uninstall sub section"
   sub "%ScriptPath%\delsub.ins"
endif

comment "if license management enabled, free any license used for the product"
if opsiLicenseManagementEnabled
	FreeLicense($licensepool$)
	; if there is an assignment of a license pool to the product, it is possible to use
	; FreeLicense("", $ProductId$)
	; if there is an assignment of a license pool to a windows software id, it is possible to use
	; DefVar $windowsSoftwareId$ 
	; $windowsSoftwareId$ = "..."
	; FreeLicense("", "", $windowsSoftwareId$)
endif


-----------------------------------------------------------------

delsub.ins

-----------------------------------------------------------------
; Message at install time:
Message "Deinstalling "+$ProductId$+" ..."

comment "start uninstall program if exists"
;if FileExists($InstallDir$+"\uninstall.exe")
	Winbatch_uninstall
	sub_check_exitcode
;endif 

comment "delete files"
Files_uninstall

comment "cleanup Registry"
Registry_uninstall

comment "clear start menu"
LinkFolder_uninstall

[Winbatch_uninstall]
; something like
; "$InstallDir$\uninstall.exe" /S
msiexec /x {505AFDC0-5E72-4928-8368-5DEA385E3647} /qb-! ALLUSERS=2

[Files_uninstall]
; something like (don't forget the trailing backslash)
; delete -sf "$InstallDir$\"

[Registry_uninstall]
; something like
; deletekey [HKEY_LOCAL_MACHINE\Software\########]

[LinkFolder_uninstall]
; something like
set_basefolder common_programs
delete_subfolder "CorelDRAW Graphics Suite 12"

[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