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

Commented Unassigned: How to update HKEY_CURRENT_USER registry key [95]

$
0
0
Hi I want to create new Key and value under

HKEY_CURRENT_USER\Software\Microsoft\Office\Excel\Addins

But my users doesn't have admin rights and registry editing is disabled for them so even if I an using set-REgistryKey command its running smoothly but not creating entry for currently logged on user.

Please suggest how to do that, I have attached script which i am using.
Comments: Hi ausafa Please be aware that this is not a bug or a feature request so it should have been posted in __Discussions under General__ (https://psappdeploytoolkit.codeplex.com/discussions/topics/5880/general) As a courtesy, I will answer briefly but I will not entertain your question any further after this post. Your issue is caused by the fact that each user has their own HKCU hive. So when you run your "Deploy-Application.ps1" as you (under your account "ausafa"), your HKCU hive will get the changes. Then when you login as a _different_ user, you get a _different_ HKCU hive and it didn't get the changes. Why? Because the HKCU hive for "ausafa" is not the same hive as the other user's HKCU hive. Solutions: -Use Active Setup (see in __Discussions under Toolkit Extensions__ (https://psappdeploytoolkit.codeplex.com/discussions/topics/5882/toolkit-extensions) -Wait for Toolkit v3.__5__.0 coming out soon and use the Set-HKCURegistrySettingsForAllUsers function.

New Post: Java install on Windows 7 64 bit detection

$
0
0
Never mind in order for this to install cleanly I need to remove existing first. I will just use a collection query and target necessary machines.

New Post: Can't open installation package

$
0
0
The .exe method worked fine for me in a VBScript wrapper with the same switches.

I have not tried this yet but it might work if we use single quotes to make the string literal.
Execute-Process -FilePath 'jre-8u25-windows-i586.exe' -Arguments '/s WEB_JAVA_SECURITY_LEVEL=M /L C:\Windows\Logs\Software\Java8U25Setup.log' -WindowStyle Hidden -IgnoreExitCodes "3010"

New Post: Deployment Script: IE11 needs one reboot (x86 and X64)

$
0
0

*===============================================

* PRE-INSTALLATION

If ($deploymentType -ne "uninstall") { $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" -closeappscountdown "60"

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

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 -text "$update1 is already installed, skipping."
}
Else
{
  Write-log -text "Installing $update1..."
        cmd.exe /c "C:\Windows\System32\dism.exe /online /add-package /packagepath:$dirfiles\Windows6.1-KB2834140-v2-x64.cab /quiet /norestart"
}

Prerequisite #2

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

# Prerequisite #3
$update3 = "KB2639308"
If (IsInstalled($update3))
{
write-log -text "$update2 is already installed, skipping."
}
Else
{
write-log -text "Installing $update2..."
        cmd.exe /c "C:\Windows\System32\dism.exe /online /add-package /packagepath:$dirfiles\KB2639308_amd64.CAB /quiet /norestart"
}

Prerequisite 4

$update4 = "KB2731771"
If (IsInstalled($update4))
{
write-log -text "$update3 is already installed, skipping."
}
Else
{
 write-log -text "Installing $update3..."
        cmd.exe /c "C:\Windows\System32\dism.exe /online /add-package /packagepath:$dirfiles\KB2731771_amd64.CAB /quiet /norestart"
        }

Prerequisite #5

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

Prerequisite #6

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

Prerequisite 7

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

Prerequisite 8

$update8 = "KB2882822"
If (IsInstalled($update8))
{
write-log -text "$update8 is already installed, skipping."
}
Else
{
write-log -text "Installing $update8..."
    cmd.exe /c "C:\Windows\System32\dism.exe /online /add-package /packagepath:$dirfiles\Windows6.1-KB2882822-x64.cab /quiet /norestart"
}

*===============================================

* INSTALLATION

$installPhase = "Installation"

*===============================================

# Perform installation tasks here

main program

write-log -text "installing main file"
cmd.exe /c "C:\Windows\System32\dism.exe /online /add-package /packagepath:$dirfiles\IE11-neutral.Downloaded.cab /quiet /norestart"

spelling

write-log -text "installing spelling file"
cmd.exe /c "C:\Windows\System32\dism.exe /online /add-package /packagepath:$dirfiles\Windows6.3-KB2849696-x86.cab /quiet /norestart"

Hypenation

write-log -text "installing Hypenation file"
cmd.exe /c "C:\Windows\System32\dism.exe /online /add-package /packagepath:$dirfiles\Windows6.3-KB2849697-x86.cab /quiet /norestart"

*===============================================

* POST-INSTALLATION

$installPhase = "Post-Installation"

*===============================================

Setup auto-update false

write-log -text "set no auto update"
Set-RegistryKey -Key "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Internet Explorer\Main" -Name "EnableAutoUpgrade" -Value "0" -Type Dword -ContinueOnError $true

set detection

Add-Content -path "c:\windows\logs\IE11installedX64.txt" -value "install via sccm2012" -ErrorAction SilentlyContinue

exit Script

Show-InstallationRestartPrompt -countdownseconds 150

*===============================================

* UNINSTALLATION

} ElseIf ($deploymentType -eq "uninstall") { $installPhase = "Uninstallation"

*===============================================

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

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

# Perform uninstallation tasks here

*===============================================

* END SCRIPT BODY

} } Catch { $exceptionMessage = "$($_.Exception.Message) ($($_.ScriptStackTrace))"; Write-Log "$exceptionMessage"; Show-DialogBox -Text $exceptionMessage -Icon "Stop"; Exit-Script -ExitCode 1 } # Catch any errors in this script
Exit-Script -ExitCode 0 # Otherwise call the Exit-Script function to perform final cleanup operations

*===============================================

New Post: Deployment Script: Oracle Java Runtime 1.7.0.51

$
0
0
I'd also add an active setup registry entry to stop java from nagging about it's out of date.
$entryD="reg add ""HKCU\Software\appdatalow\software\javasoft\deploymentproperties"" /v deployment.expiration.check.enabled /t reg_sz /d ""false"" /f"
Set-RegistryKey -Key "HKLM\SOFTWARE\Microsoft\Active Setup\Installed Components\java51u" -Name "version" -Value "1" -Type String
Set-RegistryKey -Key "HKLM\SOFTWARE\Microsoft\Active Setup\Installed Components\java51u" -Name "Stubpath" -Value "$entryD" -Type String

New Post: [suggestion] - change some DE Translations

$
0
0
Updated in the source code, and we'll include in the 3.5 release - thanks for this!

Dan

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

$
0
0
Hi Christian,

Can you download the latest 3.5 release from the Source Code section and test this? We have made numerous changes to user detection - I think we have this fixed. 3.5 should be released as Stable in the next few days.

Thanks, Dan

Created Unassigned: Close applications countdown timeout with no reason. [96]

$
0
0
Hi,

Firstly, congratulations for your work.

I encounter a problem unexplained when deploying one of my applications.

After 5 minutes of the applications countdown, the error code 1618 is returned directly before the time limit set at 25 minutes.

The problem always occur.

Here are the logs and I put you an attachment with the entire file.

```
[06-11-2014 17:11:11] [Initialization] ********** setup started.
[06-11-2014 17:11:11] [Initialization] Script [C:\Windows\ccmcache\w\AppDeployToolkit\AppDeployToolkitExtensions.ps1] dot-source invoked by [C:\Windows\ccmcache\w\AppDeployToolkit\AppDeployToolkitMain.ps1]
[06-11-2014 17:11:11] [Initialization] ********** script version is [1.0.0]
[06-11-2014 17:11:11] [Initialization] Deploy Application script version is [3.1.2]
[06-11-2014 17:11:11] [Initialization] The following non-default parameters were passed to [Deploy Application]: [-DeploymentType Install]
[06-11-2014 17:11:11] [Initialization] App Deploy Toolkit Main script version is [3.2.0]
[06-11-2014 17:11:11] [Initialization] App Deploy Toolkit Extensions version is [1.0.0]
[06-11-2014 17:11:11] [Initialization] PowerShell version is [2.0 x64]
[06-11-2014 17:11:11] [Initialization] PowerShell host is [ConsoleHost version 2.0]
[06-11-2014 17:11:11] [Initialization] OS version is [Microsoft Windows 7 Entreprise 64 bits 6.1.7601]
[06-11-2014 17:11:11] [Initialization] Hardware platform is [Physical]
[06-11-2014 17:11:11] [Initialization] Computer name is [******]
[06-11-2014 17:11:11] [Initialization] Current user is [********]
[06-11-2014 17:11:11] [Initialization] Current Culture is [fr-FR] and UI language is [FR]
[06-11-2014 17:11:11] [Initialization] Deployment type is [Installation]
[06-11-2014 17:11:11] [Initialization] Script [C:\Windows\ccmcache\w\AppDeployToolkit\AppDeployToolkitMain.ps1] dot-source invoked by [C:\Windows\ccmcache\w\Deploy-Application.ps1]
[06-11-2014 17:11:11] [Initialization] The following users are logged on to the system: **********
[06-11-2014 17:11:11] [Initialization] Session 0 not detected.
[06-11-2014 17:11:11] [Initialization] Installation is running in [Interactive] mode.
[06-11-2014 17:11:11] [Pre-Installation] Testing power connection status...
[06-11-2014 17:11:11] [Pre-Installation] AC Power connection not found
[06-11-2014 17:11:11] [Pre-Installation] Displaying custom installation prompt with the non-default parameters: [(Title=Mise à jour de votre poste de travail) (Message=Les applications suivantes doivent être fermés et sauvegardés : Internet Explorer, Mozilla Firefox, VLC, Adobe Reader, Java, PDFCreator.

En cas d'inactivité et d'applications concernées non ouvertes, la mise à jour se lancera automatiquement au bout de 5 minutes. Si les applications sont ouvertes l'installation se lancera plus tard.

L'ordinateur devra redémarrer après l'installation.) (Icon=Shield) (ButtonMiddleText=OK) (PersistPrompt=True) (__Timeout=300__) (ExitOnTimeout=False)]...
[06-11-2014 17:11:13] [Pre-Installation] Checking for running applications [iexplore,AcroRd32,cidaemon,firefox,java,jp2launcher,pdfcreator,vlc]...
[06-11-2014 17:11:13] [Pre-Installation] The following processes are running: [firefox]
[06-11-2014 17:11:13] [Pre-Installation] Resolving process descriptions...
[06-11-2014 17:11:13] [Pre-Installation] Finished checking running applications.
[06-11-2014 17:11:13] [Pre-Installation] Prompting user to close application(s) [Firefox]...
[06-11-2014 __17:11:13__] [Pre-Installation] Displaying close applications countdown with [__1200__] seconds.
[06-11-2014 __17:16:11__] [Pre-Installation] Installation not actioned within a reasonable amount of time.
[06-11-2014 17:16:11] [Pre-Installation] Installation not actioned within a reasonable amount of time.
[06-11-2014 17:16:11] [Pre-Installation] Setting deferral history...[DeferTimesRemaining = 0]
[06-11-2014 17:16:11] [Pre-Installation] Updating registry key: [Registry::\HKEY_LOCAL_MACHINE\SOFTWARE\PSAppDeployToolkit\DeferHistory\*************] [DeferTimesRemaining = 0]...
[06-11-2014 17:16:11] [Pre-Installation] ************** Installation completed with __exit code [1618]__.
[06-11-2014 17:16:11] [Pre-Installation] ----------------------------------------------------------------------------------------------------------
```

Don't hesitate to try the attachment to see what happen.

Thank's ! (I think it's a bug of the psapp script.)

Edited Unassigned: Close applications countdown timeout with no reason. [96]

$
0
0
Hi,

Firstly, congratulations for your work.

I encounter a problem unexplained when deploying one of my applications.

After 5 minutes of the applications countdown, the error code 1618 is returned directly before the time limit set at 25 minutes.

The problem always occur.

Here are the logs and I put you an attachment with the entire file.

```
[06-11-2014 17:11:11] [Initialization] ********** setup started.
[06-11-2014 17:11:11] [Initialization] Script [C:\Windows\ccmcache\w\AppDeployToolkit\AppDeployToolkitExtensions.ps1] dot-source invoked by [C:\Windows\ccmcache\w\AppDeployToolkit\AppDeployToolkitMain.ps1]
[06-11-2014 17:11:11] [Initialization] ********** script version is [1.0.0]
[06-11-2014 17:11:11] [Initialization] Deploy Application script version is [3.1.2]
[06-11-2014 17:11:11] [Initialization] The following non-default parameters were passed to [Deploy Application]: [-DeploymentType Install]
[06-11-2014 17:11:11] [Initialization] App Deploy Toolkit Main script version is [3.2.0]
[06-11-2014 17:11:11] [Initialization] App Deploy Toolkit Extensions version is [1.0.0]
[06-11-2014 17:11:11] [Initialization] PowerShell version is [2.0 x64]
[06-11-2014 17:11:11] [Initialization] PowerShell host is [ConsoleHost version 2.0]
[06-11-2014 17:11:11] [Initialization] OS version is [Microsoft Windows 7 Entreprise 64 bits 6.1.7601]
[06-11-2014 17:11:11] [Initialization] Hardware platform is [Physical]
[06-11-2014 17:11:11] [Initialization] Computer name is [******]
[06-11-2014 17:11:11] [Initialization] Current user is [********]
[06-11-2014 17:11:11] [Initialization] Current Culture is [fr-FR] and UI language is [FR]
[06-11-2014 17:11:11] [Initialization] Deployment type is [Installation]
[06-11-2014 17:11:11] [Initialization] Script [C:\Windows\ccmcache\w\AppDeployToolkit\AppDeployToolkitMain.ps1] dot-source invoked by [C:\Windows\ccmcache\w\Deploy-Application.ps1]
[06-11-2014 17:11:11] [Initialization] The following users are logged on to the system: **********
[06-11-2014 17:11:11] [Initialization] Session 0 not detected.
[06-11-2014 17:11:11] [Initialization] Installation is running in [Interactive] mode.
[06-11-2014 17:11:11] [Pre-Installation] Testing power connection status...
[06-11-2014 17:11:11] [Pre-Installation] AC Power connection not found
[06-11-2014 17:11:11] [Pre-Installation] Displaying custom installation prompt with the non-default parameters: [(Title=Mise à jour de votre poste de travail) (Message=Les applications suivantes doivent être fermés et sauvegardés : Internet Explorer, Mozilla Firefox, VLC, Adobe Reader, Java, PDFCreator.

En cas d'inactivité et d'applications concernées non ouvertes, la mise à jour se lancera automatiquement au bout de 5 minutes. Si les applications sont ouvertes l'installation se lancera plus tard.

L'ordinateur devra redémarrer après l'installation.) (Icon=Shield) (ButtonMiddleText=OK) (PersistPrompt=True) (__Timeout=300__) (ExitOnTimeout=False)]...
[06-11-2014 17:11:13] [Pre-Installation] Checking for running applications [iexplore,AcroRd32,cidaemon,firefox,java,jp2launcher,pdfcreator,vlc]...
[06-11-2014 17:11:13] [Pre-Installation] The following processes are running: [firefox]
[06-11-2014 17:11:13] [Pre-Installation] Resolving process descriptions...
[06-11-2014 17:11:13] [Pre-Installation] Finished checking running applications.
[06-11-2014 17:11:13] [Pre-Installation] Prompting user to close application(s) [Firefox]...
[06-11-2014 __17:11:13__] [Pre-Installation] Displaying close applications countdown with [__1200__] seconds.
[06-11-2014 __17:16:11__] [Pre-Installation] Installation not actioned within a reasonable amount of time.
[06-11-2014 17:16:11] [Pre-Installation] Installation not actioned within a reasonable amount of time.
[06-11-2014 17:16:11] [Pre-Installation] Setting deferral history...[DeferTimesRemaining = 0]
[06-11-2014 17:16:11] [Pre-Installation] Updating registry key: [Registry::\HKEY_LOCAL_MACHINE\SOFTWARE\PSAppDeployToolkit\DeferHistory\*************] [DeferTimesRemaining = 0]...
[06-11-2014 17:16:11] [Pre-Installation] ************** Installation completed with __exit code [1618]__.
[06-11-2014 17:16:11] [Pre-Installation] ----------------------------------------------------------------------------------------------------------
```

Don't hesitate to try the attachment to see what happen.

Thank's ! (I think it's a bug of the psapp script.)

Edited Unassigned: Close applications countdown timeout without reason. [96]

$
0
0
Hi,

Firstly, congratulations for your work.

I encounter a problem unexplained when deploying one of my applications.

After 5 minutes of the applications countdown, the error code 1618 is returned directly before the time limit set at 25 minutes.

The problem always occur.

Here are the logs and I put you an attachment with the entire file.

```
[06-11-2014 17:11:11] [Initialization] ********** setup started.
[06-11-2014 17:11:11] [Initialization] Script [C:\Windows\ccmcache\w\AppDeployToolkit\AppDeployToolkitExtensions.ps1] dot-source invoked by [C:\Windows\ccmcache\w\AppDeployToolkit\AppDeployToolkitMain.ps1]
[06-11-2014 17:11:11] [Initialization] ********** script version is [1.0.0]
[06-11-2014 17:11:11] [Initialization] Deploy Application script version is [3.1.2]
[06-11-2014 17:11:11] [Initialization] The following non-default parameters were passed to [Deploy Application]: [-DeploymentType Install]
[06-11-2014 17:11:11] [Initialization] App Deploy Toolkit Main script version is [3.2.0]
[06-11-2014 17:11:11] [Initialization] App Deploy Toolkit Extensions version is [1.0.0]
[06-11-2014 17:11:11] [Initialization] PowerShell version is [2.0 x64]
[06-11-2014 17:11:11] [Initialization] PowerShell host is [ConsoleHost version 2.0]
[06-11-2014 17:11:11] [Initialization] OS version is [Microsoft Windows 7 Entreprise 64 bits 6.1.7601]
[06-11-2014 17:11:11] [Initialization] Hardware platform is [Physical]
[06-11-2014 17:11:11] [Initialization] Computer name is [******]
[06-11-2014 17:11:11] [Initialization] Current user is [********]
[06-11-2014 17:11:11] [Initialization] Current Culture is [fr-FR] and UI language is [FR]
[06-11-2014 17:11:11] [Initialization] Deployment type is [Installation]
[06-11-2014 17:11:11] [Initialization] Script [C:\Windows\ccmcache\w\AppDeployToolkit\AppDeployToolkitMain.ps1] dot-source invoked by [C:\Windows\ccmcache\w\Deploy-Application.ps1]
[06-11-2014 17:11:11] [Initialization] The following users are logged on to the system: **********
[06-11-2014 17:11:11] [Initialization] Session 0 not detected.
[06-11-2014 17:11:11] [Initialization] Installation is running in [Interactive] mode.
[06-11-2014 17:11:11] [Pre-Installation] Testing power connection status...
[06-11-2014 17:11:11] [Pre-Installation] AC Power connection not found
[06-11-2014 17:11:11] [Pre-Installation] Displaying custom installation prompt with the non-default parameters: [(Title=Mise à jour de votre poste de travail) (Message=Les applications suivantes doivent être fermés et sauvegardés : Internet Explorer, Mozilla Firefox, VLC, Adobe Reader, Java, PDFCreator.

En cas d'inactivité et d'applications concernées non ouvertes, la mise à jour se lancera automatiquement au bout de 5 minutes. Si les applications sont ouvertes l'installation se lancera plus tard.

L'ordinateur devra redémarrer après l'installation.) (Icon=Shield) (ButtonMiddleText=OK) (PersistPrompt=True) (__Timeout=300__) (ExitOnTimeout=False)]...
[06-11-2014 17:11:13] [Pre-Installation] Checking for running applications [iexplore,AcroRd32,cidaemon,firefox,java,jp2launcher,pdfcreator,vlc]...
[06-11-2014 17:11:13] [Pre-Installation] The following processes are running: [firefox]
[06-11-2014 17:11:13] [Pre-Installation] Resolving process descriptions...
[06-11-2014 17:11:13] [Pre-Installation] Finished checking running applications.
[06-11-2014 17:11:13] [Pre-Installation] Prompting user to close application(s) [Firefox]...
[06-11-2014 __17:11:13__] [Pre-Installation] Displaying close applications countdown with [__1200__] seconds.
[06-11-2014 __17:16:11__] [Pre-Installation] Installation not actioned within a reasonable amount of time.
[06-11-2014 17:16:11] [Pre-Installation] Installation not actioned within a reasonable amount of time.
[06-11-2014 17:16:11] [Pre-Installation] Setting deferral history...[DeferTimesRemaining = 0]
[06-11-2014 17:16:11] [Pre-Installation] Updating registry key: [Registry::\HKEY_LOCAL_MACHINE\SOFTWARE\PSAppDeployToolkit\DeferHistory\*************] [DeferTimesRemaining = 0]...
[06-11-2014 17:16:11] [Pre-Installation] ************** Installation completed with __exit code [1618]__.
[06-11-2014 17:16:11] [Pre-Installation] ----------------------------------------------------------------------------------------------------------
```

Don't hesitate to try the attachment to see what happen.

Thank's ! (I think it's a bug of the psapp script.)

New Post: Java install on Windows 7 64 bit detection

$
0
0
Figured I will need this in my future installation scenarios.
So I modified Get-Installation to detect if it was installed in the 64-bit Registry Node.
Function Get-InstalledApplication {
<#
.SYNOPSIS
    Retrieves information about installed applications.
.DESCRIPTION
    Retrieves information about installed applications by querying the registry. You can specify an application name, a product code, or both.
    Returns information about application publisher, name & version, product code, uninstall string, install source, location & date.
.EXAMPLE
    Get-InstalledApplication -Name "Adobe Flash"
.EXAMPLE
    Get-InstalledApplication -ProductCode "{1AD147D0-BE0E-3D6C-AC11-64F6DC4163F1}"
.PARAMETER ApplicationName
    The name of the application you want to retrieve information on. Performs a wildcard match on the application display name.
.PARAMETER ProductCode
    The product code of the application you want to retrieve information on.
.NOTES
.LINK
    Http://psappdeploytoolkit.codeplex.com
#>
    Param (
        [array] $Name = "",
        [string] $ProductCode = ""
    )

    If ($name -ne "") { Write-Log "Getting information for installed Application Name [$name]..."}
    If ($productCode -ne "") { Write-Log "Getting information for installed Product Code [$ProductCode]..."}
    If ($name -eq "" -and $ProductCode -eq "") { Write-Log "Get-InstalledApplication Error: Please provide an Application Name or Product Code."; Return $null }
    # Replace special characters in product code that interfere with regex match
    $productCode = $productCode -replace "}","" -replace "{",""
    $applications = $name -split (",")
    # Replace special characters in application name that interfere with regex match
    $applications = $applications -replace "\.","dot" -replace "\*","asterix" -replace "\+","plus" -replace "\(","openbracket" -replace "\)","closebracket" -replace "\[","opensquarebracket" -replace "\]","closesquarebracket"
    $installedApplication = @()
    Foreach ($regKey in $regKeyApplications ) {
        If (Test-Path $regKey -ErrorAction SilentlyContinue) {
        $regKeyApplication = Get-ChildItem $regKey -ErrorAction SilentlyContinue | ForEach-Object { Get-ItemProperty -LiteralPath $_.PsPath }
            Foreach ($regKeyApp in $regKeyApplication) {
                $appDisplayName = $null
                $appDisplayVersion = $null
                $appPublisher = $null
                $appIn64Bit = $null
                # Bypass any updates or hotfixes
                If ([RegEx]::Match($regKeyApp.DisplayName, "(?i)kb\d+") -eq $true) { Continue }
                If ($regKeyApp.DisplayName -match "Cumulative Update") { Continue }
                If ($regKeyApp.DisplayName -match "Security Update") { Continue }
                If ($regKeyApp.DisplayName -match "Hotfix") { Continue }
                # Remove any non-standard characters from the name / version which may interfere with logging
                $appDisplayName = [RegEx]::Replace($regKeyApp.DisplayName, "[^\u001F-\u007F]", "")
                $appDisplayVersion = [RegEx]::Replace($regKeyApp.DisplayVersion, "[^\u001F-\u007F]", "")
                $appPublisher = [RegEx]::Replace($regKeyApp.Publisher, "[^\u001F-\u007F]", "")
                $appIn64Bit = If ($regKey -notmatch "Wow6432Node" -and $is64Bit -eq $true) {$true} Else {$False}
                If ($ProductCode -ne "") {
                    # Replace special characters in product code that interfere with regex match
                    $regKeyProductCode = $($regKeyApp.PSChildName) -replace "}","" -replace "{",""
                    # Verify if there is a match with the product code passed to the script
                    If ($regKeyProductCode -match $productCode) {
                        Write-Log "Found installed application [$($appDisplayName)] version [$($appDisplayVersion)] matching product code [$productCode]"
                        $installedApplication += New-Object PSObject -Property @{
                            ProductCode =       $regKeyApp.PSChildName
                            DisplayName =       $appDisplayName
                            DisplayVersion =    $appDisplayVersion
                            UninstallString =   $regKeyApp.UninstallString
                            InstallSource =     $regKeyApp.InstallSource
                            InstallLocation =   $regKeyApp.InstallLocation
                            InstallDate =       $regKeyApp.InstallDate
                            Publisher =         $appPublisher
                            x64RegistryKey =    $appIn64Bit
                        }
                    }
                }
                If ($name -ne "") {
                    # Verify if there is a match with the application name(s) passed to the script
                    Foreach ($application in $applications) {
                        If (($regKeyApp.DisplayName -replace "\.","dot" -replace "\*","asterix" -replace "\+","plus" -replace "\(","openbracket" -replace "\)","closebracket" -replace "\[","opensquarebracket" -replace "\]","closesquarebracket") -match $application ) {
                            Write-Log "Found installed application [$($appDisplayName)] version [$($appDisplayVersion)] matching application name [$application]"
                            $regKeyApp.DisplayName = $regKeyApp.DisplayName
                            $installedApplication += New-Object PSObject -Property @{
                                ProductCode =       $regKeyApp.PSChildName
                                DisplayName =       $appDisplayName
                                DisplayVersion =    $appDisplayVersion
                                UninstallString =   $regKeyApp.UninstallString
                                InstallSource =     $regKeyApp.InstallSource
                                InstallLocation =   $regKeyApp.InstallLocation
                                InstallDate =       $regKeyApp.InstallDate
                                Publisher =         $appPublisher
                                x64RegistryKey =    $appIn64Bit
                            }
                        }
                    }
                }
            }
        }
    }
    Return $installedApplication
}

New Post: Applications that need to be closed

$
0
0
Thanks for the response. here's the section of the script for uninstall. I did what you suggested, but it didn't work. I had Acrobat Pro X, Word 2010, and IE9 open, and the tool only recognized IE. The uninstall failed because the other two apps were open.

# Prompt the user to close the following applications if they are running:
Show-InstallationWelcome -CloseApps "iexplore,Acrobat,cidaemon,winword,excel,Outlook" -AllowDefer -DeferTimes 3
# Show Progress Message (with a message to indicate the application is being uninstalled)
Show-InstallationProgress -StatusMessage "Uninstalling Application $installTitle. Please Wait..." 
# Remove this version of Adobe Reader
Execute-MSI -Action Uninstall -Path "{AC76BA86-1033-F400-7760-000000000005}"
To be fair, when I look at Processes, both acrobat and winword have .exe after them. But then, so does iexplore. Any help that you can offer would be greatly appreciated.

New Post: Set-ActiveSetup and Remove-ActiveSetup: Per-user changes (as requested)

$
0
0
Version: 0.7
  • Now uses ToolKit's functions,
  • Better comments, code and consistency.
  • Solved issue to trigger changes for current user.
The updated code is in top post to prevent confusion

Commented Feature: Feature Request: User settings function [79]

$
0
0
Sometimes you need to change user settings when deploying packages and it would be nice to have a function for this. The dream scenario would be if the function could handle these things.

- Add HKCU registry keys for users.
- Copy custom files/scripts to a folder on the client and then run this from the users context.
- Run the above file/script for the current logged in user.

The first two things is possible with scripts and Active Setup but the last one is a bit more complex which I'm not sure how to solve. I have seen other Client Management systems handle this but I don't know if it's possible with scripting only. If it isn't possible then the two first things would be nice anyway.
Comments: In case you might need it, I've updated the functions I posted in "Discussions under Toolkit Extensions" https://psappdeploytoolkit.codeplex.com/discussions/565009 https://psappdeploytoolkit.codeplex.com/discussions/565010 Version: 0.7 - Now uses ToolKit's functions throughout, has better comments, code and consistency. Solved issue to trigger changes for current user.

Source code checked in, #775b698904f577a80f19a0de83d761feab44cfa6

$
0
0
Added ForceCloseAppsCountdown parameter to Show-InstallationWelcome allowing a countdown to close apps regardless of whether deferral is allowed Fixed centering of toolkit banner in UI elements where the full length banner is not used

Source code checked in, #9b4dab48dccf4ceeb252d93dab6354e021bd006f

Source code checked in, #43caca9279c253b5ceab39230c4e30b4afe52b7e

New Post: Allowing applications to automatically close while using the defer option

$
0
0
This was way more complicated than you'd imagine but it's done now and will be added to the 3.5 release.

Note, if you allow deferral and there are no apps to close then the "ForceCloseAppsCountdown" won't appear since it's only for closing applications not a general UI timeout. So you'll still have the prompt sitting on the screen of machines where the apps don't need to be closed. This is why I suggested making use of the AllowDeferCloseApps and CloseAppsCountdown parameters which will only show deferral if the apps are open and if deferral has expired and the apps are open it will force close them.

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

$
0
0
Hi Dan,

I'm sorry, but it is still not working:
[Initialization] :: Get session information for all logged on users. Get-LoggedOnUser 07.11.2014 09:53:15 1 (0x0001)
[Initialization] :: No users are logged on to the system PSAppDeployToolkit 07.11.2014 09:53:15 1 (0x0001)
[Initialization] :: Unable to load COM Object [Microsoft.SMS.TSEnvironment]. Therefore, script is not currently running from a SCCM Task Sequence. PSAppDeployToolkit 07.11.2014 09:53:15 1 (0x0001)
[Initialization] :: Session 0 detected, process running in user interactive mode: deployment mode will not be set to [NonInteractive] PSAppDeployToolkit 07.11.2014 09:53:15 1 (0x0001)
[Initialization] :: Installation is running in [Interactive] mode. PSAppDeployToolkit 07.11.2014 09:53:15 1 (0x0001)

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

$
0
0
I take a look to your Script:

Line 178:
[boolean]$IsProcessUserInteractive = [System.Environment]::UserInteractive

When I start Deploy-Application.EXE by using ServiceUI.exe, I think Line 178 returns "true".
Is there is reason why you don't set $deployMode always to NonInteravtive if Session 0 is detected?
Viewing all 2341 articles
Browse latest View live


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