| 39 | |
| 40 | === CARestoreSetupState === |
| 41 | |
| 42 | Restore the previous setup parameters from the registry. |
| 43 | |
| 44 | Registry location: HKLM\Software\Space Sciences Laboratory, U.C. Berkeley\BOINC Setup |
| 45 | |
| 46 | || Execution After: || ISSetupFilesExtract || |
| 47 | || Execution Condition: || || |
| 48 | |
| 49 | Pseudocode: |
| 50 | {{{ |
| 51 | GetRegistryValue( "INSTALLDIR", strInstallDirectory ); |
| 52 | GetRegistryValue( "SETUPTYPE", strSetupType ); |
| 53 | GetRegistryValue( "LAUNCHPROGRAM", strLaunchProgram ); |
| 54 | GetRegistryValue( "ENABLELAUNCHATLOGON", strEnableLaunchAtLogon ); |
| 55 | GetRegistryValue( "ENABLESCREENSAVER", strEnableScreensaver ); |
| 56 | GetRegistryValue( "SERVICE_DOMAIN", strServiceDomain ); |
| 57 | GetRegistryValue( "SERVICE_USERNAME", strServiceUsername ); |
| 58 | |
| 59 | SET INSTALLDIR TO strInstallDirectory |
| 60 | SET SETUPTYPE TO strSetupType |
| 61 | SET LAUNCHPROGRAM TO strLaunchProgram |
| 62 | SET ENABLELAUNCHATLOGON TO strEnableLaunchAtLogon |
| 63 | SET ENABLESCREENSAVER TO strEnableScreensaver |
| 64 | SET SERVICE_DOMAIN TO strServiceDomain |
| 65 | SET SERVICE_USERNAME TO strServiceUsername |
| 66 | |
| 67 | RETURN SUCCESS |
| 68 | }}} |
| 69 | |
| 70 | === CASaveSetupState === |
| 71 | |
| 72 | Save the current setup parameters to the registry. |
| 73 | |
| 74 | Registry location: HKLM\Software\Space Sciences Laboratory, U.C. Berkeley\BOINC Setup |
| 75 | |
| 76 | || Execution After: || ExecuteAction || |
| 77 | || Execution Condition: || || |
| 78 | |
| 79 | Pseudocode: |
| 80 | {{{ |
| 81 | GET INSTALLDIR STORE strInstallDirectory |
| 82 | GET SETUPTYPE STORE strSetupType |
| 83 | GET LAUNCHPROGRAM STORE strLaunchProgram |
| 84 | GET ENABLELAUNCHATLOGON STORE strEnableLaunchAtLogon |
| 85 | GET ENABLESCREENSAVER STORE strEnableScreensaver |
| 86 | GET SERVICE_DOMAIN STORE strServiceDomain |
| 87 | GET SERVICE_USERNAME STORE strServiceUsername |
| 88 | |
| 89 | SetRegistryValue( "INSTALLDIR", strInstallDirectory ); |
| 90 | SetRegistryValue( "SETUPTYPE", strSetupType ); |
| 91 | SetRegistryValue( "LAUNCHPROGRAM", strLaunchProgram ); |
| 92 | SetRegistryValue( "ENABLELAUNCHATLOGON", strEnableLaunchAtLogon ); |
| 93 | SetRegistryValue( "ENABLESCREENSAVER", strEnableScreensaver ); |
| 94 | SetRegistryValue( "SERVICE_DOMAIN", strServiceDomain ); |
| 95 | SetRegistryValue( "SERVICE_USERNAME", strServiceUsername ); |
| 96 | SetRegistryValue( "SETUPSTATESTORED", strSetupStateStored ); |
| 97 | |
| 98 | RETURN SUCCESS |
| 99 | }}} |
| 124 | |
| 125 | === CAValidateServiceAccount === |
| 126 | |
| 127 | Validates the service parameters passed to the execution phase. |
| 128 | |
| 129 | || Execution After: || CAValidateSetupType || |
| 130 | || Execution Condition: || VersionNT AND (SETUPTYPE = "Service OR SETUPTYPE = "ServiceGUI") || |
| 131 | |
| 132 | Pseudocode: |
| 133 | {{{ |
| 134 | IF ServicePassword IS NULL |
| 135 | IF (ServiceDomainUsername IS NOT 'LOCALSYSTEM') AND (ServiceDomainUsername IS NOT 'NetworkService') |
| 136 | RETURN ERROR |
| 137 | END IF |
| 138 | END IF |
| 139 | |
| 140 | IF ServiceDomainUsername IS NULL |
| 141 | IF (ServiceDomain IS NULL) OR (ServiceUsername IS NULL) |
| 142 | RETURN ERROR |
| 143 | END IF |
| 144 | ELSE |
| 145 | SET ServiceDomain TO "Domain portion of ServiceDomainUsername" |
| 146 | SET ServiceUsername TO "Username portion of ServiceDomainUsername" |
| 147 | END IF |
| 148 | |
| 149 | RETURN SUCCESS |
| 150 | }}} |
| 151 | |
| 152 | === CAShutdownBOINC === |
| 153 | |
| 154 | Gracefully shutdown BOINC if it is running, if that fails terminate it. |
| 155 | |
| 156 | || Execution After: || CAValidateServiceAccount || |
| 157 | || Execution Condition: || VersionNT AND NOT INSTALLED || |
| 158 | |
| 159 | Pseudocode: |
| 160 | {{{ |
| 161 | IF BOINCIsRunning() = TRUE |
| 162 | ShutdownBOINC() |
| 163 | END IF |
| 164 | TerminateBOINC() |
| 165 | |
| 166 | RETURN SUCCESS |
| 167 | }}} |
| 168 | |
| 169 | === CAShutdownBOINCManager === |
| 170 | |
| 171 | Gracefully shutdown BOINC Manager if it is running, if that fails terminate it. |
| 172 | |
| 173 | || Execution After: || CAShutdownBOINC || |
| 174 | || Execution Condition: || VersionNT AND NOT INSTALLED || |
| 175 | |
| 176 | Pseudocode: |
| 177 | {{{ |
| 178 | IF BOINCManagerIsRunning() = TRUE |
| 179 | ShutdownBOINCManager() |
| 180 | END IF |
| 181 | TerminateBOINCManager() |
| 182 | |
| 183 | RETURN SUCCESS |
| 184 | }}} |
| 185 | |
| 186 | === CAShutdownBOINCManager95 === |
| 187 | |
| 188 | Gracefully shutdown BOINC Manager if it is running, if that fails terminate it. |
| 189 | |
| 190 | || Execution After: || CAShutdownBOINCManager || |
| 191 | || Execution Condition: || Version95 AND NOT INSTALLED || |
| 192 | |
| 193 | Pseudocode: |
| 194 | {{{ |
| 195 | IF BOINCManagerIsRunning() = TRUE |
| 196 | ShutdownBOINCManager() |
| 197 | END IF |
| 198 | TerminateBOINCManager() |
| 199 | |
| 200 | RETURN SUCCESS |
| 201 | }}} |
| 202 | |
| 203 | === CAShutdownBOINCScreensaver === |
| 204 | |
| 205 | Gracefully shutdown BOINC Screensaver if it is running, if that fails terminate it. |
| 206 | |
| 207 | || Execution After: || CAShutdownBOINCManager95 || |
| 208 | || Execution Condition: || VersionNT AND NOT INSTALLED || |
| 209 | |
| 210 | Pseudocode: |
| 211 | {{{ |
| 212 | IF BOINCScreensaverIsRunning() = TRUE |
| 213 | ShutdownBOINCScreensaver() |
| 214 | END IF |
| 215 | TerminateBOINCScreensaver() |
| 216 | |
| 217 | RETURN SUCCESS |
| 218 | }}} |
| 219 | |
| 220 | === CAMigratex86x64 === |
| 221 | |
| 222 | Migrate BOINC Data from the 32-bit application storage location to the 64-bit application storage location. |
| 223 | |
| 224 | || Execution After: || CAShutdownBOINCScreensaver || |
| 225 | || Execution Condition: || || |
| 226 | |
| 227 | Pseudocode: |
| 228 | {{{ |
| 229 | MoveFileEx( |
| 230 | "C:\Program Files (x86)\BOINC", |
| 231 | InstallDir, |
| 232 | MOVEFILE_COPY_ALLOWED|MOVEFILE_WRITE_THROUGH |
| 233 | ) |
| 234 | |
| 235 | RETURN SUCCESS |
| 236 | }}} |
| 237 | |
| 238 | === CAMigrateCPDNBBC === |
| 239 | |
| 240 | Migrate the CPDNBBC data from the specialized CPDNBBC directory to the standard BOINC installation directory. |
| 241 | |
| 242 | || Execution After: || CAMigratex86x64 || |
| 243 | || Execution Condition: || || |
| 244 | |
| 245 | Pseudocode: |
| 246 | {{{ |
| 247 | MoveFileEx( |
| 248 | "C:\Program Files\Climate Change Experiment", |
| 249 | InstallDir, |
| 250 | MOVEFILE_COPY_ALLOWED|MOVEFILE_WRITE_THROUGH |
| 251 | ) |
| 252 | |
| 253 | RETURN SUCCESS |
| 254 | }}} |
| 255 | |
| 256 | === CACleanupOldBinaries === |
| 257 | |
| 258 | After uninstalling any older versions of BOINC, make sure all BOINC related binaries have been deleted from the system. |
| 259 | |
| 260 | || Execution After: || CAMigrateCPDNBBC || |
| 261 | || Execution Condition: || || |
| 262 | |
| 263 | Pseudocode: |
| 264 | {{{ |
| 265 | DeleteFile(InstallDir + "\boinc.exe"); |
| 266 | DeleteFile(InstallDir + "\boincmgr.exe"); |
| 267 | DeleteFile(InstallDir + "\boinccmd.exe"); |
| 268 | DeleteFile(InstallDir + "\boinc.dll"); |
| 269 | DeleteFile(InstallDir + "\libcurl.dll"); |
| 270 | DeleteFile(InstallDir + "\libeay32.dll"); |
| 271 | DeleteFile(InstallDir + "\ssleay32.dll"); |
| 272 | DeleteFile(InstallDir + "\zlib1.dll"); |
| 273 | DeleteFile(InstallDir + "\dbghelp.dll"); |
| 274 | DeleteFile(InstallDir + "\dbghelp95.dll"); |
| 275 | DeleteFile(InstallDir + "\srcsrv.dll"); |
| 276 | DeleteFile(InstallDir + "\symsrv.dll"); |
| 277 | |
| 278 | RETURN SUCCESS |
| 279 | }}} |
| 280 | |
| 281 | === CAGrantServiceExecutionRight === |
| 282 | |
| 283 | Make sure the service user account is allowed to execute services. |
| 284 | |
| 285 | || Execution After: || InstallInitialize || |
| 286 | || Execution Condition: || VersionNT And (SETUPTYPE = "Service" Or SETUPTYPE = "ServiceGUI") And SERVICE_GRANTEXECUTIONRIGHT = "1" || |
| 287 | |
| 288 | Pseudocode: |
| 289 | {{{ |
| 290 | pSID = GetAccountSid(ServiceDomainUsername) |
| 291 | SetPrivilegeOnAccount( |
| 292 | pSID, |
| 293 | "SeServiceLogonRight", |
| 294 | TRUE |
| 295 | ) |
| 296 | |
| 297 | RETURN SUCCESS |
| 298 | }}} |
| 299 | |
| 300 | === CAGetAdministratorsGroupName === |
| 301 | |
| 302 | Convert the well known group SID into the human readable localized version of the name. |
| 303 | |
| 304 | || Execution After: || CAGrantServiceExecutionRight || |
| 305 | || Execution Condition: || VersionNT || |
| 306 | |
| 307 | Pseudocode: |
| 308 | {{{ |
| 309 | GroupName = LookupAliasFromRid(NULL, DOMAIN_ALIAS_RID_ADMINS) |
| 310 | SET GROUPALIAS_ADMINISTRATORS TO GroupName |
| 311 | |
| 312 | |
| 313 | RETURN SUCCESS |
| 314 | }}} |
| 315 | |
| 316 | === CAGetAdministratorsUsersName === |
| 317 | |
| 318 | Convert the well known group SID into the human readable localized version of the name. |
| 319 | |
| 320 | || Execution After: || CAGrantServiceExecutionRight || |
| 321 | || Execution Condition: || VersionNT || |
| 322 | |
| 323 | Pseudocode: |
| 324 | {{{ |
| 325 | GroupName = LookupAliasFromRid(NULL, DOMAIN_ALIAS_RID_USERS) |
| 326 | SET GROUPALIAS_USERS TO GroupName |
| 327 | |
| 328 | |
| 329 | RETURN SUCCESS |
| 330 | }}} |
| 331 | |