Thanks for the response. I have not used the toolkit yet and wanted to make sure it could stop and start services before I dove into the product.
↧
New Post: Stop-Start Services
↧
New Post: Detect Adobe Reader version and skip or not install once detected.
Need help for a newbie. Set to detect Adobe Reader via GUID and version and wanted to skip if detected but it still continues to install. See script below. What I would like to happen is to detect Adobe specific version and once detected is to skip or not install since it is already installed. If it is detected that it has an older version, then continue with the install. Goal is just to replace the msp file everytime there is an update so GUID will still the same. Thanks.
<#
.SYNOPSIS
.LINK
Param (
$appName = "Reader"
$appVersion = "11.0.7"
$appArch = ""
$appLang = "EN"
$appRevision = "01"
$appScriptVersion = "1.0.0"
$appScriptDate = "01/04/2013"
$appScriptAuthor = "Carlito Castillo"
$deployAppScriptVersion = "3.0.0"
$deployAppScriptDate = "01/04/2014"
$deployAppScriptParameters = $psBoundParameters
$InstallVersion = "11.0.07"
} Catch {$exceptionMessage = "$($_.Exception.Message)
Exit-Script -ExitCode 0 # Otherwise call the Exit-Script function to perform final cleanup operations
<#
.SYNOPSIS
This script performs the installation or uninstallation of an application(s).
.DESCRIPTIONThe script is provided as a template to perform an install or uninstall of an application(s).
The script either performs an "Install" deployment type or an "Uninstall" deployment type.
The install deployment type is broken down in to 3 main sections/phases: Pre-Install, Install, and Post-Install.
The script dot-sources the AppDeployToolkitMain.ps1 script which contains the logic and functions required to install or uninstall an application.
To access the help section,
.EXAMPLEDeploy-Application.ps1
.EXAMPLEDeploy-Application.ps1 -DeploymentType "Silent"
.EXAMPLEDeploy-Application.ps1 -AllowSCCMReboot -AllowDefer
.EXAMPLEDeploy-Application.ps1 -Uninstall
.PARAMETER DeploymentTypeThe type of deployment to perform. [Default is "Install"]
.PARAMETER DeployModeSpecifies whether the installation should be run in Interactive, Silent or NonInteractive mode.
Interactive = Default mode
Silent = No dialogs
NonInteractive = Very silent, i.e. no blocking apps. Noninteractive mode is automatically set if an SCCM task sequence or session 0 is detected.
.PARAMETER AllowRebootPassThruAllows the 3010 return code (requires restart) to be passed back to the parent process (e.g. SCCM) if detected from an installation.
If 3010 is passed back to SCCM a reboot prompt will be triggered.
.NOTES.LINK
Http://psappdeploytoolkit.codeplex.com
"#>Param (
[ValidateSet("Install","Uninstall")]
[string]$DeploymentType = "Install",
[ValidateSet("Interactive","Silent","NonInteractive")]
[string]$DeployMode = "Interactive",
[switch]$AllowRebootPassThru = $false
)*===============================================
* VARIABLE DECLARATION
Try {*===============================================
*===============================================
Variables: Application
$appVendor = "Adobe"$appName = "Reader"
$appVersion = "11.0.7"
$appArch = ""
$appLang = "EN"
$appRevision = "01"
$appScriptVersion = "1.0.0"
$appScriptDate = "01/04/2013"
$appScriptAuthor = "Carlito Castillo"
*===============================================
Variables: Script - Do not modify this section
$deployAppScriptFriendlyName = "Deploy Application"$deployAppScriptVersion = "3.0.0"
$deployAppScriptDate = "01/04/2014"
$deployAppScriptParameters = $psBoundParameters
Variables: Environment
$scriptDirectory = Split-Path -Parent $MyInvocation.MyCommand.DefinitionDot source the App Deploy Toolkit Functions
."$scriptDirectory\AppDeployToolkit\AppDeployToolkitMain.ps1"$InstallVersion = "11.0.07"
*===============================================
* END VARIABLE DECLARATION
*===============================================
*===============================================
* PRE-INSTALLATION
If ($deploymentType -ne "uninstall") { $installPhase = "Pre-Installation"*===============================================
# Prompt the user to close the following applications if they are running:
Show-InstallationWelcome -CloseApps "iexplore,AcroRd32,cidaemon" -AllowDefer -DeferTimes 3
# Show Progress Message (with the default message)
Show-InstallationProgress
# Get Installed Application GUID and verify if Application is installed
if ((Get-InstalledApplication -ProductCode "{AC76BA86-7AD7-1033-7B44-AB0000000001}"| where-object{$_.version -eq $InstallVersion}) -eq $Null){
if (Get-InstalledApplication "Adobe Reader"){
# Remove any previous versions of Adobe Reader
Remove-MSIApplications "Adobe Reader"
}
#*===============================================
#* INSTALLATION
$installPhase = "Installation"
#*===============================================
# Install the base MSI and apply a transform
Execute-MSI -Action Install -Path "AcroRead.msi" -Transform "AcroRead.mst"
# Install the patch
Execute-MSI -Action Patch -Path "AdbeRdrUpd11007.msp"
}
*===============================================
* POST-INSTALLATION
$installPhase = "Post-Installation"*===============================================
*===============================================
* ROLLBACK
} Elseif ($deploymentType -eq "uninstall") { $installPhase = "uninstall"# Prompt the user to close the following applications if they are running:
Show-InstallationWelcome -CloseApps "iexplore,AcroRd32,cidaemon,winword,excel" -AllowDefer -DeferTimes 3
# Show Progress Message (with a message to indicate the application is being uninstalled)
Show-InstallationProgress -StatusMessage "Rolling Back Application $installTitle. Please Wait..."
# Remove this version of Adobe Reader
Execute-MSI -Action Uninstall -Path "{AC76BA86-7AD7-1033-7B44-AB0000000001}"
# Install Previous Version of Adobe Reader
Execute-MSI -Action Install -Path "$scriptDirectory\rollback\AcroRead.msi" -Transform "AcroRead.mst"
# Install the patch
Execute-MSI -Action Patch -Path "$scriptDirectory\rollback\AdbeRdrUpd11006.msp"
}} 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: Customizing Script for Every One Hour
Hi ,
Can we deploy the application using Defer times and Defer Deadline and making to Run Notification Prompt for every 1 hr.
We need to provide notification for user for every 1 hr to remain about Installation.
I can run the application only with Defer Time and Defer deadline. but the prompt doesn't appear for every one hour. Please let me know if i'm missing any thing.
I did notice persistent prompt and Defer Deadline cannot run together. Any ideas or Advise.
Can we deploy the application using Defer times and Defer Deadline and making to Run Notification Prompt for every 1 hr.
We need to provide notification for user for every 1 hr to remain about Installation.
I can run the application only with Defer Time and Defer deadline. but the prompt doesn't appear for every one hour. Please let me know if i'm missing any thing.
I did notice persistent prompt and Defer Deadline cannot run together. Any ideas or Advise.
↧
New Post: Customizing Script for Every One Hour
You should probably post your question in the "General" forum thread. This is where people share and discuss new functions they want to share with the community.
↧
New Post: Bold App Title
Hi Richard,
Can you share the code please ?
Many Thanks.
Can you share the code please ?
Many Thanks.
↧
↧
New Post: Remove from collection after deployment
Has anyone devised a way to remove a machine from a particular collection after deployment? if so could you share your ideas?
Thanks
Thanks
↧
New Post: Show-InstallationRestartPrompt, Title has no spaces between words
Hi,
Great scripts, certainly helping us with making our deployments more controllable and informative for the end user, many thanks for the hard work.
I have a minor cosmetic query.
When using the Show-InstallationRestartPrompt, the title of the box is displaying with no spaces between the application name eg "Restart Required: VPNSoftwareUpgrade" Whereas on the Show-InstallationWelcome it is displayed correctly as "VPN Software Upgrade".
Should both be pulled from the $appName variable ? Am I missing something or is this a bug ?
Thanks.
Great scripts, certainly helping us with making our deployments more controllable and informative for the end user, many thanks for the hard work.
I have a minor cosmetic query.
When using the Show-InstallationRestartPrompt, the title of the box is displaying with no spaces between the application name eg "Restart Required: VPNSoftwareUpgrade" Whereas on the Show-InstallationWelcome it is displayed correctly as "VPN Software Upgrade".
Should both be pulled from the $appName variable ? Am I missing something or is this a bug ?
Thanks.
↧
New Post: Customizing Script for Every One Hour
Thanks. I thought some one would look in it. Its been initially posted under general Discussion.
↧
New Post: Customizing Script for Every One Hour
Hi,
What you are looking to do needs to be figured in SCCM rather than the toolkit.
The toolkit documentation explains how you can set the frequency between retries for both packages and applications.
Cheers,
Sean
What you are looking to do needs to be figured in SCCM rather than the toolkit.
The toolkit documentation explains how you can set the frequency between retries for both packages and applications.
Cheers,
Sean
↧
↧
New Post: Customizing Script for Every One Hour
Hi Sean,,
Thanks for reply. SCCM Machine policy evaluation is not working as expected. There are few users who get the policy updated and for few users policy is not getting update. And we are kind of stuck with this issue.
We don't want to deploy using Package Model.Even deploying using package Model doesn't have control, to trigger mandatory assignment if the user is off the network.
So i'm thinking to see if we can get this done with in our Script.
Thanks
Thanks for reply. SCCM Machine policy evaluation is not working as expected. There are few users who get the policy updated and for few users policy is not getting update. And we are kind of stuck with this issue.
We don't want to deploy using Package Model.Even deploying using package Model doesn't have control, to trigger mandatory assignment if the user is off the network.
So i'm thinking to see if we can get this done with in our Script.
Thanks
↧
New Post: Show-InstallationRestartPrompt, Title has no spaces between words
Hi there,
I can't reproduce this strangely, does it happen for every application?
Both prompts take the $installTitle variable so should be consistent.
I can't reproduce this strangely, does it happen for every application?
Both prompts take the $installTitle variable so should be consistent.
↧
New Post: Customizing Script for Every One Hour
The SCCM Application model times out an installation after 2 hours so you can't get this done within the script and even if you could control it you might cause issues by holding up other installations and updates that need to run.
↧
New Post: Detect Adobe Reader version and skip or not install once detected.
Hi, have a look at my post here on checking versions of installed software:
https://psappdeploytoolkit.codeplex.com/discussions/551317
https://psappdeploytoolkit.codeplex.com/discussions/551317
↧
↧
New Post: Bug in Get-UniversalDate
Hi Christian,
Thanks for catching this and posting the fix!
We'll include in the next release.
Cheers,
Sean
Thanks for catching this and posting the fix!
We'll include in the next release.
Cheers,
Sean
↧
New Post: Show-InstallationWelcome Guidance
Hi,
Glad you discovered the toolkit and managed to get your problem sorted.
Cheers,
Sean
Glad you discovered the toolkit and managed to get your problem sorted.
Cheers,
Sean
↧
New Post: Send-Keys: Send a sequence of keys to an application window based on Window Title
This is a function we think could be very useful so if it's OK with you we're going to make a few tweaks and add it in to the core toolkit.
Thanks for the excellent contributions!
Thanks,
Sean
Thanks for the excellent contributions!
Thanks,
Sean
↧
New Post: Send-Keys: Send a sequence of keys to an application window based on Window Title
Absolutely, go for it.
↧
↧
New Post: Show-InstallationRestartPrompt, Title has no spaces between words
Hi
I just tried a vanilla copy of app deploy 3.1.4 and only added the $appName variable in the Deploy-Application.ps1.
I havent made any changes to the AppDeployToolkitMain.ps1 at all.
Thoughts ?
I just tried a vanilla copy of app deploy 3.1.4 and only added the $appName variable in the Deploy-Application.ps1.
# Variables: Application
$appVendor = ""
$appName = "Test for Spaces"
$appVersion = ""
$appArch = ""
$appLang = "EN"
$appRevision = "01"
$appScriptVersion = "1.0.0"
$appScriptDate = "01/01/2014"
$appScriptAuthor = "<author name>"
I then ran it without even adding the Show-InstallationRestartPrompt option this time, and again the Show-InstallationWelcome is ok, but the ShowInstallationPrompt removes the spaces in the title the same as the Show-InstallationRestartPrompt does.I havent made any changes to the AppDeployToolkitMain.ps1 at all.
Thoughts ?
↧
New Post: Detect Adobe Reader version and skip or not install once detected.
That worked. Thanks so much
↧
New Post: Need help. Uninstall dialog box does not run and uninstall does not work.
<#
.SYNOPSIS
.LINK
Param (
Function Trigger-Inventory {
$appName = "WinZip"
$appVersion = "18.0.11023"
$appArch = ""
$appLang = "EN"
$appRevision = "01"
$appScriptVersion = "1.0.0"
$appScriptDate = "08/04/2013"
$appScriptAuthor = "Carlos Castillo"
$deployAppScriptVersion = "3.0.0"
$deployAppScriptDate = "01/04/2014"
$deployAppScriptParameters = $psBoundParameters
$InstallVersion = "18.0.11023"
$NewKey = "CE14062-WinZip18.0"
$OldKey = "CE14062-WinZip16.5"
}} Catch {$exceptionMessage = "$($_.Exception.Message)
Exit-Script -ExitCode 0 # Otherwise call the Exit-Script function to perform final cleanup operations
.SYNOPSIS
This script performs the installation or uninstallation of an application(s).
.DESCRIPTIONThe script is provided as a template to perform an install or uninstall of an application(s).
The script either performs an "Install" deployment type or an "Uninstall and ROLLBACK" deployment type.
The install deployment type is broken down in to 3 main sections/phases: Pre-Install, Install, and Post-Install.
The script dot-sources the AppDeployToolkitMain.ps1 script which contains the logic and functions required to install or uninstall an application.
To access the help section,
.EXAMPLEDeploy-Application.ps1
.EXAMPLEDeploy-Application.ps1 -DeploymentType "Silent"
.EXAMPLEDeploy-Application.ps1 -AllowSCCMReboot -AllowDefer
.EXAMPLEDeploy-Application.ps1 -Uninstall
.PARAMETER DeploymentTypeThe type of deployment to perform. [Default is "Install"]
.PARAMETER DeployModeSpecifies whether the installation should be run in Interactive, Silent or NonInteractive mode.
Interactive = Default mode
Silent = No dialogs
NonInteractive = Very silent, i.e. no blocking apps. Noninteractive mode is automatically set if an SCCM task sequence or session 0 is detected.
.PARAMETER AllowRebootPassThruAllows the 3010 return code (requires restart) to be passed back to the parent process (e.g. SCCM) if detected from an installation.
If 3010 is passed back to SCCM a reboot prompt will be triggered.
.NOTES.LINK
Http://psappdeploytoolkit.codeplex.com
"#>Param (
[ValidateSet("Install","Uninstall")]
[string]$DeploymentType = "Install",
[ValidateSet("Interactive","Silent","NonInteractive")]
[string]$DeployMode = "Interactive",
[switch]$AllowRebootPassThru = $false
)Function Trigger-Inventory {
$SCCMClient = [wmiclass]''
$SCCMClient.psbase.options.timeout = 20000000 #time in ticks - 2 seconds
$SCCMClient.psbase.path = "\\.\root\ccm:sms_client"
$SCCMClient.TriggerSchedule("{00000000-0000-0000-0000-000000000001}")
$SCCMClient.RequestMachinePolicy()
$SCCMClient.EvaluateMachinePolicy()
}*===============================================
* VARIABLE DECLARATION
Try {*===============================================
*===============================================
Variables: Application
$appVendor = "Corel"$appName = "WinZip"
$appVersion = "18.0.11023"
$appArch = ""
$appLang = "EN"
$appRevision = "01"
$appScriptVersion = "1.0.0"
$appScriptDate = "08/04/2013"
$appScriptAuthor = "Carlos Castillo"
*===============================================
Variables: Script - Do not modify this section
$deployAppScriptFriendlyName = "Deploy Application"$deployAppScriptVersion = "3.0.0"
$deployAppScriptDate = "01/04/2014"
$deployAppScriptParameters = $psBoundParameters
Variables: Environment
$scriptDirectory = Split-Path -Parent $MyInvocation.MyCommand.DefinitionDot source the App Deploy Toolkit Functions
."$scriptDirectory\AppDeployToolkit\AppDeployToolkitMain.ps1"$InstallVersion = "18.0.11023"
$NewKey = "CE14062-WinZip18.0"
$OldKey = "CE14062-WinZip16.5"
*===============================================
* END VARIABLE DECLARATION
*===============================================
*===============================================
* 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.exe,winword.exe,excel.exe,outlook.exe,powerpnt.exe,onenote.exe,mspub.exe,msaccess.exe,AcroRd32" -AllowDefer -DeferTimes 3 -CheckDiskSpace -PersistPrompt
# Show Progress Message (with the default message)
Show-InstallationProgress
# Get Installed Application GUID and verify if Application is installed
if ((Get-InstalledApplication -ProductCode "{CD95F661-A5C4-44F5-A6AA-ECDD91C240E1}"| where-object{$_.Displayversion -eq $InstallVersion}) -eq $Null){
if (Get-InstalledApplication "WinZip"){
# Remove any previous versions of WinZip
Remove-MSIApplications "WinZip"
# Remove registry key of older application version
remove-item "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$OldKey"
Write-Log "Removed Key - HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$Oldkey"
}
#*===============================================
#* INSTALLATION
$installPhase = "Installation"
#*===============================================
# Install the base MSI and apply a transform
Execute-MSI -Action Install -Path "$scriptDirectory\Install\86\winzip180-32.msi" -Transform "transform.mst"
#*===============================================
#* POST-INSTALLATION
$installPhase = "Post-Installation"
#*===============================================
# ADD Application Registry Key
new-item "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$NewKey"
#Check if key exists:
If (test-path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$NewKey") {
Write-Log "Created Key - HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$NewKey"
set-itemproperty "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$NewKey" -name DisplayName -type String -Value "NewKey"
}
# Copy WZMUL file to C:\ProgramData\WinZip
Copy-File -Path "$scriptDirectory\SpecialTools\lic18\WinZip.wzmul" -Destination "C:\ProgramData\WinZip"
# Refresh SCCM Client Policy
Trigger-Inventory
*===============================================
* ROLLBACK
*===============================================
} Elseif ($deploymentType -eq "uninstall") { $installPhase = "uninstall"Write-log "Beginning Uninstall"
# Prompt the user to close the following applications if they are running:
Show-InstallationWelcome -CloseApps "iexplore.exe,winword.exe,excel.exe,outlook.exe,powerpnt.exe,onenote.exe,mspub.exe,msaccess.exe,AcroRd32" -AllowDefer -DeferTimes 3
# Show Progress Message (with a message to indicate the application is being uninstalled)
Show-InstallationProgress -StatusMessage "Rolling Back to WinZip 16.5. Please Wait..."
# Remove this version of WinZip
Execute-MSI -Action Uninstall -Path "{CD95F661-A5C4-44F5-A6AA-ECDD91C240E1}"
# Install Previous Version of WinZip
Execute-MSI -Action Install -Path "$scriptDirectory\Rollback\86\WINZIP16-32.MSI" -Transform "transform.mst"
# Remove registry key of newer application version
remove-item "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$NewKey"
# Check if key exists:
If ((test-path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$NewKey") -eq $false) {
Write-Log "Removed Key - HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$NewKey"
}
# Punch OldKey registry of the rolled back application version
new-item "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$OldKey"
If ((test-path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$OldKey") -eq $true) {
Write-Log "Created Key - HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$OldKey"
set-itemproperty "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$OldKey" -name DisplayName -type String -Value "$OldKey"
}
# Remove latest WZMUL file from C:\ProgramData\WinZip
Remove-File -Path "C:\ProgramData\WinZip\WinZip.wzmul"
# Copy WinZip 16.5 WZMUL file to C:\ProgramData\WinZip
Copy-File -Path "$scriptDirectory\SpecialTools\lic165\WinZip.wzmul" -Destination "C:\ProgramData\WinZip"
} }} 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
*===============================================
↧