Bob

Bob

Forum Replies Created

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • Bob
    Participant
    Post count: 9

    Ok thanks I guess I’m just confused now on the Deployment Type priority/order.
    If I have DT of user logged on at priority 1, application deployment will fail saying it couldn’t detect application after install completed.
    So I go log into the computer targetted and the PSADT show install welcome screen is popped up on the screen.

    I guess I’m supposed to make “user not logged on” the #1 priority DT?

  • Bob
    Participant
    Post count: 9

    Awesome thanks so much.

    Yeah I am still on the testing the deployment thing of user logged on vs user not logged on.

    So with SCCM application, I have two deployment types: 1 run with user logged on, 1 when user is not logged on — both “install for system”.
    Is that not the way I should do it?

    My end goal is really to just deploy the application silently, but, if a user is logged in, let’s show them the prompt and messages because they need to proceed at will and save their work for the impending reboot to come.

    For install part I’m using:

    <code>$UserLoggedIn = [bool](query user)
    		if ($UserLoggedIn = $true)
    		{
    		Show-InstallationWelcome -CloseApps &#039;iexplore=Internet Explorer&#039; -BlockExecution 
    		Show-InstallationProgress -StatusMessage &quot;Internet Explorer 11 installation is in progress...&lt;code&gt;nThe installation should take fewer than 10 minutes to complete.&lt;/code&gt;nA reboot will be required, so please SAVE your documents.&quot;
    
     		}
    		else 
    		{
    		Show-InstallationWelcome -CloseApps &#039;iexplore&#039; -BlockExecution -Silent
    		
    		}</code>

    For post install I’m using:

    <code>$UserLoggedIn = [bool](query user)
    		if ($UserLoggedIn = $true)
    		{
    		Show-InstallationRestartPrompt -Countdownseconds 120 -CountdownNoHideSeconds 60
    		}
    		else 
    		{ 
    		cmd.exe /c &quot;shutdown /f /r /t 0&quot;
    		}</code>
  • Bob
    Participant
    Post count: 9

    Thank you again for your help!

  • Bob
    Participant
    Post count: 9

    I wasn’t sure if WSUS or SCCM Update could deploy it.
    Right now I use WSUS only for updates (Windows, Office) and will switch to SCCM soon because it’s complicated having all these GPOs and registry settings just to get it to work right and hopefully not interrupt and end-user.

    With WSUS I deployed all the pre-requisites for IE11 over the past few months. It’s taken the environment a while to get them all, but they’re almost done.

    So the reason for creating this deployment of IE11 was to first get a grasp of how PS App Deployment toolkit works. Packaging Adobe Flash for example isn’t going to give me the same learning experience as IE11.
    The other reason is that I have to meet a deadline to get 50 specific computers updated to IE11 according to a vendor, and it’s become an “urgent” request. The rest of the 1,000 computers or so can wait around on WSUS I suppose.

  • Bob
    Participant
    Post count: 9

    I think for SCCM I will have to change “dism” command to “C:\WINDOWS\SYSNATIVE\DISM.EXE” since target computers are 64-bit Windows 7, and I understand the ConfigMgr client is 32-bit

  • Bob
    Participant
    Post count: 9

    Also this package is for Internet Explorer 11 so I’m not sure a method of uninstall would be applicable. I guess since it’s an “update”.

    This is my script here:

    <pre class=”brush: powershell; gutter: true; first-line: 1; highlight: []; html-script: false”>

    [CmdletBinding()]
    Param (
    [Parameter(Mandatory=$false)]
    [ValidateSet('Install','Uninstall')]
    [string]$DeploymentType = 'Install',
    [Parameter(Mandatory=$false)]
    [ValidateSet('Interactive','Silent','NonInteractive')]
    [string]$DeployMode = 'Interactive',
    [Parameter(Mandatory=$false)]
    [switch]$AllowRebootPassThru = $false,
    [Parameter(Mandatory=$false)]
    [switch]$TerminalServerMode = $false,
    [Parameter(Mandatory=$false)]
    [switch]$DisableLogging = $false
    )

    Try {
    ## Set the script execution policy for this process
    Try { Set-ExecutionPolicy -ExecutionPolicy 'ByPass' -Scope 'Process' -Force -ErrorAction 'Stop' } Catch {}

    ##*===============================================
    ##* VARIABLE DECLARATION
    ##*===============================================
    ## Variables: Application
    [string]$appVendor = 'Microsoft'
    [string]$appName = 'Internet Explorer'
    [string]$appVersion = '11'
    [string]$appArch = ''
    [string]$appLang = 'EN'
    [string]$appRevision = '01'
    [string]$appScriptVersion = '1.0.0'
    [string]$appScriptDate = '09/08/2016'
    [string]$appScriptAuthor = 'IT'
    ##*===============================================
    ## Variables: Install Titles (Only set here to override defaults set by the toolkit)
    [string]$installName = ''
    [string]$installTitle = ''

    ##* Do not modify section below
    #region DoNotModify

    ## Variables: Exit Code
    [int32]$mainExitCode = 0

    ## Variables: Script
    [string]$deployAppScriptFriendlyName = 'Deploy Application'
    [version]$deployAppScriptVersion = [version]'3.6.8'
    [string]$deployAppScriptDate = '02/06/2016'
    [hashtable]$deployAppScriptParameters = $psBoundParameters

    ## Variables: Environment
    If (Test-Path -LiteralPath 'variable:HostInvocation') { $InvocationInfo = $HostInvocation } Else { $InvocationInfo = $MyInvocation }
    [string]$scriptDirectory = Split-Path -Path $InvocationInfo.MyCommand.Definition -Parent

    ## Dot source the required App Deploy Toolkit Functions
    Try {
    [string]$moduleAppDeployToolkitMain = "$scriptDirectory\AppDeployToolkit\AppDeployToolkitMain.ps1"
    If (-not (Test-Path -LiteralPath $moduleAppDeployToolkitMain -PathType 'Leaf')) { Throw "Module does not exist at the specified location [$moduleAppDeployToolkitMain]." }
    If ($DisableLogging) { . $moduleAppDeployToolkitMain -DisableLogging } Else { . $moduleAppDeployToolkitMain }
    }
    Catch {
    If ($mainExitCode -eq 0){ [int32]$mainExitCode = 60008 }
    Write-Error -Message "Module [$moduleAppDeployToolkitMain] failed to load: n$($_.Exception.Message)n `n$($_.InvocationInfo.PositionMessage)" -ErrorAction 'Continue'
    ## Exit the script, returning the exit code to SCCM
    If (Test-Path -LiteralPath 'variable:HostInvocation') { $script:ExitCode = $mainExitCode; Exit } Else { Exit $mainExitCode }
    }

    #endregion
    ##* Do not modify section above
    ##*===============================================
    ##* END VARIABLE DECLARATION
    ##*===============================================

    If ($deploymentType -ine 'Uninstall') {
    ##*===============================================
    ##* PRE-INSTALLATION
    ##*===============================================
    [string]$installPhase = 'Pre-Installation'

    ## Show Welcome Message, close Internet Explorer if required, allow up to 3 deferrals, verify there is enough disk space to complete the install, and persist the prompt
    Show-InstallationWelcome -CloseApps 'iexplore' -AllowDefer -DeferTimes 3 -CheckDiskSpace -PersistPrompt

    ## Show Progress Message (with the default message)
    Show-InstallationProgress -StatusMessage "Internet Explorer 11 installation in Progress…nThe installation should take fewer than 10 minutes to complete.nA reboot will be required, so please save any work you have open at this time."

    ## <Perform Pre-Installation tasks here>

    function IsInstalled($hotfixid)
    {
    $ret = $false
    Get-WmiObject -Query "Select * from Win32_QuickFixEngineering WHERE HotfixID = '$hotfixid'" -Namespace "root\CIMV2" | ForEach-Object {
    $ret = $true
    }

    return $ret
    }

    ##*===============================================##*===============================================

    ##*===============================================
    ##* Prerequisite 1
    ##*===============================================

    $update1 = "KB2834140"
    If (IsInstalled($update1))
    {
    write-log -Message "$update1 is already installed, skipping." -source 'Isinstalled' -Logtype 'Legacy'
    }
    Else
    {
    Write-log -Message "Installing $update1…" -source 'Isinstalled' -Logtype 'Legacy'
    cmd.exe /c "C:\Windows\System32\dism.exe /online /add-package /packagepath:$dirfiles\Windows6.1-KB2834140-v2-x86.cab /quiet /norestart"
    }

    ##*===============================================
    ##* Prerequisite #2
    ##*===============================================

    $update2 = "KB2670838"
    If (IsInstalled($update2))
    {
    write-log -Message "$update2 is already installed, skipping." -source 'Isinstalled' -Logtype 'Legacy'
    }
    Else
    {
    write-log -Message "Installing $update2…" -source 'Isinstalled' -Logtype 'Legacy'
    cmd.exe /c "C:\Windows\System32\dism.exe /online /add-package /packagepath:$dirfiles\KB2670838_x86.CAB /quiet /norestart"
    }

    ##*===============================================
    ##* Prerequisite #3
    ##*===============================================

    $update3 = "KB2639308"
    If (IsInstalled($update3))
    {
    write-log -Message "$update2 is already installed, skipping." -source 'Isinstalled' -Logtype 'Legacy'
    }
    Else
    {
    write-log -Message "Installing $update2…" -source 'Isinstalled' -Logtype 'Legacy'
    cmd.exe /c "C:\Windows\System32\dism.exe /online /add-package /packagepath:$dirfiles\KB2639308_x86.CAB /quiet /norestart"
    }

    ##*===============================================
    ##* Prerequisite 4
    ##*===============================================

    $update4 = "KB2731771"
    If (IsInstalled($update4))
    {
    write-log -Message "$update4 is already installed, skipping." -source 'Isinstalled' -Logtype 'Legacy'
    }
    Else
    {
    write-log -Message "Installing $update4…" -source 'Isinstalled' -Logtype 'Legacy'
    cmd.exe /c "C:\Windows\System32\dism.exe /online /add-package /packagepath:$dirfiles\KB2731771_x86.CAB /quiet /norestart"
    }

    ##*===============================================
    ##* Prerequisite #5
    ##*===============================================

    $update5 = "KB2729094"
    If (IsInstalled($update5))
    {
    write-log -Message "$update5 is already installed, skipping." -source 'Isinstalled' -Logtype 'Legacy'
    }
    Else
    {
    write-log -Message "Installing $update5…" -source 'Isinstalled' -Logtype 'Legacy'
    cmd.exe /c " C:\Windows\System32\dism.exe /online /add-package /packagepath:$dirfiles\Windows6.1-KB2729094-v2-x86.cab /quiet /norestart"
    }

    ##*===============================================
    ##* Prerequisite #6
    ##*===============================================

    $update6 = "KB2786081"
    If (IsInstalled($update6))
    {
    write-log -Message "$update6 is already installed, skipping." -source 'Isinstalled' -Logtype 'Legacy'
    }
    Else
    {
    write-log -Message "Installing $update6…" -source 'Isinstalled' -Logtype 'Legacy'
    cmd.exe /c "C:\Windows\System32\dism.exe /online /add-package /packagepath:$dirfiles\KB2786081_x86.CAB /quiet /norestart"
    }

    ##*===============================================
    ##* Prerequisite 7
    ##*===============================================

    $update7 = "KB2888049"
    If (IsInstalled($update7))
    {
    write-log -Message "$update7 is already installed, skipping." -source 'Isinstalled' -Logtype 'Legacy'
    }
    Else
    {
    write-log -Message "Installing $update7…" -source 'Isinstalled' -Logtype 'Legacy'
    cmd.exe /c "C:\Windows\System32\dism.exe /online /add-package /packagepath:$dirfiles\Windows6.1-KB2888049-x86.cab /quiet /norestart"
    }

    ##*===============================================
    ##* Prerequisite 8
    ##*===============================================

    $update8 = "KB2882822"
    If (IsInstalled($update8))
    {
    write-log -Message "$update8 is already installed, skipping." -source 'Isinstalled' -Logtype 'Legacy'
    }
    Else
    {
    write-log -Message "Installing $update8…" -source 'Isinstalled' -Logtype 'Legacy'
    cmd.exe /c "C:\Windows\System32\dism.exe /online /add-package /packagepath:$dirfiles\Windows6.1-KB2882822-x86.cab /quiet /norestart"
    }
    ##*===============================================##*===============================================

    ##*===============================================
    ##* INSTALLATION
    ##*===============================================
    [string]$installPhase = 'Installation'

    ## Handle Zero-Config MSI Installations
    If ($useDefaultMsi) {
    [hashtable]$ExecuteDefaultMSISplat = @{ Action = 'Install'; Path = $defaultMsiFile }; If ($defaultMstFile) { $ExecuteDefaultMSISplat.Add('Transform', $defaultMstFile) }
    Execute-MSI @ExecuteDefaultMSISplat; If ($defaultMspFiles) { $defaultMspFiles | ForEach-Object { Execute-MSI -Action 'Patch' -Path $_ } }
    }

    ## <Perform Installation tasks here>

    write-log -Message "Installing IE11" -source 'Isinstalled' -Logtype 'Legacy'
    cmd.exe /c "C:\Windows\System32\dism.exe /online /add-package /packagepath:$dirfiles\IE-Win7.cab /quiet /norestart"

    write-log -Message "Installing Spelling package" -source 'Isinstalled' -Logtype 'Legacy'
    cmd.exe /c "C:\Windows\System32\dism.exe /online /add-package /packagepath:$dirfiles\Windows6.3-KB2849696-x86.cab /quiet /norestart"

    write-log -Message "Installing Hyphenation package" -source 'Isinstalled' -Logtype 'Legacy'
    cmd.exe /c "C:\Windows\System32\dism.exe /online /add-package /packagepath:$dirfiles\Windows6.3-KB2849697-x86.cab /quiet /norestart"

    ##*===============================================
    ##* POST-INSTALLATION
    ##*===============================================
    [string]$installPhase = 'Post-Installation'

    ## <Perform Post-Installation tasks here>

    write-log -Message "Installing IE11 CU Aug Update" -source 'Isinstalled' -Logtype 'Legacy'
    cmd.exe /c "C:\Windows\System32\dism.exe /online /add-package /packagepath:$dirfiles\IE11-Windows6.1-KB3175443-x64.cab /quiet /norestart"

    ## Display a message at the end of the install
    # If (-not $useDefaultMsi) { Show-InstallationPrompt -Message 'Internet Explorer 11 upgrade is complete.' -ButtonRightText 'OK' -Icon Information -NoWait }
    Show-DialogBox -Title 'Internet Explorer 11 installation Complete' -Text 'Internet Explorer 11 installation has completed. Please click OK and restart your computer.' -Icon 'Information'
    Show-InstallationRestartPrompt -Countdownseconds 600 -CountdownNoHideSeconds 60
    }
    ElseIf ($deploymentType -ieq 'Uninstall')
    {
    ##*===============================================
    ##* PRE-UNINSTALLATION
    ##*===============================================
    [string]$installPhase = 'Pre-Uninstallation'

    ## Show Welcome Message, close Internet Explorer with a 60 second countdown before automatically closing
    Show-InstallationWelcome -CloseApps 'iexplore' -CloseAppsCountdown 60

    ## Show Progress Message (with the default message)
    Show-InstallationProgress

    ## <Perform Pre-Uninstallation tasks here>

    ##*===============================================
    ##* UNINSTALLATION
    ##*===============================================
    [string]$installPhase = 'Uninstallation'

    ## Handle Zero-Config MSI Uninstallations
    If ($useDefaultMsi) {
    [hashtable]$ExecuteDefaultMSISplat = @{ Action = 'Uninstall'; Path = $defaultMsiFile }; If ($defaultMstFile) { $ExecuteDefaultMSISplat.Add('Transform', $defaultMstFile) }
    Execute-MSI @ExecuteDefaultMSISplat
    }

    # <Perform Uninstallation tasks here>

    ##*===============================================
    ##* POST-UNINSTALLATION
    ##*===============================================
    [string]$installPhase = 'Post-Uninstallation'

    ## <Perform Post-Uninstallation tasks here>

    }

    ##*===============================================
    ##* END SCRIPT BODY
    ##*===============================================

    ## Call the Exit-Script function to perform final cleanup operations
    Exit-Script -ExitCode $mainExitCode
    }
    Catch {
    [int32]$mainExitCode = 60001
    [string]$mainErrorMessage = "$(Resolve-Error)"
    Write-Log -Message $mainErrorMessage -Severity 3 -Source $deployAppScriptFriendlyName
    Show-DialogBox -Text $mainErrorMessage -Icon 'Stop'
    Exit-Script -ExitCode $mainExitCode
    }

  • Bob
    Participant
    Post count: 9

    Ah ok, got it, yes I think that’s what I was looking for. I’ll give it some testing.
    Didn’t know if I was allowed to do that. I just figured that if a user is logged in, they’d get Windows to interact with to close applications, and remember to save their work before a reboot was imposed.
    Otherwise, if no one was logged in, I wasn’t sure how to force a reboot with Show-InstallationRestartPrompt

  • Bob
    Participant
    Post count: 9

    * Duplicate the Application and have a deployment type with Whether or Not a User is logged on only for use in Task Sequence (Double administrative effort).

    Does this mean if I have one deployment type for whether or not user is logged on, and one for system only (user not logged on), that I can deploy the application to all computers, and it will run the respective deployment type depending on whether a user is logged in or not?

    And, I take it, in the “user not logged on” one, I would need to change the code to install and reboot silently…?

Viewing 8 posts - 1 through 8 (of 8 total)