Advertisement
Guest User

Untitled

a guest
Jan 23rd, 2018
173
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. $ErrorActionPreference = 'Stop'
  2.  
  3. $toolsDir = Split-Path $MyInvocation.MyCommand.Definition
  4.  
  5. $packageArgs = @{
  6.   packageName    = 'everything'
  7.   fileType       = 'exe'
  8.   file           = gi "$toolsDir\*x86*.exe"
  9.   file64         = gi "$toolsDir\*x64*.exe"
  10.   silentArgs     = '/S'
  11.   validExitCodes = @(0, 1223)
  12. }
  13. Install-ChocolateyInstallPackage @packageArgs
  14. rm $toolsDir\*Setup*.exe
  15.  
  16. $packageName = $packageArgs.packageName
  17. $installLocation = Get-AppInstallLocation $packageName
  18. if (!$installLocation) { Write-Warning "Can't find $PackageName install location"; exit }
  19.  
  20. Write-Host "$packageName installed to '$installLocation'"
  21. Register-Application "$installLocation\$packageName.exe"
  22. Write-Host "$packageName registered as $packageName"
  23.  
  24. $pp = Get-PackageParameters
  25. $pp.Keys | % { $cmd=@(". '$installLocation\Everything.exe'", '--disable-run-as-admin') } { $cmd += "--install-" + $_.ToLower() }
  26. Write-Host "Post install command line:" $cmd
  27. "$cmd" | iex
  28.  
  29. Write-Host "Starting $packageName"
  30. Start-Process "$installLocation\Everything.exe" -ArgumentList "-startup"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement