Changeset 1035 for opsi/products/bitlocker
- Timestamp:
- Jul 12, 2012, 5:43:24 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
opsi/products/bitlocker/CLIENT_DATA/setup.ins
r1033 r1035 17 17 DefVar $LicenseKey$ 18 18 DefVar $LicensePool$ 19 20 DefVar $RegKeyRebootCounter$ 21 DefVar $RebootCounter$ 22 Set $RegKeyRebootCounter$ = "[HKLM\SOFTWARE\opsi.org\custom\bitlocker]" 23 19 24 20 25 DefVar $TpmPassword$ … … 49 54 ; Sub "%ScriptPath%\delsub.ins" 50 55 ;endif 56 57 sub_get_rebootcounter 58 comment "rebootcounter = $RebootCounter$" 59 51 60 52 Message "Installing " + $ProductId$ + " ..."61 Message "Installing " + $ProductId$ + ", Counter: " + $RebootCounter$ 53 62 54 63 comment "Start setup program" … … 59 68 ShellInAnIcon_status winst /sysnative 60 69 61 winbatch_tpm_activate 62 sub_check_exitcode_tpm_activate 63 64 winbatch_tpm_TakeOwnerShip 65 sub_check_exitcode_tpm_TakeOwnerShip 66 67 winbatch_bitlocker_activate 68 sub_check_exitcode_bitlocker_activate 69 70 ShellInAnIcon_status winst /sysnative 70 if (( $RebootCounter$ = "" ) or ( $RebootCounter$ = "0" )) 71 #winbatch_tpm_activate 72 #sub_check_exitcode_tpm_activate 73 ShellInAnIcon_tpm_activate winst /sysnative 74 set $RebootCounter$ = "1" 75 sub_do_reboot 76 endif 77 78 #winbatch_tpm_TakeOwnerShip 79 #sub_check_exitcode_tpm_TakeOwnerShip 80 ShellInAnIcon_tpm_TakeOwnerShip winst /sysnative 81 82 #winbatch_bitlocker_activate 83 #sub_check_exitcode_bitlocker_activate 84 ShellInAnIcon_tpm_bitlocker_activate winst /sysnative 85 ExitWindows /Reboot 86 87 ShellInAnIcon_status winst /sysnative 71 88 endif 72 89 … … 75 92 manage-bde -protectors c: -get 76 93 94 [ShellInAnIcon_tpm_activate] 95 manage-bde -tpm -TurnOn 96 77 97 [winbatch_tpm_activate] 78 98 manage-bde -tpm -TurnOn … … 80 100 [sub_check_exitcode_tpm_activate] 81 101 comment "Test exit code" 102 # WARNING: 103 # There are systems, that return 0, even if the TPM is already activated. 104 # This results in an endless loop 105 # 82 106 set $ExitCode$ = getLastExitCode 83 107 if ($ExitCode$ = "0") … … 94 118 95 119 120 121 [ShellInAnIcon_tpm_TakeOwnerShip] 122 manage-bde -tpm -TakeOwnerShip $TpmPassword$ 123 96 124 [winbatch_tpm_TakeOwnerShip] 97 125 manage-bde -tpm -TakeOwnerShip $TpmPassword$ … … 101 129 set $ExitCode$ = getLastExitCode 102 130 if ($ExitCode$ = "0") 103 131 comment "Looks good: setup program gives exitcode zero" 104 132 else 105 133 if ($ExitCode$ = "-1") 106 134 comment "TPM has an owner. ignored" 107 135 else 108 109 136 logError "Fatal: unknown error code ("+$ExitCode$+"), giving up" 137 isFatalError 110 138 endif 111 139 endif 140 141 [ShellInAnIcon_bitlocker_activate] 142 manage-bde -on c: -RecoveryPassword $RecoveryPassword$ 112 143 113 144 [winbatch_bitlocker_activate] … … 118 149 set $ExitCode$ = getLastExitCode 119 150 if ($ExitCode$ = "0") 120 121 151 comment "Looks good: setup program gives exitcode zero" 152 ExitWindows /Reboot 122 153 else 123 124 154 logError "Fatal: unknown error code ("+$ExitCode$+"), giving up" 155 isFatalError 125 156 endif 126 157 … … 155 186 endif 156 187 188 [sub_get_rebootcounter] 189 Set $RebootCounter$ = GetRegistryStringValue( $RegKeyRebootCounter$ + "RebootCounter") 190 if ( $RebootCounter$ = "" ) 191 set $RebootCounter$ = "0" 192 endif 193 194 [sub_set_rebootcounter] 195 if ( $RebootCounter$ = "" ) 196 set $RebootCounter$ = "0" 197 endif 198 registry_rebootcounter 199 200 [sub_do_reboot] 201 sub_set_rebootcounter 202 ExitWindows /ImmediateReboot 203 204 [registry_rebootcounter] 205 openkey $RegKeyRebootCounter$ 206 set "RebootCounter" = "$Rebootcounter$"
Note:
See TracChangeset
for help on using the changeset viewer.