Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build ico file from scrcpy icon.xpm, download ico file in release #7

Closed

Conversation

amoshydra
Copy link
Contributor

@amoshydra amoshydra commented Aug 7, 2021

Summary

Generate ico file from https://github.com/Genymobile/scrcpy/blob/v1.18/app/src/icon.xpm during build time. Genymobile/scrcpy is included as a submodule to conveniently perserve its Apache 2.0 License and source file.

The generated ico file will be stored in this repository. This allow the icon to be hosted on GitHub. The ico file is not packaged into .nupkg.

During installation (with tools/chocolateyinstall.ps1), ico file will be downloaded from GitHub at a specific commit hash. Example:

## Download & Convert game shortcuts icon
$iconSrc = 'android'
$iconPath = "$(Join-Path $toolsDir $iconSrc'.ico')"
Get-ChocolateyWebFile -PackageName $iconPath `
-FileFullPath $iconPath `
-Url 'https://raw.githubusercontent.com/n3rd4i/scrcpy/8827f45f5d631c46545e935442f567a417d17998/assets/icon.ico' `
-Checksum '269B7310504B534A22FA7568CCBC203FDEFA9F335911F93456D8A8E9E193D897' `
-ChecksumType 'sha256'

Dependencies and tools

png2ico dependency has been removed from the list as the ico file will be packaged in the .nupkg

An additional script scripts/Build-Icon.ps1 is created to do the icon generation. This script depends on:

Related issue

This PR aims to resolve checksum mismatch issue with the current android icon fetched from iconfinder

Downloading android
  from 'https://www.iconfinder.com/icons/317758/download/png/128'

Download of android.png (-1 B) completed.
Error - hashes do not match. Actual value was 'D0B659EB903B08B9A67D97257FC10B7C3269581A913E9F72B20D6E890C01D988'.
ERROR: Checksum for 'C:\Users\username\AppData\Local\Temp\chocolatey\android.png' did not meet 'B2FE913ED202C908D10ACD1D602CCDB24E2E79F3009570E2CADAF22694FFA4DA' for checksum type 'sha256'. Consider passing the actual checksums through with --checksum --checksum64 once you validate the checksums are appropriate. A less secure option is to pass --ignore-checksums if necessary.
The install of scrcpy was NOT successful.
Error while running 'C:\ProgramData\chocolatey\lib\scrcpy\tools\chocolateyinstall.ps1'.
 See log for details.

Additionally

This PR is also created to address the legal issue mentioned in the previous PR #6 (comment)

How is this tested

Tested installation

choco pack
choco install scrcpy -s . -y

Output:

image

Icons in start menu and file explorer

image

submodule is checked out at tag 1.18
This script will pull Genymobile/scrcpy icon source file
from our submodule to create an ico file
@amoshydra
Copy link
Contributor Author

Closing this PR as #6 has been merged

@amoshydra amoshydra closed this Oct 2, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant