In this example, we will build an Adobe Reader installation which provides the following benefits over using a standard MSI based SCCM deployment:
The ability to defer the installation up to 3 times
The ability to close any applications that could cause errors during the installation
Verification that the required disk space is available
Full removal of any previous version of Adobe Reader (to prevent issues sometimes seen when doing an MSI upgrade, i.e. Missing previous installation source files)
Installation of any subsequent patches required after the base MSI installation
This example is provided as a script with the toolkit, in the “Examples” folder.
Copy the application source files in to the “Files” directory, e.g.
Customize the Deploy-Application.ps1 script using the example code below
Install the application by running Deploy-Application.exe
Uninstall the application by running Deploy-Application.exe -DeploymentType "Uninstall"
Initialization
# Populate these variables with the application and script details:
$appVendor = 'Adobe'
$appName = 'Reader'
$appVersion = '11.0.3'
$appArch = ''
$appLang = 'EN'
$appRevision = '01'
$appScriptVersion = '1.0.0'
$appScriptDate = '08/07/2013'
$appScriptAuthor = 'Your Name'
Pre-Install
# Prompt the user to close the following applications if they are running and allow the option to defer the installation up to 3 times:
Show-InstallationWelcome -CloseApps 'iexplore,AcroRd32,cidaemon' -AllowDefer -DeferTimes 3
# Show Progress Message (with the default message)
Show-InstallationProgress
# Remove any previous versions of Adobe Reader
Remove-MSIApplications -Name 'Adobe Reader'
Installation
# Install the base MSI and apply a transform
Execute-MSI -Action Install -Path 'Adobe\_Reader\_11.0.0\_EN.msi' -Transform 'Adobe\_Reader\_11.0.0\_EN\_01.mst'
# Install the patch
Execute-MSI -Action Patch -Path 'Adobe\_Reader\_11.0.3\_EN.msp'
Post-Installation
# No actions required here
Uninstallation
# Prompt the user to close the following applications if they are running:
Show-InstallationWelcome -CloseApps 'iexplore,AcroRd32,cidaemon'
# 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-7AD7-1033-7B44-AB0000000001}'
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。