Skip to content

Commit

Permalink
Merge pull request #995 from chocolatey/skype
Browse files Browse the repository at this point in the history
(skype) migrated from ferventcoder/chocolatey-packages
  • Loading branch information
majkinetor committed Apr 6, 2018
2 parents f04a899 + e7c66db commit 269580c
Show file tree
Hide file tree
Showing 4 changed files with 122 additions and 0 deletions.
22 changes: 22 additions & 0 deletions automatic/skype/skype.nuspec
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<?xml version="1.0" encoding="utf-8"?>
<package xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<metadata>
<id>skype</id>
<title>Skype</title>
<version>7.41.0.101</version>
<authors>Microsoft</authors>
<owners>chocolatey,Rob Reynolds</owners>
<summary>Skype - VOIP</summary>
<description>Skype - Install Skype, add your friends as contacts, then call, video call and instant message with them for free. Call people who aren't on Skype too, at really low rates.</description>
<projectUrl>http://www.skype.com</projectUrl>
<packageSourceUrl>https://github.com/chocolatey/chocolatey-coreteampackages/automatic/skype/</packageSourceUrl>
<tags>Skype VOIP voice over ip video conferencing admin</tags>
<licenseUrl>http://www.skype.com/intl/en-us/legal/eula/</licenseUrl>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<iconUrl>https://cdn.rawgit.com/chocolatey/chocolatey-coreteampackages/040c834d483de9e38ceeef0fd8283d803be082bf/icons/skype.png</iconUrl>
</metadata>
<files>
<file src="tools\**" target="tools" />
</files>
</package>
<!-- character encoding: “UTF-8” -->
52 changes: 52 additions & 0 deletions automatic/skype/tools/chocolateyInstall.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
#Install-ChocolateyPackage 'skype' 'exe' '/SILENT /nogoogle /noie /nodesktopicon' 'http://download.skype.com/3694814915aaa38100bfa0933f948e65/partner/59/SkypeSetup.exe'
#Install-ChocolateyPackage 'skype' 'exe' '/SILENT /nogoogle /noie /nodesktopicon' 'https://download.skype.com/msi/SkypeSetup_7.39.0.102.msi'
#Install-ChocolateyPackage 'skype' 'exe' '/SILENT /nogoogle /noie /nodesktopicon' 'http://download.skype.com/SkypeSetupFull.exe'


function isInstalled() {
return Get-WmiObject -Class Win32_Product | Where-Object {$_.Name -match 'Skype\u2122 [\d\.]+$'}
}

$packageName = 'skype'
$fileType = 'msi'
# http://community.skype.com/t5/Windows-archive/Unattended-install/td-p/184628s
$silentArgs = '/qn /norestart STARTSKYPE=FALSE TRANSFORMS=:RemoveDesktopShortcut.mst TRANSFORMS=:RemoveStartup.mst'

$url = 'https://download.skype.com/msi/SkypeSetup_7.41.0.101.msi'
$checksum = 'c7c5499bc1e3663c98fac492b066610c218722e83f9807328c5c4d06607027b2'
$checksumType = 'SHA256'

try {

$appInstalled = isInstalled

if ($appInstalled) {
# If Skype (in any version) is already installed on the computer, remove it first, otherwise the
# installation of Skype will fail with an error.
$msiArgs = $('/x' + $appInstalled.IdentifyingNumber + ' ' + $silentArgs)
Write-Host "Uninstalling previous version of Skype, otherwise installing the new version won’t work."
Start-ChocolateyProcessAsAdmin $msiArgs 'msiexec'

# This loop checks every 5 seconds if Skype is already uninstalled.
# Then it proceeds with the download and installation of the Skype
# version specified in the package.
do {
Start-Sleep -Seconds 5
$i += 1

# Break if too much time passed
if ($i -gt 12) {
Write-Error 'Could not uninstall the previous version of Skype.'
break
}

} until (-not (isInstalled))
}

Install-ChocolateyPackage $packageName $fileType $silentArgs $url -Checksum $checksum -ChecksumType $checksumType

} catch {
Write-ChocolateyFailure $packageName $($_.Exception.Message)
throw
}

48 changes: 48 additions & 0 deletions automatic/skype/update.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
import-module au

function global:au_SearchReplace {
@{
".\tools\chocolateyInstall.ps1" = @{
"(^[$]url\s*=\s*)('.*')" = "`$1'$($Latest.Url32)'"
"(^[$]checksum\s*=\s*)('.*')" = "`$1'$($Latest.Checksum32)'"
"(^[$]checksumType\s*=\s*)('.*')" = "`$1'$($Latest.ChecksumType32)'"
}
}
}

function global:au_BeforeUpdate() {
$pp = $global:ProgressPreference
$global:ProgressPreference = 'SilentlyContinue'
try
{
$Latest.Checksum32 = Get-RemoteChecksum $Latest.Url32
$Latest.ChecksumType32 = 'SHA256'
}
finally
{
$global:ProgressPreference = $pp
}
}

function global:au_GetLatest {
$exeUrl = 'https://go.skype.com/classic.skype'

$exePath = [System.IO.Path]::GetTempFileName()
$ProgressPreference = 'SilentlyContinue'
Invoke-WebRequest -Uri $exeUrl -OutFile $exePath -UseBasicParsing
try
{
$fileVersion = (Get-Item -Path $exePath).VersionInfo.FileVersion
}
finally
{
Remove-Item -Path $exePath -ErrorAction SilentlyContinue
}

@{
Url32 = 'https://download.skype.com/msi/SkypeSetup_{0}.msi' -f $fileVersion
Version = $fileVersion
}
}

update -ChecksumFor none
Binary file added icons/skype.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 269580c

Please sign in to comment.