From 5fdf4be5ccd0e6dfc4c5300baa4fa94129f07f6d Mon Sep 17 00:00:00 2001 From: Dennis Trinks Date: Mon, 7 May 2012 15:45:13 +0200 Subject: [PATCH] added property machineobjectou for directly joining into an organisation unit; check exitcode <> 0; advice/description --- CLIENT_DATA/setup32.ins | 20 +++++++++++++++++++- OPSI/control | 11 ++++++++++- builder-product.cfg | 2 +- 3 files changed, 30 insertions(+), 3 deletions(-) diff --git a/CLIENT_DATA/setup32.ins b/CLIENT_DATA/setup32.ins index e53adb1..9af9b8b 100644 --- a/CLIENT_DATA/setup32.ins +++ b/CLIENT_DATA/setup32.ins @@ -10,6 +10,7 @@ DefVar $domainname$ DefVar $joinadmin$ DefVar $joinadminpw$ DefVar $localadminpw$ +DefVar $orgunit$ DefVar $joinstr$ DefVar $MsiId$ DefVar $UninstallProgram$ @@ -26,7 +27,12 @@ Set $LogDir$ = "%SystemDrive%\tmp" Set $domainname$ = GetProductProperty ("domainname","values") Set $joinadmin$ = GetProductProperty ("joinadmin","values") Set $joinadminpw$ = GetProductProperty ("joinadminpw","values") -Set $joinstr$ = "JOIN %PCName% /Domain:" + $domainname$ + " /UserD:" + $joinadmin$ + " /PasswordD:" + $joinadminpw$ +Set $orgunit$ = GetProductProperty ("MachineObjectOU","values") +if not ($orgunit$ = "") + Set $joinstr$ = "JOIN %PCName% /Domain:" + $domainname$ + " /UserD:" + $joinadmin$ + " /PasswordD:" + $joinadminpw$ + " /OU:" + $orgunit$ +else + Set $joinstr$ = "JOIN %PCName% /Domain:" + $domainname$ + " /UserD:" + $joinadmin$ + " /PasswordD:" + $joinadminpw$ +endif Set $localadminpw$ = GetProductProperty ("localadminpw","values") ; The token BUILDER_VARIABLES will be replaced by opsi-builder.sh @@ -98,3 +104,15 @@ copy "%ScriptPath%\netdom.exe" %System% net user Administrator $localadminpw$ netdom.exe $joinstr$ +[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$ + isFatalError +endif diff --git a/OPSI/control b/OPSI/control index a3ae7a7..41b0724 100644 --- a/OPSI/control +++ b/OPSI/control @@ -7,7 +7,7 @@ incremental: False type: localboot id: windows.domainjoin name: windows.domainjoin -description: Package for domainjoin and setting local adminpassword +description: Package for joining domain (organisation unit optional) and setting local adminpassword advice: ADVICE version: VERSION priority: PRIORITY @@ -39,6 +39,15 @@ description: Domain PC joins values: [""] default: ["DomainName"] +[ProductProperty] +type: unicode +name: MachineObjectOU +multivalue: False +editable: True +description: OU moving the new PC to. If empty, the default OU will be used. +values: [""] +default: [""] + [ProductProperty] type: unicode name: joinadmin diff --git a/builder-product.cfg b/builder-product.cfg index 48a86db..1c0dcd1 100644 --- a/builder-product.cfg +++ b/builder-product.cfg @@ -6,7 +6,7 @@ PN="windows.domainjoin" VERSION="1" RELEASE="1" PRIORITY="0" -ADVICE="Mandatory items: domainname / joinadmin / joinadminpw / localadminpw" +ADVICE="Mandatory items: domainname / joinadmin / joinadminpw / localadminpw | Optional items: machineobjectou (RFC 1779)" # TYPE - defines, if the install files are public or restricted. # Valid value: restricted | public