Skip to content

Commit

Permalink
Update Deploy-Application.ps1
Browse files Browse the repository at this point in the history
  • Loading branch information
rgsteele committed Feb 29, 2020
1 parent 5eb68ed commit b5c74e4
Showing 1 changed file with 14 additions and 8 deletions.
22 changes: 14 additions & 8 deletions Toolkit/Deploy-Application.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -76,12 +76,12 @@ Try {
## Variables: Application
[string]$appVendor = 'Lenovo'
[string]$appName = 'Thin Installer'
[string]$appVersion = '1.3.0007'
[string]$appVersion = '1.3.0018'
[string]$appArch = ''
[string]$appLang = 'EN'
[string]$appRevision = '01'
[string]$appScriptVersion = '1.0.0'
[string]$appScriptDate = '2019-06-17'
[string]$appScriptDate = '2020-01-13'
[string]$appScriptAuthor = 'Ryan Steele'
##*===============================================
## Variables: Install Titles (Only set here to override defaults set by the toolkit)
Expand Down Expand Up @@ -159,9 +159,10 @@ Try {
}
If (-not (Test-Path (Join-Path -Path $repositoryLocation -ChildPath 'database.xml'))) {
Write-Log "ERROR: No database.xml found in $repositoryLocation"
Exit-Script 69001
Exit-Script 1618 # Network may be disconnected, so do a fast retry
}
Execute-Process -Path "ThinInstaller.exe" -Parameters "/CM -search A -action SCAN -repository $RepositoryLocation -includerebootpackages 1,3,4,5 $exportToWMIswitch"
Execute-Process -Path "ThinInstaller.exe" -Parameters "/CM -search A -action SCAN -repository $RepositoryLocation -includerebootpackages 1,3,4,5 $exportToWMIswitch" `
-ContinueOnError $true

## Load SQLite DB generated by Thin Installer
Add-Type -Path (Join-Path -Path $dirFiles -ChildPath "System.Data.SQLite.dll")
Expand Down Expand Up @@ -209,12 +210,13 @@ Try {

## First, install any updates that don't force a reboot
If ($rebootTypeCount[0] -or $rebootTypeCount[3]) {
Write-Log "Installing updates of type 0 and 3"
Execute-Process -Path "ThinInstaller.exe" `
-Parameters "/CM -search A -action INSTALL -repository $RepositoryLocation -includerebootpackages 3 -noicon -noreboot $exportToWMISwitch"
}

## If a user is logged in, request to install updates requiring an immediate reboot or shutdown
If ($isProcessUserInteractive -and ($rebootTypeCount[1] -or $rebootTypeCount[4] -or $rebootTypeCount[5])) {
If ($currentLoggedOnUserSession -and ($rebootTypeCount[1] -or $rebootTypeCount[4] -or $rebootTypeCount[5])) {
Write-Log "Install will force reboot or shutdown, so prompting user"
$message = 'An important software update is available. This update will restart your computer, so save and close your documents before proceeding. '`
+ 'Do not unplug or shut down your computer until the Windows sign in screen is displayed.'
Expand Down Expand Up @@ -252,7 +254,8 @@ Try {
}
Show-InstallationProgress -StatusMessage "Installation in progress.`nDo not unplug or shut down your computer."
Execute-Process -Path "ThinInstaller.exe" `
-Parameters "/CM -search A -action INSTALL -repository $RepositoryLocation -includerebootpackages 1,4,5 -nocontinueafterreboot -noicon $exportToWMISwitch"
-Parameters "/CM -search A -action INSTALL -repository $RepositoryLocation -includerebootpackages 1,4,5 -nocontinueafterreboot -noicon $exportToWMISwitch" `
-ContinueOnError $true
}
}

Expand All @@ -263,10 +266,13 @@ Try {
[string]$installPhase = 'Post-Installation'

If ($rebootTypeCount[3]) {
If (-not $isProcessUserInteractive) { Exit-Script 3010 }
If (-not $currentLoggedOnUserSession) { Exit-Script 3010 }
Show-InstallationRestartPrompt -CountdownSeconds 28800 -CountdownNoHideSeconds 3600
} ElseIf ($rebootTypeCount[1] -or $rebootTypeCount[4] -or $rebootTypeCount[5]) {
If ($userResponse -eq $deferText) { Start-Sleep 1200 } ## TODO: Make delay value a parameter to the script
If ($currentLoggedOnUserSession -and ($userResponse -eq $deferText)) {
Write-Log "$userResponse -eq $deferText, Starting sleep"
Start-Sleep 1200 ## TODO: Make delay value a parameter to the script
}
Exit-Script 1618
}

Expand Down

0 comments on commit b5c74e4

Please sign in to comment.