Guest User

Untitled

a guest
Aug 15th, 2025
15
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.07 KB | None | 0 0
  1. # (Offline-)Install an .appinstaller package for all users on a computer
  2.  
  3. # Prep
  4. Add-Type -AssemblyName System.Web
  5. if (-not (Test-Path "C:\Install\KeeperPasswordManagerFiles")) {
  6. mkdir "C:\Install\KeeperPasswordManagerFiles"
  7. }
  8.  
  9. curl.exe -L "https://download.keepersecurity.com/desktop_electron/packages/KeeperPasswordManager.appinstaller" -o "C:\Install\KeeperPasswordManager.appinstaller" --ssl-no-revoke --fail-with-body
  10. [xml]$ai_xml = Get-Content "C:\Install\KeeperPasswordManager.appinstaller" -Raw
  11.  
  12. # Download deps
  13. Push-Location C:\Install\KeeperPasswordManagerFiles\ -ErrorAction Stop
  14. [System.Environment]::CurrentDirectory = Get-Location
  15.  
  16. $ai_xml.AppInstaller.Dependencies.Package.Uri | % {
  17. $encoded = [System.Web.HttpUtility]::UrlPathEncode($_)
  18. curl.exe -LO "$encoded" --ssl-no-revoke --fail-with-body
  19. }
  20.  
  21. Get-ChildItem
  22.  
  23. # Main app
  24. $appname = $ai_xml.AppInstaller.MainBundle.Name
  25. $dl_url = $ai_xml.AppInstaller.MainBundle.Uri
  26. $encoded_dl_url = [System.Web.HttpUtility]::UrlPathEncode($dl_url)
  27. curl.exe -LO "$encoded_dl_url" --ssl-no-revoke --fail-with-body
  28.  
  29. # Install
  30. $depsList = @(ls C:\Install\KeeperPasswordManagerFiles\ | Where Extension -notlike ".msixbundle")
  31. $mainapp = ls C:\Install\KeeperPasswordManagerFiles\ | Where Extension -like ".msixbundle"
  32.  
  33. Write-Output "Mainapp:"
  34. $mainapp.FullName
  35. Write-Output "DepsList:"
  36. $depsList.FullName
  37.  
  38. try {
  39. Add-AppxProvisionedPackage -Online -PackagePath $mainapp.FullName -DependencyPackagePath $depsList.FullName -Verbose -SkipLicense
  40. } catch {
  41. $_ | Select-Object * | Format-List *
  42. Write-Error $_
  43. }
  44.  
  45. Pop-Location
  46. [System.Environment]::CurrentDirectory = Get-Location
  47.  
  48. # Verify app is provisioned to be installed for all (new?) users
  49. Get-AppxProvisionedPackage -Online | ? DisplayName -like "$appname"
  50.  
  51. # Verify app is installed for the current user
  52. Get-AppxPackage | ? Name -like "$appname"
  53.  
  54. # Check for which users the app has already been installed (likely only current if any?)
  55. # Note: Info is in PackageUserInformation property
  56. Get-AppxPackage -AllUsers | ? Name -like "$appname"
Advertisement
Add Comment
Please, Sign In to add comment