Quantcast
Channel: PowerShell App Deployment Toolkit
Viewing all 2341 articles
Browse latest View live

New Post: Progress Prompt fails to update

$
0
0
Hi,

Sorry it's very difficult to troubleshoot this without more details or being able to reproduce it. Are there any patterns you can identify between machines that exhibit the issue and those that don't? e,g, what version of .NET and PowerShell are the machines running?

Can you post your script here? It would still be useful to see the log file also as it may give some clues.

For the Welcome window closing running apps without prompting first we would need to see the log file to troubleshoot this.

Sean

New Post: Show-InstallationWelcome

$
0
0
It would be possible to hide the close programs button, but it's not an option we're looking to add without a better use case. Sounds like a problem with your Office installation/configuration, I'd suggest trying to fix the underlying issue.

New Post: Regarding the SCCM limitation with Applications and "allow user to interact with program installation"

$
0
0
We're trying to get to the bottom of the issues with ServiceUI and I think we're close to fixing it but we need a bit of help from the community to test.

I've updated the latest v4 beta.

Could you do us a favour and run the following tests:

-Run the latest v3 toolkit using <ServiceUIx64.exe Deploy-Application.exe> as a 64-bit installation
-Run the latest v4 toolkit as a 64-bit installation.
-Run the latest v4 toolkit as a 64-bit installation launching 32-bit PowerShell.
-Run the latest v4 toolkit as a 64-bit installation launching PowerShell.exe -File "Deploy-Application.ps1" instead of the Deploy-Application.exe

We need to establish if the access denied message with ServiceUI is because ServiceUIx64 doesn't play well at all with ccmexec.exe, ServiceUIx86 doesn't play well with ccmexec 64-bit, or it has something to do with Deploy-Application.exe or the PSArchitecture.

Your support would be much appreciated.

PS - I'm working without an SCCM lab at the moment which is why I can't do these tests myself - anyone got a cloud based lab they're willing to give me access to ?!

New Post: Wait for response if machine is locked

$
0
0
Hi, this is slightly surprising behaviour - would you mind posting a log file up so we can take a look?

New Post: Show-InstallationRestartPrompt

$
0
0
Hi,

We always pass control back to SCCM when showing the restart prompt as otherwise SCCM would see error codes for successful installations. We could add that parameter to wait for the user to click restart, then pass the exit code back to SCCM, then restart the machine, but you could still have users who opt for Start -> Restart. Then you have a failed installation error code, so it's always going to be best practice to pass control back to SCCM and show the restart prompt asynchronously.

Hope that makes sense.

Sean

New Post: Installation failed message

$
0
0
Yes, you could modify the Exit-Script function to show a prompt - see below. If you're going to modify the core toolkit, I'd suggest using the Toolkit Extensions, I haven't tested it but I think a modified Exit-Script function in the extension will override the one in the main toolkit.

ElseIf ($installSuccess -eq $false) {
    Write-Log "$installName $deploymentTypeName completed with exit code [$exitcode]."
# Display a message at the end of the install
Show-InstallationPrompt -Message "Installation failed." -ButtonRightText "Ok" -Icon InformationError -NoWait

    If ($exitCode -eq $configInstallationUIExitCode -or $exitCode -eq $configInstallationDeferExitCode) {
        $balloonText = "$deploymentTypeName $configBalloonTextFastRetry"
        Show-BalloonTip -BalloonTipIcon "Warning" -BalloonTipText "$balloonText"
    }
    Else {
        $balloonText = "$deploymentTypeName $configBalloonTextError"
        Show-BalloonTip -BalloonTipIcon "Error" -BalloonTipText "$balloonText"
    }
}

New Post: Regarding the SCCM limitation with Applications and "allow user to interact with program installation"

$
0
0
I could also help testing those scenarios, but I can only find v 3.1.4 for download. Where can I get v4 (beta)?

New Post: Regarding the SCCM limitation with Applications and "allow user to interact with program installation"

$
0
0
Great stuff, you can find the latest version in the sources tab. Thanks.

New Post: Regarding the SCCM limitation with Applications and "allow user to interact with program installation"

$
0
0
I would like to test this also but when I go to the Sources location to download, the v4 Beta is not available to download, can you point me in the right direction please?

New Post: Regarding the SCCM limitation with Applications and "allow user to interact with program installation"

$
0
0
Click Source Code on the nav bar at the top, then click the Download button. This will pull the latest sources.

Dan

Source code checked in, #6c87edcea5051b20abd2725791fbf4fc4f6a47ad

$
0
0
Fixes to x64 OS + x86 process detection for ServiceUI

New Post: Supersedence Behavior (SCCM2012r2)

$
0
0
Here you go .... Strange things going on ;-) (FYI: I was logged in for each test!)


Test 1: Run the latest v4 toolkit as a 64-bit installation.


[07-07-2014 20:07:44] [Initialization] Deployment type is [Installation]
[07-07-2014 20:07:44] [Initialization] Script [C:\Windows\ccmcache\p\AppDeployToolkit\AppDeployToolkitMain.ps1] dot-source invoked by [C:\Windows\ccmcache\p\Deploy-Application.ps1]
[07-07-2014 20:07:45] [Initialization] The following users are logged on to the system: MSSCCMFAQ\torsten
[07-07-2014 20:07:45] [Initialization] __Session 0 detected.
[07-07-2014 20:07:45] [Initialization] Invoking ServiceUI to provide interaction in the system session...
[07-07-2014 20:07:46] [Initialization] Executing [C:\Windows\ccmcache\p\AppDeployToolkit__ServiceUIx86.exe
C:\WINDOWS\System32\WindowsPowerShell\v1.0\powershell.exe -ExecutionPolicy Bypass -NoProfile -WindowStyle Hidden -File "C:\Windows\ccmcache\p\Deploy-Application.ps1"]...
[07-07-2014 20:07:46] [Initialization] Working Directory is [C:\Windows\ccmcache\p\AppDeployToolkit]
[07-07-2014 20:07:46] [Initialization] Execution completed with return code -1.
[07-07-2014 20:07:46] [Initialization] ServiceUI: [winlogon.exe] Session: [1] PID [540] [Target Session [1] = Match]

[07-07-2014 20:07:46] [Initialization] ServiceUI: Program to launch : [C:\WINDOWS\System32\WindowsPowerShell\v1.0\powershell.exe]

[07-07-2014 20:07:46] [Initialization] ServiceUI: Command line : [C:\WINDOWS\System32\WindowsPowerShell\v1.0\powershell.exe -ExecutionPolicy Bypass -NoProfile -WindowStyle Hidden -File C:\Windows\ccmcache\p\Deploy-Application.ps1]

[07-07-2014 20:07:46] [Initialization] ServiceUI: API [CreateProcessAsUser] Error: [5]

[07-07-2014 20:07:46] [Initialization] ServiceUI returned exit code [-1]
[07-07-2014 20:07:46] [Initialization] Microsoft_ConfigMgrSupportCenter_2012_EN_1 Installation completed with exit code [-1].
[07-07-2014 20:07:47] [Initialization] ----------------------------------------------------------------------------------------------------------

+++ Application not discovered. [AppDT Id: ScopeId_9CF7DEB9-6D21-4D41-B660-CC4E9ED87B1D/DeploymentType_efd2d033-784d-4edf-8adc-2d8a041c29a6, Revision: 1] AppEnforce 07.07.2014 20:07:31 3076 (0x0C04)
App enforcement environment: 
Context: Machine
Command line: "Deploy-Application.EXE"
Allow user interaction: No
UI mode: 1
User token: null
Session Id: 4294967295
Content path: C:\WINDOWS\ccmcache\p
Working directory:  AppEnforce  07.07.2014 20:07:31 3076 (0x0C04)
Prepared working directory: C:\WINDOWS\ccmcache\p   AppEnforce  07.07.2014 20:07:31 3076 (0x0C04)
Prepared command line: "C:\WINDOWS\ccmcache\p\Deploy-Application.EXE"   AppEnforce  07.07.2014 20:07:31 3076 (0x0C04)
Executing Command line: "C:\WINDOWS\ccmcache\p\Deploy-Application.EXE" with system context  AppEnforce  07.07.2014 20:07:31 3076 (0x0C04)
Working directory C:\WINDOWS\ccmcache\p AppEnforce  07.07.2014 20:07:31 3076 (0x0C04)
Post install behavior is BasedOnExitCode    AppEnforce  07.07.2014 20:07:31 3076 (0x0C04)
Waiting for process 1844 to finish.  Timeout = 120 minutes. AppEnforce  07.07.2014 20:07:31 3076 (0x0C04)
Process 1844 terminated with exitcode: 65535    AppEnforce  07.07.2014 20:07:48 3076 (0x0C04)
Looking for exit code 65535 in exit codes table...  AppEnforce  07.07.2014 20:07:48 3076 (0x0C04)
Unmatched exit code (65535) is considered an execution failure. AppEnforce  07.07.2014 20:07:48 3076 (0x0C04)
++++++ App enforcement completed (16 seconds) for App DT "PADT V4" [ScopeId_9CF7DEB9-6D21-4D41-B660-CC4E9ED87B1D/DeploymentType_efd2d033-784d-4edf-8adc-2d8a041c29a6], Revision: 1, User SID: ] ++++++ AppEnforce 07.07.2014 20:07:48 3076 (0x0C04)

New Post: Supersedence Behavior (SCCM2012r2)

$
0
0
Test 2: Run the latest v4 toolkit as a 64-bit installation launching 32-bit PowerShell (--> using "Run installation program as 32bit process on 64bit clients) --> is this what you wanted us to test?


[07-07-2014 20:26:44] [Initialization] Deployment type is [Installation]
[07-07-2014 20:26:44] [Initialization] Script [C:\Windows\ccmcache\p\AppDeployToolkit\AppDeployToolkitMain.ps1] dot-source invoked by [C:\Windows\ccmcache\p\Deploy-Application.ps1]
[07-07-2014 20:26:44] [Initialization] The following users are logged on to the system: MSSCCMFAQ\torsten
[07-07-2014 20:26:44] [Initialization] Session 0 not detected.
[07-07-2014 20:26:44] [Initialization] Installation is running in [Interactive] mode.
[07-07-2014 20:26:44] [Pre-Installation] Getting deferral history...
[07-07-2014 20:26:44] [Pre-Installation] Getting Registry key [Registry::\HKEY_LOCAL_MACHINE\SOFTWARE\PSAppDeployToolkit\DeferHistory\Microsoft_ConfigMgrSupportCenter_2012_EN_1] ...
[07-07-2014 20:26:44] [Pre-Installation] Registry key does not exist: [Registry::\HKEY_LOCAL_MACHINE\SOFTWARE\PSAppDeployToolkit\DeferHistory\Microsoft_ConfigMgrSupportCenter_2012_EN_1]
[07-07-2014 20:26:44] [Pre-Installation] User now has [2] deferrals remaining.
[07-07-2014 20:26:44] [Pre-Installation] Checking for running applications [notepad]...
[07-07-2014 20:26:44] [Pre-Installation] The following processes are running: [notepad]
[07-07-2014 20:26:44] [Pre-Installation] Resolving process descriptions...
[07-07-2014 20:26:44] [Pre-Installation] Finished checking running applications.
[07-07-2014 20:26:45] [Pre-Installation] Prompting user to close application(s) [notepad]...
[07-07-2014 20:26:45] [Pre-Installation] User has the option to defer.
App enforcement environment: 
Context: Machine
Command line: "Deploy-Application.EXE"
Allow user interaction: No
UI mode: 1
User token: null
Session Id: 4294967295
Content path: C:\WINDOWS\ccmcache\p
Working directory:  AppEnforce  07.07.2014 20:26:25 804 (0x0324)
Prepared working directory: C:\WINDOWS\ccmcache\p   AppEnforce  07.07.2014 20:26:25 804 (0x0324)
Prepared command line: "C:\WINDOWS\ccmcache\p\Deploy-Application.EXE"   AppEnforce  07.07.2014 20:26:25 804 (0x0324)
Post install behavior is BasedOnExitCode    AppEnforce  07.07.2014 20:26:26 804 (0x0324)
Waiting for process 768 to finish.  Timeout = 120 minutes.  AppEnforce  07.07.2014 20:26:26 804 (0x0324)
Process 768 terminated with exitcode: 0 AppEnforce  07.07.2014 20:28:09 804 (0x0324)
Looking for exit code 0 in exit codes table...  AppEnforce  07.07.2014 20:28:09 804 (0x0324)
Matched exit code 0 to a Success entry in exit codes table. AppEnforce  07.07.2014 20:28:09 804 (0x0324)
Performing detection of app deployment type PADT V4(ScopeId_9CF7DEB9-6D21-4D41-B660-CC4E9ED87B1D/DeploymentType_efd2d033-784d-4edf-8adc-2d8a041c29a6, revision 2) for system.   AppEnforce  07.07.2014 20:28:09 804 (0x0324)
+++ Discovered application [AppDT Id: ScopeId_9CF7DEB9-6D21-4D41-B660-CC4E9ED87B1D/DeploymentType_efd2d033-784d-4edf-8adc-2d8a041c29a6, Revision: 2] AppEnforce 07.07.2014 20:28:09 804 (0x0324)
++++++ App enforcement completed (103 seconds) for App DT "PADT V4" [ScopeId_9CF7DEB9-6D21-4D41-B660-CC4E9ED87B1D/DeploymentType_efd2d033-784d-4edf-8adc-2d8a041c29a6], Revision: 2, User SID: ] ++++++ AppEnforce 07.07.2014 20:28:09 804 (0x0324)

New Post: Supersedence Behavior (SCCM2012r2)

$
0
0
Test 3 Run the latest v4 toolkit as a 64-bit installation launching PowerShell.exe -File "Deploy-Application.ps1" instead of the Deploy-Application.exe


[07-07-2014 20:50:41] [Initialization] Deployment type is [Installation]
[07-07-2014 20:50:41] [Initialization] Script [C:\WINDOWS\ccmcache\p\AppDeployToolkit\AppDeployToolkitMain.ps1] dot-source invoked by [C:\WINDOWS\ccmcache\p\Deploy-Application.ps1]
[07-07-2014 20:50:41] [Initialization] The following users are logged on to the system: MSSCCMFAQ\torsten
[07-07-2014 20:50:42] [Initialization] __Session 0 detected.
[07-07-2014 20:50:42] [Initialization] Invoking ServiceUI to provide interaction in the system session...
[07-07-2014 20:50:42] [Initialization] Executing [C:\WINDOWS\ccmcache\p\AppDeployToolkit__\ServiceUIx86.exe
C:\WINDOWS\System32\WindowsPowerShell\v1.0\powershell.exe -ExecutionPolicy Bypass -NoProfile -WindowStyle Hidden -File "C:\WINDOWS\ccmcache\p\Deploy-Application.ps1"]...
[07-07-2014 20:50:42] [Initialization] Working Directory is [C:\WINDOWS\ccmcache\p\AppDeployToolkit]
[07-07-2014 20:50:42] [Initialization] Execution completed with return code -1.
[07-07-2014 20:50:42] [Initialization] ServiceUI: [winlogon.exe] Session: [1] PID [540] [Target Session [1] = Match]

[07-07-2014 20:50:42] [Initialization] ServiceUI: Program to launch : [C:\WINDOWS\System32\WindowsPowerShell\v1.0\powershell.exe]

[07-07-2014 20:50:42] [Initialization] ServiceUI: Command line : [C:\WINDOWS\System32\WindowsPowerShell\v1.0\powershell.exe -ExecutionPolicy Bypass -NoProfile -WindowStyle Hidden -File C:\WINDOWS\ccmcache\p\Deploy-Application.ps1]

[07-07-2014 20:50:42] [Initialization] ServiceUI: API [CreateProcessAsUser] Error: [5]

[07-07-2014 20:50:42] [Initialization] ServiceUI returned exit code [-1]
[07-07-2014 20:50:43] [Initialization] Microsoft_ConfigMgrSupportCenter_2012_EN_1 Installation completed with exit code [-1].
[07-07-2014 20:50:43] [Initialization] ----------------------------------------------------------------------------------------------------------



+++ Application not discovered. [AppDT Id: ScopeId_9CF7DEB9-6D21-4D41-B660-CC4E9ED87B1D/DeploymentType_efd2d033-784d-4edf-8adc-2d8a041c29a6, Revision: 6] AppEnforce 07.07.2014 20:50:37 3336 (0x0D08)
App enforcement environment: 
Context: Machine
Command line: powershell.exe -ExecutionPolicy Bypass -File ".\Deploy-Application.ps1"
Allow user interaction: No
UI mode: 1
User token: null
Session Id: 4294967295
Content path: C:\WINDOWS\ccmcache\p
Working directory:  AppEnforce  07.07.2014 20:50:37 3336 (0x0D08)
Prepared working directory: C:\WINDOWS\ccmcache\p   AppEnforce  07.07.2014 20:50:37 3336 (0x0D08)
Found executable file powershell.exe with complete path C:\WINDOWS\System32\WindowsPowerShell\v1.0\powershell.exe AppEnforce 07.07.2014 20:50:37 3336 (0x0D08)
Prepared command line: "C:\WINDOWS\System32\WindowsPowerShell\v1.0\powershell.exe" -ExecutionPolicy Bypass -File ".\Deploy-Application.ps1" AppEnforce  07.07.2014 20:50:37 3336 (0x0D08)
Executing Command line: "C:\WINDOWS\System32\WindowsPowerShell\v1.0\powershell.exe" -ExecutionPolicy Bypass -File ".\Deploy-Application.ps1" with system context    AppEnforce  07.07.2014 20:50:37 3336 (0x0D08)
Working directory C:\WINDOWS\ccmcache\p AppEnforce  07.07.2014 20:50:37 3336 (0x0D08)
Post install behavior is BasedOnExitCode    AppEnforce  07.07.2014 20:50:37 3336 (0x0D08)
Waiting for process 3444 to finish.  Timeout = 120 minutes. AppEnforce  07.07.2014 20:50:37 3336 (0x0D08)
Process 3444 terminated with exitcode: 4294967295   AppEnforce  07.07.2014 20:50:43 3336 (0x0D08)
Looking for exit code -1 in exit codes table... AppEnforce  07.07.2014 20:50:43 3336 (0x0D08)
Unmatched exit code (4294967295) is considered an execution failure.    AppEnforce  07.07.2014 20:50:43 3336 (0x0D08)
++++++ App enforcement completed (6 seconds) for App DT "PADT V4" [ScopeId_9CF7DEB9-6D21-4D41-B660-CC4E9ED87B1D/DeploymentType_efd2d033-784d-4edf-8adc-2d8a041c29a6], Revision: 6, User SID: ] ++++++ AppEnforce 07.07.2014 20:50:43 3336 (0x0D08)

New Post: Supersedence Behavior (SCCM2012r2)

$
0
0
Hi Torsten,

Many thanks for running through those tests. The results are very strange because in Dan's run of your test 3 scenario above ServiceUI launches successfully and every thing works fine, no CreateProcessAsUser error 5.

We suspect that Deploy-Application.exe breaks ServiceUI running in a 64-bit installation because it's a 32-bit process and that's confirmed when we just run PowerShell.exe (x64) instead.

One thing Dan's testing also confirmed is that when you tick "Run installation program as 32bit process on 64bit clients" SCCM runs the installation as the logged on user - weird, huh?

We'll keep working on it and provide an update tomorrow hopefully.

Thanks,
Sean

New Post: Supersedence Behavior (SCCM2012r2)

$
0
0
PowerSheller wrote:
One thing Dan's testing also confirmed is that when you tick "Run installation program as 32bit process on 64bit clients" SCCM runs the installation as the logged on user - weird, huh?
How did you determine that? See the AppEnforce.log from Test 2 above: it clearly states "Context: Machine".

One thing that makes me wonder is:
Test1: "Session 0 detected"
Test2: "Session 0 not detected."

New Post: proper syntax for Arguments

$
0
0
I have some packagers that want logs put in specific folder structure. I have tried to change this in the xml with limited success. When I try to add arguments in the script it is throwing some syntax errors. Can anyone assist by chance:? here is what I put that is having some issues:
Execute-MSI -Action Install -Path "ToadforMySQL_Freeware_6.7.0.1524.msi" -Transform "Quest_ToadforMySQLFreeware_6.7.0.1524_x86_R1.mst" -Arguments "/l*v "c:\wkstnctl\TEM_LOGS\Quest_ToadforMySQLFreeware_6.7.0.1524_x86_R1.log" /qn

New Post: Supersedence Behavior (SCCM2012r2)

$
0
0
Maybe what Dan meant was it runs in interactive mode as 32 bit process but in system context. @Dan, jump in if you want to add anything.

Would anyone here know Cameron King? He's probably the best person to help solve the mystery of ServiceUI.

New Post: Deployment Script: Oracle Java Runtime 1.7.0.45

New Post: Write-ErrorStack - Getting All Detailed Information For Errors

$
0
0
Call function like this:
Write-Host "Failed to write to the log file `n$(Write-ErrorStack)" -ForegroundColor Red
Function Write-ErrorStack ([System.Management.Automation.ErrorRecord]$ErrorRecord = $Error[0])
{
    If ($ErrorRecord)
    {
        # Capture Error Record
        $LogMessage += "`n" + "Error Record:"
        $ErrorRecordMsg = $ErrorRecord | Format-List -Property * -Force | Out-String
        $LogMessage += "`n" + $ErrorRecordMsg
        
        # Error Invocation Information
        $LogMessage += "`n" + "Error Invocation Information:"
        $ErrorInvocationMsg = $ErrorRecord.InvocationInfo | Format-List -Property * -Force | Out-String
        $LogMessage += "`n" + $ErrorInvocationMsg
        
        # Capture Error Exception
        If ($ErrorRecord.Exception)
        {
            $LogMessage += "`n" + "Error Exception:"
            $ErrorExceptionMsg = $ErrorRecord.Exception | Format-List -Property * -Force | Out-String
            $LogMessage += "`n" + $ErrorExceptionMsg
            
            # Capture Error Inner Exception(s)
            If ($ErrorRecord.Exception.InnerException)
            {
                $LogMessage += "`n" + "Error Inner Exception(s):"
                
                $ErrorException = $ErrorRecord.Exception
                $count = 0
                
                While ($ErrorException.InnerException)
                {
                    $InnerExceptionSeperator = "*" * 40
                    $ErrorException = $ErrorException.InnerException
                    $ErrorInnerExceptionMsg = $ErrorException | Format-List -Property * -Force | Out-String
                    If ($count -gt 0)
                    {
                        $LogMessage += "`n" + $InnerExceptionSeperator
                    }
                    $LogMessage += "`n" + $ErrorInnerExceptionMsg
                    
                    $count++
                }
            }
        }
        
        #Capture Error Script Stack Trace
        If ((Get-Member -InputObject $ErrorRecord -Name 'ScriptStackTrace') -ne $null)
        {
            #PS 3.0 has a stack trace on the ErrorRecord; if we have it, use it
            $LogMessage += "`n" + "Error Script Stack Trace:"
            $ErrorStackTraceMsg = $ErrorRecord.ScriptStackTrace | Format-List -Property * -Force | Out-String
            $LogMessage += "`n" + $ErrorStackTraceMsg
        }
        
        Write-Output $LogMessage
    }
}
Viewing all 2341 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>