Advertisement
chthomas

Sharp Pen Drivers and Software

Jul 23rd, 2014
615
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <#
  2. .SYNOPSIS
  3.     This script performs the installation or uninstallation of an application(s).  
  4. .DESCRIPTION
  5.     The script is provided as a template to perform an install or uninstall of an application(s).
  6.     The script either performs an "Install" deployment type or an "Uninstall" deployment type.
  7.     The install deployment type is broken down in to 3 main sections/phases: Pre-Install, Install, and Post-Install.
  8.     The script dot-sources the AppDeployToolkitMain.ps1 script which contains the logic and functions required to install or uninstall an application.
  9.     To access the help section,
  10. .EXAMPLE
  11.     Deploy-Application.ps1
  12. .EXAMPLE
  13.     Deploy-Application.ps1 -DeploymentMode "Silent"
  14. .EXAMPLE
  15.     Deploy-Application.ps1 -AllowRebootPassThru -AllowDefer
  16. .EXAMPLE
  17.     Deploy-Application.ps1 -Uninstall
  18. .PARAMETER DeploymentType
  19.     The type of deployment to perform. [Default is "Install"]
  20. .PARAMETER DeployMode
  21.     Specifies whether the installation should be run in Interactive, Silent or NonInteractive mode.
  22.     Interactive = Default mode
  23.     Silent = No dialogs
  24.     NonInteractive = Very silent, i.e. no blocking apps. Noninteractive mode is automatically set if an SCCM task sequence or session 0 is detected.
  25. .PARAMETER AllowRebootPassThru
  26.     Allows the 3010 return code (requires restart) to be passed back to the parent process (e.g. SCCM) if detected from an installation.
  27.     If 3010 is passed back to SCCM a reboot prompt will be triggered.
  28. .PARAMETER TerminalServerMode
  29.     Changes to user install mode and back to user execute mode for installing/uninstalling applications on Remote Destkop Session Host/Citrix servers
  30. .NOTES
  31. .LINK
  32.     Http://psappdeploytoolkit.codeplex.com
  33. "#>
  34. Param (
  35.     [ValidateSet("Install","Uninstall")]
  36.     [string] $DeploymentType = "Install",
  37.     [ValidateSet("Interactive","Silent","NonInteractive")]
  38.     [string] $DeployMode = "Interactive",
  39.     [switch] $AllowRebootPassThru = $false,
  40.     [switch] $TerminalServerMode = $false
  41. )
  42.  
  43. #*===============================================
  44. #* VARIABLE DECLARATION
  45. Try {
  46. #*===============================================
  47.  
  48. #*===============================================
  49. # Variables: Application
  50.  
  51. $appVendor = "Sharp"
  52. $appName = "Panel Software/Driver"
  53. $appVersion = "2.8.2.13"
  54. $appArch = "x64"
  55. $appLang = "EN"
  56. $appRevision = "01"
  57. $appScriptVersion = "1.0.0"
  58. $appScriptDate = "07/23/2014"
  59. $appScriptAuthor = "Chris Thomas"
  60.  
  61. #*===============================================
  62. # Variables: Script - Do not modify this section
  63.  
  64. $deployAppScriptFriendlyName = "Deploy Application"
  65. $deployAppScriptVersion = [version]"3.1.4"
  66. $deployAppScriptDate = "06/10/2014"
  67. $deployAppScriptParameters = $psBoundParameters
  68.  
  69. # Variables: Environment
  70. $scriptDirectory = Split-Path -Parent $MyInvocation.MyCommand.Definition
  71. # Dot source the App Deploy Toolkit Functions
  72. ."$scriptDirectory\AppDeployToolkit\AppDeployToolkitMain.ps1"
  73.  
  74. #*===============================================
  75. #* END VARIABLE DECLARATION
  76. #*===============================================
  77.  
  78. #*===============================================
  79. #* PRE-INSTALLATION
  80. If ($deploymentType -ne "uninstall") { $installPhase = "Pre-Installation"
  81. #*===============================================
  82.  
  83.     # Perform pre-installation tasks here
  84.  
  85.     # Prompt the user to close the following applications if they are running:
  86.     Show-InstallationWelcome -CloseApps "sharppen" -AllowDefer -DeferTimes 3
  87.     # Show Progress Message (with the default message)
  88.     Show-InstallationProgress
  89.  
  90.     # Import SHARP certificate for driver installation
  91.     Execute-Process -FilePath "$dirSupportFiles\certutil.exe" -Arguments "-addstore -f `"TrustedPublisher`" $dirSupportFiles\sharp.cer"
  92.  
  93. #*===============================================
  94. #* INSTALLATION
  95. $installPhase = "Installation"
  96. #*===============================================
  97.  
  98.     # Perform installation tasks here
  99.  
  100.     # Install 64-bit Sharp Touch Panel Driver, Pen Software, Touch Application Pad Software and Pen Software Update
  101.     if ((Get-WmiObject -Class Win32_OperatingSystem | Select-Object OSArchitecture) -like "*64-bit*"){
  102.         Execute-MSI -Action Install -Path "$dirFiles\TouchPanelDriver_Setup64_ENU.msi"
  103.         Execute-Process -FilePath "$dirFiles\PenSoftware_Setup_x64.exe" -Arguments "/s /sms /f1$dirFiles\PenSoftware_Setup_x64_Install.iss"
  104.         Execute-MSI -Action Install -Path "$dirFiles\TouchApplicationPad_Setup_eng_x64.msi"
  105.  
  106.         Show-InstallationPrompt -Message "This next installer could not be completely automated. You will need to proceed through the prompts to complete the installation. `n`nPlease click: `n`n- Next `n- Next `n- Install `n- Finish" -PersistPrompt -Icon Exclamation -ButtonMiddleText "OK"
  107.  
  108.         Execute-Process -FilePath "$dirFiles\PenSoftware_(Ver.2.8.2.13)_Updater.exe" -Arguments "/s /sms /f1$dirFiles\PenSoftware_(Ver.2.8.2.13)_Updater_Install.iss"
  109.     }
  110.  
  111. #*===============================================
  112. #* POST-INSTALLATION
  113. $installPhase = "Post-Installation"
  114. #*===============================================
  115.  
  116.     # Perform post-installation tasks here
  117.  
  118.     # Remove desktop icons
  119.     Remove-File -Path "$envPublic\Desktop\Overlay mode Pen Software.lnk"
  120.     Remove-File -Path "$envPublic\Desktop\Pen Software.lnk"
  121.     Remove-File -Path "$envPublic\Desktop\Touch Display Launcher.lnk"
  122.  
  123.     If ($DeployMode -ne "Silent") {
  124.         # Inform the user that the installation has completed
  125.         Show-InstallationPrompt -Message "$installTitle has completed installation. `n `n If you encounter any issues with this software please enter a ticket or call Help Desk at x4357." -Icon "Information" -ButtonMiddleText "OK" -NoWait
  126.     }
  127. #*===============================================
  128. #* UNINSTALLATION
  129. } ElseIf ($deploymentType -eq "uninstall") { $installPhase = "Uninstallation"
  130. #*===============================================
  131.  
  132.     # Perform uninstallation tasks here
  133.  
  134.     # Prompt the user to close the following applications if they are running:
  135.     Show-InstallationWelcome -CloseApps "sharppen" -AllowDefer -DeferTimes 3
  136.     # Show Progress Message (with a message to indicate the application is being uninstalled)
  137.     Show-InstallationProgress -StatusMessage "Uninstalling Application $installTitle. Please Wait..."
  138.  
  139.     # Uninstall x64 Touch Panel Driver
  140.     Execute-MSI -Action Uninstall -Path "{7626BF3E-02BF-4896-8E71-4342BD67ED8E}"
  141.  
  142.     # Uninstall x64 Pen Software (pre-update)
  143.     # Execute-Process -FilePath "$dirFiles\PenSoftware_Setup_x64.exe" -Arguments "/s /sms /f1$dirFiles\PenSoftware_Setup_x64_Uninstall.iss"
  144.  
  145.     # Uninstall x64 Touch Application Pad Software
  146.     Execute-MSI -Action Uninstall -Path "{D08BFAFA-2832-41C0-A092-4D30DC626168}"
  147.  
  148.     # Uninstall x64 Pen Software Update
  149.     Execute-MSI -Action Uninstall -Path "{0164330E-769E-4F9A-B070-9256CF175659}"
  150.  
  151.     # Uninstall x64 Pen Software with Update
  152.     Show-InstallationPrompt -Message "This next uninstaller could not be completely automated. You will need to proceed through the prompts to complete the uninstallation. `n`nPlease click: `n`n- Remove (radio button) `n- Next `n- Yes `n- Finish" -PersistPrompt -Icon Exclamation -ButtonMiddleText "OK"
  153.  
  154.     Execute-Process -FilePath "$dirFiles\PenSoftware_(Ver.2.8.2.13)_Updater.exe" -Arguments "/s /sms /f1$dirFiles\PenSoftware_(Ver.2.8.2.13)_Updater_Uninstall.iss"
  155.  
  156. #*===============================================
  157. #* END SCRIPT BODY
  158. } } Catch { $exceptionMessage = "$($_.Exception.Message) `($($_.ScriptStackTrace)`)"; Write-Log "$exceptionMessage"; Show-DialogBox -Text $exceptionMessage -Icon "Stop"; Exit-Script -ExitCode 1 } # Catch any errors in this script
  159. Exit-Script -ExitCode 0 # Otherwise call the Exit-Script function to perform final cleanup operations
  160. #*===============================================
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement