03: How to silently install Firefox ESR, Chrome Enterprise and WinZip 14.5 using PolicyPak Scripts Manager

Below are examples on how to use PP Scripts Manager to silently install some commonly used applications.  Please feel free to use and tweak the examples given below to suit your needs.
 

Section 1: Silently installing latest 64bit version of Firefox Extended Support Release

  1. Create a new GPO and link it to the OU where the computers live that will need to have Firefox ESR installed.
  2. Edit the GPO.
  3.  Select “Computer Configuration > PolicyPak > Scripts Manager”.
  4. Click the “ADD NEW COLLECTION” button.
  5. Give the collection a descriptive name, (i.e. Install some commonly used applications using PPScripts), then click “OK”.
  6. Next, double-click on the collection to open it.
  7. Click the “ADD NEW POLICY” button, then click “Next”, then “Next” again keeping the default option.
  8. At the “On apply action” screen select “PowerShell script” from the dropdown.
  9. In the main text window, paste in the script below and then click “Next”.

#Script starts here

Set-ExecutionPolicy -Scope Process -ExecutionPolicy Bypass -Force

# Set Download variables

$DownloadFolder = "c:\temp\apps"

$DownloadURL = "https://download.mozilla.org/?product=firefox-esr-latest&os=win64&lang=en-US"

$LocalDownloadFile = "c:\temp\apps\FFESR.EXE"

#Create temp folder if not present

$tempfolder = "C:\temp"

if (-not (Test-Path $tempfolder -PathType Container))

{

New-Item -ItemType directory -Path $tempfolder

}

# Create apps folder and turn on logging

New-Item -ItemType directory -Path $DownloadFolder

start-transcript -path "c:\temp\apps\Firefox_install.log" -append

# Download and install application

If ((Test-Path $LocalDownloadFile -PathType Leaf-eq $False)

{

Invoke-WebRequest -Uri $DownloadURL -OutFile $LocalDownloadFile

}

c:\temp\apps\FFESR.EXE /SILENT MaintenanceService=false

#Script ends here

  1. Then click “Next” again on the “On revert action” screen.
  2. Select the “Once or when forced” option at the “Specify process mode” screen, then click “Next” again.
  3. Give the policy a descriptive name (i.e. Install latest 64bit version of Firefox ESR), then click “Finish.


Section 2: Silently installing the latest 64bit version of Chrome Enterprise

  1. Use the same GPO and PPScripts collection from Section 1 above or create a new GPO if so desired by following steps 1-6 in Section one above, then continue with steps below.
  2. Click the “ADD NEW POLICY” button, then click “Next”, then “Next” again keeping the default option.
  3. At the “On apply action” screen select “PowerShell script” from the dropdown.
  4. In the main text window, paste in the script below and then click “Next”.

#The Chrome Enterprise install script we download below is courtesy of: https://github.com/haavarstein/Applications/blob/master/Google/Chrome%20Enterprise/Install.ps1

#Script starts here

Set-ExecutionPolicy -Scope Process -ExecutionPolicy Bypass -Force

# Set Download variables

$DownloadFolder = "c:\temp\apps"

$DownloadURL = "https://raw.githubusercontent.com/haavarstein/Applications/master/Google/Chrome%20Enterprise/Install.ps1"

$LocalDownloadFile = "c:\temp\apps\Install_Chrome.ps1"

#Create temp folder if not present

$tempfolder = "C:\temp"

if (-not (Test-Path $tempfolder -PathType Container) )

{

New-Item -ItemType directory -Path $tempfolder

}

# Create apps folder

New-Item -ItemType directory -Path $DownloadFolder

start-transcript -path "c:\temp\apps\chrome_install.log" -append

# Download Application Install Script

If ((Test-Path $LocalDownloadFile -PathType Leaf) -eq $False)

{

Invoke-WebRequest -Uri $DownloadURL -OutFile $LocalDownloadFile

}

Powershell.exe -ExecutionPolicy Bypass -File "c:\temp\apps\Install_Chrome.ps1"

#Script ends here

  1. Then click “Next” again on the “On revert action” screen.
  2. Select the “Once or when forced” option at the “Specify process mode” screen, then click “Next” again.
  3. Give the policy a descriptive name (i.e. Install latest 64bit version of Chrome Enterprise), then click “Finish.


Note: The Chrome Enterprise install.ps1 script downloaded from GitHub is configured to disable GoogleUpdate, if you plan to use this script and would like to have GoogleUpdate enabled you will need to download the script, edit the script to remove the 4 lines in the screenshot below before hosting the new script somewhere yourself. You will also need to set the $DownloadURL to point at your new script’s download location, (i.e. $DownloadURL = https://path_to_mynewscript). Alternatively, you could replace the entire script above with the newly edited version of the GitHub install script, and that would also work.  The example above is provided only to demonstrate how to download a script hosted in a central location using PP Scripts Manager to install software or perform some other task, the benefit of course being that whenever changes are needed they can be easily performed on the script in the hosted location. 



Section 3: Silently installing WinZip 14.5 from MSI package

  1. Use the same GPO and PPScripts collection from Section 1 above or create a new GPO if so desired by following steps 1-6 in Section one above, then continue with steps below.
  2. Click the “ADD NEW POLICY” button, then click “Next”, then “Next” again keeping the default option.
  3. At the “On apply action” screen select “PowerShell script” from the dropdown.
  4. In the main text window, paste in the script below and then click “Next”.

#WinZip 14.5 will be coming from = http://download.winzip.com/winzip145.msi

#Script starts here

Set-ExecutionPolicy -Scope Process -ExecutionPolicy Bypass -Force

# Set Download variables

$DownloadFolder = "c:\temp\apps"

$DownloadURL = "http://download.winzip.com/winzip145.msi"

$LocalDownloadFile = "c:\temp\apps\winzip145.msi"

#Create temp folder if not present

$tempfolder = "C:\temp"

if (-not (Test-Path $tempfolder -PathType Container))

{

New-Item -ItemType directory -Path $tempfolder

}

# Create apps folder and enable logging

New-Item -ItemType directory -Path $DownloadFolder

start-transcript -path "c:\temp\apps\Winzip_PS.log" -append

# Download and install WinZip

If ((Test-Path $LocalDownloadFile -PathType Leaf) -eq $False)

{

Invoke-WebRequest -Uri $DownloadURL -OutFile $LocalDownloadFile

#install WinZip silently and enable verbose logging

MSIEXEC /i c:\temp\apps\winzip145.msi /qn /L*V C:\temp\apps\winzip_install.log

}

#Script ends here

  1. Then click “Next” again on the “On revert action” screen.
  2. Select the “Once or when forced” option at the “Specify process mode” screen, then click “Next” again.
  3. Give the policy a descriptive name (i.e. Install WinZip 14.5), then click “Finish.


Lastly, log into a computer that lives in the OU where this GPO is applied and within a couple minutes you should have ALL THREE APPLICATIONS installed. To watch the process as it is happening, and for troubleshooting logs see the “C:\Temp\Apps” folder on any computer that receives this GPO after GPUPDATE has run. If there is no Apps folder present as yet you can run GPUPDATE /FORCE from a CMD prompt to speed up the process. Chrome and Firefox will create a shortcut on the desktop by default but the WinZip 14.5 MSI does not, to verify that WinZip installed correctly you can try to launch WinZip with the following command: "C:\Program Files (x86)\WinZip\WINZIP32.EXE" from Start > Run or a CMD prompt.

  • 839
  • 18-Sep-2019
  • 164 Views