Skip to content

Instantly share code, notes, and snippets.

@marrobi
Last active April 10, 2017 09:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save marrobi/95205ed83a8a7d36a3efaab57053d910 to your computer and use it in GitHub Desktop.
Save marrobi/95205ed83a8a7d36a3efaab57053d910 to your computer and use it in GitHub Desktop.
installAdobeFlex.ps1
Function Get-RedirectedUrl
{
Param (
[Parameter(Mandatory=$true)]
[String]$URL
)
$urlRegex = '<a href="(?<Url>[^"]+)"'
$content = (New-Object System.Net.WebClient).DownloadString($url )
$aObject = [regex]::Matches( $content, $urlRegex ) | Where-Object { $_.Groups[ "Url" ].Value -like "http://download.macromedia.com/pub/flex/sdk/*" }
$aObject.Groups["Url"].Value
}
$url = 'http://www.adobe.com/devnet/flex/flex-sdk-download-all.html'
$flexSetupUrl = Get-RedirectedUrl -URL $url
$flexSetup = "${env:Temp}\FlexSetup.zip"
try
{
(New-Object System.Net.WebClient).DownloadFile($flexSetupUrl, $flexSetup)
}
catch
{
Write-Error "Failed to download Adobe Flex SDK Setup"
}
try
{
# Extract Archive
Expand-Archive -Path $flexSetup -DestinationPath "$env:ProgramFiles\Adobe Flex SDK\"
}
catch
{
Write-Error 'Failed to extract Adobe Flex SDK'
}
try{
$fpd = Get-ChildItem -Path "$env:ProgramFiles\Adobe Flex SDK\runtimes\player\" -Recurse -Filter "*InstallPlugin.exe"
Start-Process -FilePath $fpd.FullName -ArgumentList "-install" -Wait
}
catch
{
Write-Error 'Failed to install Adobe Flex SDK Flash Plugin'
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment