From 9a281df1a26ff2ed712890667c1e6f08db0e5d9a Mon Sep 17 00:00:00 2001
From: Peter Singer <silc@gmx.net>
Date: Sat, 11 May 2013 06:58:15 +0200
Subject: [PATCH] initial commit

---
 CLIENT_DATA/X86/icon_lay.dok              |   4 +
 CLIENT_DATA/X86_64/icon_lay.dok           |   4 +
 CLIENT_DATA/delsub3264.ins                | 137 +++++++++
 CLIENT_DATA/opsi-softwareok.desktopok.ini |   9 +
 CLIENT_DATA/setup3264.ins                 | 332 ++++++++++++++++++++++
 CLIENT_DATA/uninstall3264.ins             |  85 ++++++
 DesktopOK.png.sha1sum                     |   1 +
 DesktopOK.zip.sha1sum                     |   1 +
 DesktopOK_x64.zip.sha1sum                 |   1 +
 OPSI/control                              |  50 ++++
 OPSI/postinst                             |   9 +
 OPSI/preinst                              |   9 +
 builder-product.cfg                       |  38 +++
 builder-targets-cb.sh                     |  24 ++
 14 files changed, 704 insertions(+)
 create mode 100644 CLIENT_DATA/X86/icon_lay.dok
 create mode 100644 CLIENT_DATA/X86_64/icon_lay.dok
 create mode 100644 CLIENT_DATA/delsub3264.ins
 create mode 100644 CLIENT_DATA/opsi-softwareok.desktopok.ini
 create mode 100644 CLIENT_DATA/setup3264.ins
 create mode 100644 CLIENT_DATA/uninstall3264.ins
 create mode 100644 DesktopOK.png.sha1sum
 create mode 100644 DesktopOK.zip.sha1sum
 create mode 100644 DesktopOK_x64.zip.sha1sum
 create mode 100644 OPSI/control
 create mode 100644 OPSI/postinst
 create mode 100644 OPSI/preinst
 create mode 100644 builder-product.cfg
 create mode 100644 builder-targets-cb.sh

diff --git a/CLIENT_DATA/X86/icon_lay.dok b/CLIENT_DATA/X86/icon_lay.dok
new file mode 100644
index 0000000..9923bb9
--- /dev/null
+++ b/CLIENT_DATA/X86/icon_lay.dok
@@ -0,0 +1,4 @@
+[DesktopOK-Icon-Layout]
+
+Arbeitsplatz=42,2
+Computer=42,2
diff --git a/CLIENT_DATA/X86_64/icon_lay.dok b/CLIENT_DATA/X86_64/icon_lay.dok
new file mode 100644
index 0000000..9923bb9
--- /dev/null
+++ b/CLIENT_DATA/X86_64/icon_lay.dok
@@ -0,0 +1,4 @@
+[DesktopOK-Icon-Layout]
+
+Arbeitsplatz=42,2
+Computer=42,2
diff --git a/CLIENT_DATA/delsub3264.ins b/CLIENT_DATA/delsub3264.ins
new file mode 100644
index 0000000..6ce8d84
--- /dev/null
+++ b/CLIENT_DATA/delsub3264.ins
@@ -0,0 +1,137 @@
+; 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/
+
+
+; Set $MsiId32$ = '{XXXXX-XXXXX-XXXXX-XXXXX-XXXXX}'
+Set $UninstallProgram32$ = $InstallDir32$ + "\unins000.exe"
+
+; Set $MsiId64$ = '{XXXXX-XXXXX-XXXXX-XXXXX-XXXXX}'
+Set $UninstallProgram64$ = $InstallDir64$ + "\unins000.exe"
+
+if (($INST_SystemType$ = "x86 System") and ($INST_architecture$ = "system specific")) or ($INST_architecture$ = "both") or ($INST_architecture$ = "32 only")
+	Message "Uninstalling " + $ProductId$ + " 32 Bit..."
+
+	if FileExists($UninstallProgram32$)
+		comment "Uninstall program found, starting uninstall"
+		Winbatch_uninstall_32
+		sub_check_exitcode
+	endif
+
+	if not (GetRegistryStringValue32("[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\" + $MsiId32$ + "] DisplayName") = "")
+		comment "MSI id " + $MsiId32$ + " found in registry, starting msiexec to uninstall"
+		Winbatch_uninstall_msi_32
+		sub_check_exitcode
+	endif
+	
+	comment "Delete files"
+	Files_uninstall_32 /32Bit
+	comment "Cleanup registry"
+	Registry_uninstall /32Bit
+	Registry_uninstall /SysNative
+endif
+
+if ($INST_SystemType$ = "64 Bit System") and (($INST_architecture$ = "system specific") or ($INST_architecture$ = "both") or ($INST_architecture$ = "64 only"))
+	Message "Uninstalling " + $ProductId$ + " 64 Bit..."
+
+	if FileExists($UninstallProgram64$)
+		comment "Uninstall program found, starting uninstall"
+		Winbatch_uninstall_64
+		sub_check_exitcode
+	endif
+
+	if not (GetRegistryStringValue64("[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\" + $MsiId64$ + "] DisplayName") = "")
+		comment "MSI id " + $MsiId64$ + " found in registry, starting msiexec to uninstall"
+		Winbatch_uninstall_msi_64
+		sub_check_exitcode
+	endif
+	
+	comment "Delete files"
+	Files_uninstall_64 /64Bit
+	comment "Cleanup registry"
+	Registry_uninstall /64Bit
+	Registry_uninstall /SysNative
+endif
+
+comment "Delete program shortcuts"
+LinkFolder_uninstall
+
+[Winbatch_uninstall_32]
+; Choose one of the following examples as basis for program uninstall
+;
+; === Nullsoft Scriptable Install System ================================================================
+"$UninstallProgram32$" /VERYSILENT
+
+[Winbatch_uninstall_msi_32]
+msiexec /x $MsiId32$ /qb! REBOOT=ReallySuppress
+
+[Files_uninstall_32]
+; Example for recursively deleting the installation directory (don't forget the trailing backslash):
+;
+delete -sf "$InstallDir32$\"
+
+[Winbatch_uninstall_64]
+; Choose one of the following examples as basis for program uninstall
+;
+; === Nullsoft Scriptable Install System ================================================================
+"$UninstallProgram64$" /VERYSILENT
+
+[Winbatch_uninstall_msi_64]
+msiexec /x $MsiId64$ /qb! REBOOT=ReallySuppress
+
+[Files_uninstall_64]
+; Example for recursively deleting the installation directory (don't forget the trailing backslash):
+;
+delete -sf "$InstallDir64$\"
+
+[Registry_uninstall]
+; Example of deleting a registry key:
+;
+; deletekey [HKEY_LOCAL_MACHINE\Software\$ProductId$]
+openkey [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\HideDesktopIcons\NewStartPanel]
+set "{20D04FE0-3AEA-1069-A2D8-08002B30309D}" = REG_DWORD:0001
+openkey [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run]
+DeleteVar "DesktopOK"
+
+[LinkFolder_uninstall]
+; Example of deleting a folder from AllUsers startmenu:
+;
+; set_basefolder common_programs
+; delete_subfolder $ProductId$
+;
+; Example of deleting a shortcut from AllUsers desktop:
+;
+; set_basefolder common_desktopdirectory
+; set_subfolder ""
+; delete_element $ProductId$
+
+[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
+
diff --git a/CLIENT_DATA/opsi-softwareok.desktopok.ini b/CLIENT_DATA/opsi-softwareok.desktopok.ini
new file mode 100644
index 0000000..7673eef
--- /dev/null
+++ b/CLIENT_DATA/opsi-softwareok.desktopok.ini
@@ -0,0 +1,9 @@
+[X86]
+MsiId32={XXXXX-XXXXX-XXXXX-XXXXX-XXXXX}
+
+[X86_64]
+MsiId64={XXXXX-XXXXX-XXXXX-XXXXX-XXXXX}
+
+[COMMON]
+PN=softwareok.desktopok
+VERSION=3.41
diff --git a/CLIENT_DATA/setup3264.ins b/CLIENT_DATA/setup3264.ins
new file mode 100644
index 0000000..1828cfd
--- /dev/null
+++ b/CLIENT_DATA/setup3264.ins
@@ -0,0 +1,332 @@
+; 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/
+
+[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 $LicenseRequired$
+DefVar $LicenseKey$
+DefVar $LicensePool$
+DefVar $INST_SystemType$
+DefVar $INST_architecture$
+
+Set $INST_SystemType$ = GetSystemType
+set $INST_architecture$ = GetProductProperty("install_architecture","system specific")
+
+
+Set $LogDir$ = "%SystemDrive%\tmp"
+
+DefVar	$MSVersion$
+Set 	$MSVersion$ = GetMsVersionInfo
+
+DefVar	$install_version$
+Set 	$install_version$ = GetProductProperty("install_version","dynamic")
+
+DefVar	$execute_file$
+
+DefVar	$desktop_icon_computer$
+Set 	$desktop_icon_computer$ = GetProductProperty("desktop_icon_computer","nc")
+
+
+; The token BUILDER_VARIABLES will be replaced by opsi-builder.sh
+; and adds the following variables:
+;   from builder-product.cfg :  all variables definded by attribute WINST[index]
+;   from builder-product.cfg :  VENDOR PN VERSION RELEASE PRIORITY ADVICE TYPE   
+;   from opsi-builder.cfg    :  CREATOR_TAG CREATOR_NAME CREATOR_EMAIL           
+;   auto generated winst-variables
+;         $IconFile$: path to product picture
+;
+@@BUILDER_VARIABLES@@
+
+
+; ----------------------------------------------------------------
+; - 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$       = "softwareok.desktopok"
+Set $MinimumSpace$    = "10 MB"
+; the path were we find the product after the installation
+Set $InstallDir32$      = "%ProgramFiles32Dir%\DesktopOK"
+Set $InstallDir64$      = "%ProgramFiles64Dir%\DesktopOK"
+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" $NAME$
+	
+	if FileExists("%ScriptPath%\delsub3264.ins")
+		comment "Start uninstall sub section"
+		Sub "%ScriptPath%\delsub3264.ins"
+	endif
+	
+	if $LicenseRequired$ = "true"
+		comment "Licensing required, reserve license and get license key"
+		Sub_get_licensekey
+	endif
+	
+	if (($INST_SystemType$ = "x86 System") and ($INST_architecture$ = "system specific") and ($install_version$ = "dynamic")) or (($INST_architecture$ = "both") and ($install_version$ = "dynamic")) or (($INST_architecture$ = "32 only") and ($install_version$ = "dynamic"))
+			set $execute_file$ = "DesktopOK_reg.exe"
+	endif	
+	if (($INST_SystemType$ = "64 Bit System") and ($INST_architecture$ = "system specific") and ($install_version$ = "dynamic")) or (($INST_architecture$ = "both") and ($install_version$ = "dynamic")) or (($INST_architecture$ = "64 only") and ($install_version$ = "dynamic"))
+			set $execute_file$ = "DesktopOK_x64_reg.exe"
+	endif
+	if (($INST_SystemType$ = "x86 System") and ($INST_architecture$ = "system specific") and ($install_version$ = "static")) or (($INST_architecture$ = "both") and ($install_version$ = "static")) or (($INST_architecture$ = "32 only") and ($install_version$ = "static"))
+			set $execute_file$ = "DesktopOK.exe"
+	endif
+	if (($INST_SystemType$ = "64 Bit System") and ($INST_architecture$ = "system specific") and ($install_version$ = "static")) or (($INST_architecture$ = "both") and ($install_version$ = "static")) or (($INST_architecture$ = "64 only") and ($install_version$ = "static"))
+			set $execute_file$ = "DesktopOK_x64.exe"
+	endif
+	
+	
+	comment "installing"
+
+	if (($INST_SystemType$ = "x86 System") and ($INST_architecture$ = "system specific")) or ($INST_architecture$ = "both") or ($INST_architecture$ = "32 only")
+		Message "Installing " + $ProductId$ + " 32 Bit..."
+		comment "Start setup program"
+		Winbatch_install_32
+		Dosbatch_register_config winst /SysNative
+		Sub_check_exitcode
+		comment "Copy files"
+		Files_install_32 /32Bit
+		
+		if ($install_version$ = "dynamic")
+			Dosbatch_install_dynamic winst /SysNative
+		endif
+		
+		
+		comment "Patch Registry"
+		Registry_install /32Bit
+		
+		if ($install_version$ = "static")
+			Registry_install_static /SysNative
+		endif
+		
+		if ($desktop_icon_computer$ = "show")
+			Registry_install_desktop_icon_computer_show /SysNative
+		endif
+		if ($desktop_icon_computer$ = "hide")
+			Registry_install_desktop_icon_computer_hide /SysNative
+		endif
+
+		
+		comment "Create shortcuts"
+		LinkFolder_install
+	endif
+
+	if ($INST_SystemType$ = "64 Bit System") and (($INST_architecture$ = "system specific") or ($INST_architecture$ = "both") or ($INST_architecture$ = "64 only"))
+		Message "Installing " + $ProductId$ + " 64 Bit..."
+		comment "Start setup program"
+		Winbatch_install_64
+		Sub_check_exitcode
+		comment "Copy files"
+		Files_install_64 /64Bit
+		
+		if ($install_version$ = "dynamic")
+			Dosbatch_install_dynamic winst /SysNative
+		endif
+		
+		comment "Patch Registry"
+		Registry_install /64Bit
+		
+		if ($install_version$ = "static")
+			Registry_install_static /SysNative
+		endif
+		
+		if ($desktop_icon_computer$ = "show")
+			Registry_install_desktop_icon_computer_show /SysNative
+		endif
+		if ($desktop_icon_computer$ = "hide")
+			Registry_install_desktop_icon_computer_hide /SysNative
+		endif
+		
+		
+		comment "Create shortcuts"
+		LinkFolder_install
+	endif
+	
+endif
+
+[Dosbatch_install_dynamic]
+if exist "$InstallDir32$\DesktopOK.exe" ren "$InstallDir32$\DesktopOK.exe" $execute_file$
+if exist "$InstallDir64$\DesktopOK_x64.exe" ren "$InstallDir64$\DesktopOK_x64.exe" $execute_file$
+
+[Winbatch_install_32]
+; Choose one of the following examples as basis for your installation
+; You can use $LicenseKey$ var to pass a license key to the installer
+;
+; === Nullsoft Scriptable Install System ================================================================
+; "$Install32Exe$" /verysilent ALLUSERS=1
+
+[Files_install_32]
+; Example of recursively copying some files into the installation directory:
+;
+; copy -s "%ScriptPath%\files\*.*" "$InstallDir32$"
+copy -s "%ScriptPath%\X86\*.*" "$InstallDir32$"
+
+[Winbatch_install_64]
+; Choose one of the following examples as basis for your installation
+; You can use $LicenseKey$ var to pass a license key to the installer
+;
+; === MSI package =======================================================================================
+; You may use the parameter PIDKEY=$Licensekey$
+; "$Install64Exe$" /verysilent ALLUSERS=1
+
+[Files_install_64]
+; Example of recursively copying some files into the installation directory:
+;
+; copy -s "%ScriptPath%\files\*.*" "$InstallDir64$"
+copy -s "%ScriptPath%\X86_64\*.*" "$InstallDir64$"
+
+[Registry_install]
+; Example of setting some values of an registry key:
+;
+; openkey [HKEY_LOCAL_MACHINE\Software\$ProductId$]
+; set "name1" = "some string value"
+; set "name2" = REG_DWORD:0001
+; set "name3" = REG_BINARY:00 af 99 cd
+
+[Registry_install_static]
+openkey [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run]
+set "DesktopOK" = '"%ProgramFiles%\DesktopOK\$execute_file$" /load /silent "%ProgramFiles%\DesktopOK\icon_lay.dok"'
+
+[Registry_install_desktop_icon_computer_show]
+openkey [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\HideDesktopIcons\NewStartPanel]
+set "{20D04FE0-3AEA-1069-A2D8-08002B30309D}" = REG_DWORD:0000
+
+[Registry_install_desktop_icon_computer_hide]
+openkey [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\HideDesktopIcons\NewStartPanel]
+set "{20D04FE0-3AEA-1069-A2D8-08002B30309D}" = REG_DWORD:0001
+
+[LinkFolder_install]
+; Example of deleting a folder from AllUsers startmenu:
+;
+; set_basefolder common_programs
+; delete_subfolder $ProductId$
+;
+; Example of creating an shortcut to the installed exe in AllUsers startmenu:
+;
+; set_basefolder common_programs
+; set_subfolder $ProductId$
+;
+; set_link
+; 	name: $ProductId$
+; 	target: <path to the program>
+; 	parameters:
+; 	working_dir: $InstallDir$
+; 	icon_file:
+; 	icon_index:
+; end_link
+;
+; Example of creating an shortcut to the installed exe on AllUsers desktop:
+;
+; set_basefolder common_desktopdirectory
+; set_subfolder ""
+;
+; set_link
+; 	name: $ProductId$
+; 	target: <path to the program>
+; 	parameters: <some_param>
+; 	working_dir: $InstallDir$
+; 	icon_file: <path to icon file>
+; 	icon_index: 2
+; end_link
+;
+set_basefolder common_programs
+set_subfolder DesktopOK
+;
+set_link
+ 	name: DesktopOK
+ 	target: %ProgramFiles%\DesktopOK\$execute_file$
+ 	parameters:
+ 	working_dir: %ProgramFiles%\DesktopOK
+ 	icon_file: %ProgramFiles%\DesktopOK\$execute_file$
+ 	icon_index: 0
+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$)
+	; 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, 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
+
diff --git a/CLIENT_DATA/uninstall3264.ins b/CLIENT_DATA/uninstall3264.ins
new file mode 100644
index 0000000..8e71ec2
--- /dev/null
+++ b/CLIENT_DATA/uninstall3264.ins
@@ -0,0 +1,85 @@
+; 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/
+
+[Actions]
+requiredWinstVersion >= "4.10.8.6"
+
+DefVar $MsiId32$
+DefVar $UninstallProgram32$
+DefVar $MsiId64$
+DefVar $UninstallProgram64$
+DefVar $LogDir$
+DefVar $ExitCode$
+DefVar $ProductId$
+DefVar $InstallDir32$
+DefVar $InstallDir64$
+DefVar $LicenseRequired$
+DefVar $LicensePool$
+DefVar $INST_SystemType$
+DefVar $INST_architecture$
+
+Set $INST_SystemType$ = GetSystemType
+set $INST_architecture$ = GetProductProperty("install_architecture","system specific")
+
+
+Set $LogDir$ = "%SystemDrive%\tmp"
+
+; The token BUILDER_VARIABLES will be replaced by opsi-builder.sh
+; and adds the following variables:
+;   from builder-product.cfg :  all variables definded by attribute WINST[index]
+;   from builder-product.cfg :  VENDOR PN VERSION RELEASE PRIORITY ADVICE TYPE   
+;   from opsi-builder.cfg    :  CREATOR_TAG CREATOR_NAME CREATOR_EMAIL           
+;   auto generated winst-variables
+;         $IconFile$: path to product picture
+;
+@@BUILDER_VARIABLES@@
+
+; ----------------------------------------------------------------
+; - Please edit the following values                             -
+; ----------------------------------------------------------------
+Set $ProductId$       = "softwareok.desktopok"
+Set $InstallDir32$      = "%ProgramFiles32Dir%\DesktopOK"
+Set $InstallDir64$      = "%ProgramFiles64Dir%\DesktopOK"
+Set $LicenseRequired$ = "false"
+Set $LicensePool$     = "p_" + $ProductId$
+; ----------------------------------------------------------------
+
+
+comment "Show product picture"
+ShowBitmap "%ScriptPath%\" + $ProductId$ + ".png" $ProductId$
+
+Message "Uninstalling " + $ProductId$ + " ..."
+
+if FileExists("%ScriptPath%\delsub3264.ins")
+	comment "Start uninstall sub section"
+	Sub "%ScriptPath%\delsub3264.ins"
+endif
+
+if $LicenseRequired$ = "true"
+	comment "Licensing required, free license used"
+	Sub_free_license
+endif
+
+[Sub_free_license]
+if opsiLicenseManagementEnabled
+	comment "License management is enabled and will be used"
+
+	comment "Trying to free license used for the product"
+	DefVar $result$
+	Set $result$ = FreeLicense($LicensePool$)
+	; If there is an assignment of a license pool to the product, it is possible to use
+	; Set $result$ = FreeLicense("", $ProductId$)
+	;
+	; If there is an assignment of a license pool to a windows software id, it is possible to use
+	; DefVar $WindowsSoftwareId$
+	; $WindowsSoftwareId$ = "..."
+	; set $result$ = FreeLicense("", "", $WindowsSoftwareId$)
+else
+	LogError "Error: licensing required, but license management not enabled"
+	isFatalError
+endif
+
+
+
diff --git a/DesktopOK.png.sha1sum b/DesktopOK.png.sha1sum
new file mode 100644
index 0000000..0c601da
--- /dev/null
+++ b/DesktopOK.png.sha1sum
@@ -0,0 +1 @@
+545375e7b9d2506e181317dfb8083aa3a91b5f84  /home/opsiproducts/.opsi-dist-cache/softwareok.desktopok-3.41//DesktopOK.png
diff --git a/DesktopOK.zip.sha1sum b/DesktopOK.zip.sha1sum
new file mode 100644
index 0000000..0dd0bfe
--- /dev/null
+++ b/DesktopOK.zip.sha1sum
@@ -0,0 +1 @@
+545d9a3420be46944facca59eefa03831e479d80  /home/opsiproducts/.opsi-dist-cache/softwareok.desktopok-3.55/X86/DesktopOK.zip
diff --git a/DesktopOK_x64.zip.sha1sum b/DesktopOK_x64.zip.sha1sum
new file mode 100644
index 0000000..ddeaff4
--- /dev/null
+++ b/DesktopOK_x64.zip.sha1sum
@@ -0,0 +1 @@
+a75cc9a0b37a3f3819369a4b736e62348302f35f  /home/opsiproducts/.opsi-dist-cache/softwareok.desktopok-3.55/X86_64/DesktopOK_x64.zip
diff --git a/OPSI/control b/OPSI/control
new file mode 100644
index 0000000..05c77c8
--- /dev/null
+++ b/OPSI/control
@@ -0,0 +1,50 @@
+[Package]
+version: RELEASE
+depends: 
+incremental: False
+
+[Product]
+type: localboot
+id: softwareok.desktopok
+name: DesktopOK
+description: Save and restore the positions of icons.
+advice: ADVICE
+version: VERSION
+priority: PRIORITY
+licenseRequired: False
+productClasses: 
+setupScript: setup3264.ins
+uninstallScript: uninstall3264.ins
+updateScript: 
+alwaysScript: 
+onceScript: 
+customScript: 
+userLoginScript: 
+
+[ProductProperty]
+type: unicode
+name: install_architecture
+multivalue: False
+editable: False
+description: which architecture (32/64 bit) has to be installed
+values: ["32 only", "64 only", "both", "system specific"]
+default: ["system specific"]
+
+[ProductProperty]
+type: unicode
+name: install_version
+multivalue: False
+editable: False
+description: which version has to be installed
+values: ["dynamic", "static"]
+default: ["dynamic"]
+
+[ProductProperty]
+type: unicode
+name: desktop_icon_computer
+multivalue: False
+editable: False
+description: Display My Computer Icon on the Desktop
+values: ["nc","show", "hide"]
+default: ["nc"]
+
diff --git a/OPSI/postinst b/OPSI/postinst
new file mode 100644
index 0000000..f0a8a32
--- /dev/null
+++ b/OPSI/postinst
@@ -0,0 +1,9 @@
+#! /bin/bash
+#
+# postinst script
+# This script executes after unpacking files from that archive and registering the product at the depot.
+#
+# The following environment variables can be used to obtain information about the current installation:
+#   PRODUCT_ID: id of the current product
+#   CLIENT_DATA_DIR: directory which contains the installed client data
+#
diff --git a/OPSI/preinst b/OPSI/preinst
new file mode 100644
index 0000000..34512e1
--- /dev/null
+++ b/OPSI/preinst
@@ -0,0 +1,9 @@
+#! /bin/bash
+#
+# preinst script
+# This script executes before that package will be unpacked from its archive file.
+#
+# The following environment variables can be used to obtain information about the current installation:
+#   PRODUCT_ID: id of the current product
+#   CLIENT_DATA_DIR: directory where client data will be installed
+#
diff --git a/builder-product.cfg b/builder-product.cfg
new file mode 100644
index 0000000..8d8bb4c
--- /dev/null
+++ b/builder-product.cfg
@@ -0,0 +1,38 @@
+############################
+# Setup product information 
+############################
+VENDOR="softwareok"
+PN="softwareok.desktopok"
+NAME="DesktopOK"
+DESCRIPTION="Save and restore the positions of icons."
+VERSION="3.55"
+RELEASE="1"
+PRIORITY="0"
+ADVICE=""
+
+# TYPE - defines, if the install files are public or restricteded. 
+# Valid value: restricted | public
+TYPE="public"
+
+
+DL_FILE[0]="DesktopOK.png"
+DL_SOURCE[0]="http://www.softwareok.de/img/ico/DesktopOK.png"
+
+DL_FILE[1]="DesktopOK.zip"
+DL_SOURCE[1]="http://www.softwareok.de/Download/DesktopOK.zip"
+DL_ARCH[1]="X86"
+DL_EXTRACT_FORMAT[1]="unzip"
+
+DL_FILE[2]="DesktopOK_x64.zip"
+DL_SOURCE[2]="http://www.softwareok.de/Download/DesktopOK_x64.zip"
+DL_ARCH[2]="X86_64"
+DL_EXTRACT_FORMAT[2]="unzip"
+
+# File array index for the image showing while installing the program
+ICON_DL_INDEX=0
+
+WINST_NAME[0]="DesktopOK32Exe"
+WINST_VALUE[0]="@DL_EXTRACT_WINST_PATH[1]@\\DesktopOK.exe"
+
+WINST_NAME[1]="DesktopOK64Exe"
+WINST_VALUE[1]="@DL_EXTRACT_WINST_PATH[2]@\\DesktopOK_x64.exe" 
diff --git a/builder-targets-cb.sh b/builder-targets-cb.sh
new file mode 100644
index 0000000..98e364f
--- /dev/null
+++ b/builder-targets-cb.sh
@@ -0,0 +1,24 @@
+##############################################################################
+# This optional file "builder-targets-cb.sh" will be called by builder.sh 
+# 
+# The targets will be called from thde opsi-builder using the following
+# order: config, prepare, retrieve, create, package, publish, commit, cleanup 
+# You can overwrite the target functions in builder-targets-cb.sh
+# 
+# You can define callback functions. The functions are called from
+# opsi-builder within processing a target
+#   cb_package_makeproductfile
+#
+# You can use every variable defined in any configuration file or by
+# the defined builder script itself. Also, calling the predefined
+# targets builder_<targetname> is possible.
+#
+# Abstract:
+#  target order: config, prepare, retrieve, create, package, publish, commit, cleanup
+#  callbacks: <none>
+#
+##############################################################################
+function cleanup() {
+    echo "Cleanup: output_dir: $output_dir"
+    builder_cleanup
+}