-
Notifications
You must be signed in to change notification settings - Fork 374
/
chocolateyInstall.ps1
37 lines (34 loc) · 1.4 KB
/
chocolateyInstall.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
$ErrorActionPreference = 'Stop';
if (!$PSScriptRoot) { $PSScriptRoot = Split-Path $MyInvocation.MyCommand.Path -Parent }
. "$PSScriptRoot\helper.ps1"
$packageArgs = @{
packageName = 'freecad'
fileType = '7z'
url = ''
url64 = 'https://github.com/FreeCAD/FreeCAD-Bundle/releases/download/weekly-builds/FreeCAD_weekly-builds-30398-2022-09-18-conda-Windows-x86_64-py310.7z'
softwareName = 'FreeCAD'
checksum = ''
checksumType = ''
checksum64 = 'B10FBE0C7A439E9C7FF8564F7C2CB81B40C17ABEE531C62892D6A24331666CE6'
checksumType64 = 'sha256'
silentArgs = '/S'
validExitCodes = @(0)
}
if ( $packageArgs.filetype -eq '7z' ) {
# Checking for Package Parameters
$pp = ( Get-UserPackageParams -scrawl )
if ($packageArgs.url64 -match "Conda") { $packageArgs.Remove("url"); $packageArgs.Remove("checksum"); $packageArgs.Remove("checksumType"); }
if ($pp.InstallDir) { $packageArgs.Add( "UnzipLocation", $pp.InstallDir ) }
Install-ChocolateyZipPackage @packageArgs
if ($pp.Shortcut) { $pp.Remove("Shortcut"); Install-ChocolateyShortcut @pp }
$files = get-childitem $pp.WorkingDirectory -filter "*.exe" -recurse
foreach ($file in $files) {
if ( $file -notmatch "freecad" ) {
$file = $file.Fullname
New-Item "$file.ignore" -type "file" -force | Out-Null # Generate an ignore file(s)
}
}
}
else {
Install-ChocolateyPackage @packageArgs
}