Skip to content

Commit

Permalink
hotfix sw folder intro
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrei Hutanu committed Dec 10, 2023
1 parent c8bd296 commit e6ab6f8
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 4 deletions.
2 changes: 1 addition & 1 deletion scrcpy.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<metadata>
<id>scrcpy</id>
<!-- Package Fix Version Notation: 1.1.0.YYYYMMDD -->
<version>2.2</version>
<version>2.2.0.20231210</version>
<packageSourceUrl>https://github.com/n3rd4i/scrcpy.git</packageSourceUrl>
<owners>n3rd4i</owners>
<!-- ============================== -->
Expand Down
28 changes: 25 additions & 3 deletions tools/chocolateyinstall.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,36 @@
$toolsDir = "$(Split-Path -parent $MyInvocation.MyCommand.Definition)"
. "$(Join-Path $toolsDir commonEnv.ps1)"

$url = 'https://github.com/Genymobile/scrcpy/releases/download/v2.2/scrcpy-win64-v2.2.zip'
$folderName = $(Split-Path $url -leaf).replace('.zip', '')

# 1. Download bundle
$packageArgs = @{
packageName = $env:ChocolateyPackageName
unzipLocation = $toolsDir
url = 'https://github.com/Genymobile/scrcpy/releases/download/v2.2/scrcpy-win64-v2.2.zip'
fileFullPath = "$(Join-Path $ENV:TEMP 'scrcpy.zip')"
url = $url
checksum = '9F9DA88AC4C8319DCB9BF852F2D9BBA942BAC663413383419CDDF64EAA5685BD'
checksumType = 'sha256'
}
Install-ChocolateyZipPackage @packageArgs
$archivePath = Get-ChocolateyWebFile @packageArgs

# 2. Extract bundle in $ENV:TEMP
$packageArgs = @{
packageName = $env:ChocolateyPackageName
unzipLocation = $ENV:TEMP
fileFullPath = $archivePath
}
$extractedFolder = Get-ChocolateyUnzip @packageArgs
Remove-Item -Path $archivePath

$sourceFolder = Join-Path -Path $extractedFolder -ChildPath $folderName
if (Test-Path -Path $installLocation) {
# if we get here the emacs folder exists so we need to copy the files into it
Copy-Item -Path "$sourceFolder\*.*" -Destination $installLocation -Recurse -Force

# once we have copied all of the files out of it, remove the folder as we no longer need it
Remove-Item -Path $sourceFolder -Recurse -Force
}

$pp = Get-PackageParameters
if ($pp['ExcludeADB'] -eq 'true') {
Expand Down

0 comments on commit e6ab6f8

Please sign in to comment.