Skip to content

Instantly share code, notes, and snippets.

@ferventcoder
Last active Oct 27, 2016
Embed
What would you like to do?
FireFox override install directory

Make sure you set up the directory like this:

firefox
 | - firefox.nuspec
 | - tools
     | - chocolateyInstall.ps1
     | - firefox.ini
     | - 32bitinstaller.exe
     | - 32bitinstaller.exe.ignore (shim director, empty file that bears exact name of exe with `.ignore` appended)
     | - 64bitinstaller.exe
     | - 64bitinstaller.exe.ignore (shim director, empty file that bears exact name of exe with `.ignore` appended)
$ErrorActionPreference = 'Stop';
$toolsDir = "$(Split-Path -parent $MyInvocation.MyCommand.Definition)"
$fileLocation = Join-Path $toolsDir 'Embedded 32bitinstallerhere.exe'
$fileLocation64 = Join-Path $toolsDir 'Embedded 64bitinstallerhere.exe'
$iniFile = Join-Path $toolsDir 'firefox.ini'
if (Get-ProcessorBits 64) {
$forceX86 = $env:chocolateyForceX86
if ($forceX86 -eq 'true') {
Write-Debug "User specified '-x86' so forcing 32-bit"
else {
$fileLocation = $fileLocation64
}
}
$packageArgs @{
packageName = 'firefox'
softwareName = 'Firefox*'
file = $fileLocation
fileType = 'exe'
silentArgs = "/INI=$iniFile"
validExitCodes= @(0)
}
Install-ChocolateyPackage @packageArgs
[Install]
;
; Remove the semicolon (;) to un-comment a line.
;
; The name of the directory where the application will be installed in the
; system's program files directory. The security
; context the installer is running in must have write access to the
; installation directory. Also, the directory must not exist or if it exists
; it must be a directory and not a file. If any of these conditions are not met
; the installer will abort the installation with an error level of 2. If this
; value is specified then InstallDirectoryPath will be ignored.
; InstallDirectoryName=Mozilla Firefox
; The full path to the directory to install the application. The security
; context the installer is running in must have write access to the
; installation directory. Also, the directory must not exist or if it exists
; it must be a directory and not a file. If any of these conditions are not met
; the installer will abort the installation with an error level of 2.
InstallDirectoryPath=d:\firefox\
; By default all of the following shortcuts are created. To prevent the
; creation of a shortcut specify false for the shortcut you don't want created.
; Create a shortcut for the application in the current user's QuickLaunch
; directory.
; QuickLaunchShortcut=false
; Create a shortcut for the application on the desktop. This will create the
; shortcut in the All Users Desktop directory and if that fails this will
; attempt to create the shortcuts in the current user's Start Menu directory.
; DesktopShortcut=false
; Create shortcuts for the application in the Start Menu. This will create the
; shortcuts in the All Users Start Menu directory and if that fails this will
; attempt to create the shortcuts in the current user's Start Menu directory.
; StartMenuShortcuts=false
; The directory name to use for the StartMenu folder (not available with
; Firefox 4.0 and above - see note below).
; note: if StartMenuShortcuts=false is specified then this will be ignored.
; StartMenuDirectoryName=Mozilla Firefox
; The MozillaMaintenance service is used for silent updates and may be used
; for other maintenance related tasks. It is an optional component.
; This option can be used in Firefox 16 or later to skip installing the service.
; MaintenanceService=false
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment