added property machineobjectou for directly joining into an organisation unit; check exitcode <> 0;

advice/description
This commit is contained in:
Dennis Trinks
2012-05-07 15:45:13 +02:00
parent f787fe5899
commit 5fdf4be5cc
3 changed files with 30 additions and 3 deletions

View File

@@ -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