Crew Two

Audacity 2.3.3 | Scripted

About

Audacity is a free and open-source digital audio editor and recording application software, available for Windows, macOS, Linux, and other Unix-like operating systems.

Obtain Package Source

Traditionally, three components were required for running Audacity for most purposes:

However, the latest Audacity installer now includes LAME, so this will not be required and the above link is for reference only. Bear in mind the uninstaller we create will look for LAME also, to ensure any legacy installs are removed if a previous version of LAME was installed.

Vendor Configuration for Silent Install

The vendor installer is based on the Inno Setup installer. Configuration options for installation including silent install can be found at jrsoftware.org.

Suppress Desktop Shortcut

The default silent install of Audacity creates a shortcut on the desktop, which is undesirable in many environments. To stop this happening, a config file can be created by running a manual install using switches from the above list:

audacity-win-2.3.3.exe /SAVEINF="<path>\config.inf"

config.inf

[Setup]
Lang=en
Dir=C:\Program Files (x86)\Audacity
Group=(Default)
NoIcons=0
Tasks=

Install.ps1

The script will call the Uninstaller to ensure any previous versions are removed prior to install.

# This script performs the installation or uninstallation of an application(s).
# Created 19/12/2019 | cru2.io


# Remove previous versions if exist
[string]$CurrentPath = Split-Path -Parent $MyInvocation.MyCommand.Definition
. "$CurrentPath\Uninstall.ps1" | Out-Null


# Variables
[string]$OSVersion = (Get-CimInstance Win32_OperatingSystem).version
[string]$ProcessNTAccount = (whoami)
[string]$scriptTime = (Get-Date -f "dd/MM/yyyy HH:mm:ss")
[string]$pkgName = "Audacity for Windows 2.3.3"
[string]$appLogFile = $env:ProgramData + '\Logs\' + $pkgName + '_Install.log'


# Functions
Function WriteLog
    {
	Param ([string]$logstring)
	Add-content $appLogFile -value $logstring
	Write-Host $logstring
    }



# Install
WriteLog " "
WriteLog "Installing $pkgName"
[string]$pkgInstaller = "$CurrentPath\audacity-win-2.3.3.exe"
[string]$Parms = "/LOADINF=`"$CurrentPath\config.inf`" /VERYSILENT /NORESTART"
WriteLog "$pkgInstaller $Parms"
Start-Process $pkgInstaller -ArgumentList $Parms -Wait -PassThru -NoNewWindow -ErrorAction SilentlyContinue -WarningAction SilentlyContinue | Out-Null
[string]$pkgInstaller = "$CurrentPath\ffmpeg-win-2.2.2.exe"
[string]$Parms = "/VERYSILENT /NORESTART"
WriteLog "$pkgInstaller $Parms"
Start-Process $pkgInstaller -ArgumentList $Parms -Wait -PassThru -NoNewWindow -ErrorAction SilentlyContinue -WarningAction SilentlyContinue | Out-Null
WriteLog "MachineName: $env:ComputerName"
WriteLog "WindowsVersion: $OSVersion"
WriteLog "Installed by: $ProcessNTAccount"
WriteLog "Time: $scriptTime"
WriteLog " "

Uninstall.ps1

The Uninstall script will detect, log and remove any version of Audacity.

# This script performs the installation or uninstallation of an application(s).
# Created 19/12/2019 | cru2.io
# Universal Uninstaller


# Variables
[string]$CurrentPath = Split-Path -Parent $MyInvocation.MyCommand.Definition
[string]$OSVersion = (Get-CimInstance Win32_OperatingSystem).version
[string]$ProcessNTAccount = (whoami)
[string]$scriptTime = (Get-Date -f "dd/MM/yyyy HH:mm:ss")
[string]$pkgName = "Audacity for Windows"
[string]$appLogFile = $env:ProgramData + '\Logs\' + $pkgName + '_Uninstall.log'



# Functions
Function WriteLog
    {
	Param ([string]$logstring)
	Add-content $appLogFile -value $logstring
	Write-Host $logstring
    }



# Remove previous versions if exist
[array]$appInstalls = "*FFmpeg*","*LAME*","*Audacity*"
ForEach ($appInstall in $appInstalls)
	{
	[array]$regFolders = "HKLM:\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall","HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall"
	ForEach ($regFolder in $regFolders)
		{
		$appVer = Get-ChildItem -Path $regFolder |
			Get-ItemProperty |
				Where-Object {$_.DisplayName -like $appInstall } |
					Select-Object -Property DisplayName, DisplayVersion, UninstallString
		ForEach ($ver in $appVer)
			{
			If ($ver.UninstallString)
				{
				$appName = $ver.DisplayName
				$Uninst = $ver.UninstallString
				$Parms = "/VERYSILENT /NORESTART"

				# Uninstall
				WriteLog " "
				WriteLog "Uninstalling $appName"
				WriteLog "$Uninst $Parms"
				Start-Process $Uninst -ArgumentList $Parms -Wait -PassThru -NoNewWindow -ErrorAction SilentlyContinue -WarningAction SilentlyContinue | Out-Null
				WriteLog "MachineName: $env:ComputerName"
				WriteLog "WindowsVersion: $OSVersion"
				WriteLog "Uninstalled by: $ProcessNTAccount"
				WriteLog "Time: $scriptTime"
				WriteLog " "
				}
			}
		}
	}

Deployment Info

For SCCM detection.

Audacity 2.3.3
Audacity Team
C:\Program Files (x86)\Audacity\audacity.exe

Hive: HKEY_LOCAL_MACHINE
Key: SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Audacity_is1
Value: DisplayVersion
DataType: Version
Data: 2.3.3
Operator: Greater than or equal to
32-bit: Yes
SCCM Requirement: None

Logging

Can be found at:

C:\ProgramData\Logs

About: nick