Git Product home page Git Product logo

chocolatey-package-messenger's Introduction

Chocolatey Package: Messenger

Latest package version shield Total package download count shield

Install

Install Chocolatey, and run the following command to install the latest approved stable version from the Chocolatey Community Repository:

choco install messenger --source="'https://community.chocolatey.org/api/v2'"

Alternatively, the packages as published on the Chocolatey Community Repository will also be mirrored on this repository's Releases page. The nupkg can be installed from the current directory (with dependencies sourced from the Community Repository) as follows:

choco install messenger --source="'.;https://community.chocolatey.org/api/v2/'"

This package also supports the project's beta builds. Opt into these with the --prerelease switch.

Build

Install Chocolatey, clone this repository, and run the following command in the cloned repository:

choco pack

A successful build will create messenger.x.y.z.nupkg, where x.y.z should be the Nuspec's version value at build time.

Note that Chocolatey package builds are non-deterministic. Consequently, an independently built package will fail a checksum validation against officially published packages.

Update

This package should be automatically updated by the Chocolatey Automatic Package Updater Module. If it is outdated by more than a few days, please open an issue.

AU Setup

AU expects the parent directory that contains this repository to share a name with the Nuspec (messenger). Your local repository should therefore be cloned accordingly:

git clone [email protected]:brogers5/chocolatey-package-messenger.git messenger

Alternatively, a junction point can be created that points to the local repository (preferably within a repository adopting the AU packages template):

mklink /J messenger ..\chocolatey-package-messenger

Beta Stream Setup

The update script will request the latest version information for both the stable and beta channels directly from Messenger's Sparkle service.

While information for the stable channel may be anonymously queried, the beta channel requires access to a Facebook account that has joined Messenger's beta testing program. Users can opt into this directly in Messenger - from the menu bar, browse to File > Preferences > General, and toggle Join beta testing:

Screenshot of beta testing toggle

Requests for beta version information will also require sending authentication cookies that contain the account's static user ID (c_user) and a dynamic unique session ID (xs). We can take advantage of session riding to reuse an existing session ID from PowerShell and minimize authenticating to Facebook.

The script depends on PowerShell's SecretManagement module to securely query for the cookies' values from a registered extension vault.

If you do not already have an extension vault registered, install an extension vault module of your choice, then register a secret vault as required by the module's implementation.

Log into Facebook from your web browser, grab the cookies' values, then create the following secrets:

#TODO: Populate using values sourced from web browser
$c_userValue = ''
$xsValue = ''

Set-Secret -Name 'Facebook User ID' -Secret $c_userValue
Set-Secret -Name 'Facebook Session ID' -Secret $xsValue

Note

The session ID secret will require occasional updates to work around sessions expiring or otherwise being invalidated by Facebook (e.g. logging out, password changes, device removal, suspicious account activity, etc.).

VirusTotal Setup

While not strictly necessary to produce a working package, it's recommended to install VirusTotal's CLI and configure an API key. An API key can be procured for free with a VirusTotal account.

This should enable automated submission of the installer binary to VirusTotal, which would improve the user experience for Chocolatey Pro+ users. They have access to Chocolatey's Runtime Malware Protection feature, which by default is enabled and configured for VirusTotal integration.

Normally, the Community Repository's Package Scanner service would upload the installer binary to VirusTotal, as a prerequisite to the moderation process's Scan Testing step. Unfortunately, the package is currently incompatible with it (due to a conflicting OS requirement), and will therefore fail to submit the installer binary.

As new Messenger releases are unlikely to have been scanned prior to an updated package's publication, this would avoid burdening users with a run-time prompt to optionally upload the installer binary to VirusTotal for scanning.

Execution and Testing

Once everything is set up, simply run update.ps1 from within the created directory/junction point. Assuming all goes well, all relevant files should change to reflect the latest version available for the last stream that was built. This will also build a new package version using the modified files.

To limit the scope of update checks to a specific update channel, pass the -IncludeStream parameter with the desired Stream name:

.\update.ps1 -IncludeStream 'Stable'
.\update.ps1 -IncludeStream 'Beta'

Before submitting a pull request, please test the package with a 64-bit Windows 10 v1903+ environment similar to the Chocolatey Testing Environment first.

chocolatey-package-messenger's People

Contributors

brogers5 avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

chocolatey-package-messenger's Issues

Checksum mismatch Messenger 182.0.455264854

  • Verifying package provided checksum of '7a5210d6eeeb70b1b7ca0fb929adf3905ea4132e7e355c4659bbe6c468914df5' for 'C:\Users\frbc1002\AppData\Local\Temp\chocolatey\messenger\182.0.455264854\Messenger.182.0.0.9.73.exe'.
    2023-04-28 09:54:22,354 60248 [DEBUG] - Running Get-ChecksumValid -file 'C:\Users\frbc1002\AppData\Local\Temp\chocolatey\messenger\182.0.455264854\Messenger.182.0.0.9.73.exe' -checksum '7a5210d6eeeb70b1b7ca0fb929adf3905ea4132e7e355c4659bbe6c468914df5' -checksumType 'sha256' -originalUrl 'https://www.messenger.com/messenger/desktop/downloadV2/?platform=win'
    2023-04-28 09:54:22,404 60248 [DEBUG] - checksum.exe found at 'C:\ProgramData\chocolatey\helpers..\tools\checksum.exe'
    2023-04-28 09:54:22,438 60248 [DEBUG] - Executing command ['C:\ProgramData\chocolatey\helpers..\tools\checksum.exe' -c="7a5210d6eeeb70b1b7ca0fb929adf3905ea4132e7e355c4659bbe6c468914df5" -t="sha256" -f="C:\Users\frbc1002\AppData\Local\Temp\chocolatey\messenger\182.0.455264854\Messenger.182.0.0.9.73.exe"]
    2023-04-28 09:54:23,278 60248 [DEBUG] - Command ['C:\ProgramData\chocolatey\helpers..\tools\checksum.exe' -c="7a5210d6eeeb70b1b7ca0fb929adf3905ea4132e7e355c4659bbe6c468914df5" -t="sha256" -f="C:\Users\frbc1002\AppData\Local\Temp\chocolatey\messenger\182.0.455264854\Messenger.182.0.0.9.73.exe"] exited with '1'.
    2023-04-28 09:54:23,313 60248 [ERROR] - ERROR: Checksum for 'C:\Users\frbc1002\AppData\Local\Temp\chocolatey\messenger\182.0.455264854\Messenger.182.0.0.9.73.exe' did not meet '7a5210d6eeeb70b1b7ca0fb929adf3905ea4132e7e355c4659bbe6c468914df5' 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.
    2023-04-28 09:54:23,352 60248 [DEBUG] - Built-in PowerShell host called with ['[System.Threading.Thread]::CurrentThread.CurrentCulture = '';[System.Threading.Thread]::CurrentThread.CurrentUICulture = ''; & import-module -name 'C:\ProgramData\chocolatey\helpers\chocolateyInstaller.psm1'; & 'C:\ProgramData\chocolatey\helpers\chocolateyScriptRunner.ps1' -packageScript 'C:\ProgramData\chocolatey\lib\messenger\tools\chocolateyinstall.ps1' -installArguments '' -packageParameters '' -preRunHookScripts $null -postRunHookScripts $null'] exited with '-1'.
    2023-04-28 09:54:23,391 60248 [DEBUG] - Calling command ['"C:\WINDOWS\System32\shutdown.exe" /a']
    2023-04-28 09:54:23,719 60248 [DEBUG] - Command ['"C:\WINDOWS\System32\shutdown.exe" /a'] exited with '1116'
    2023-04-28 09:54:24,023 60248 [DEBUG] - Capturing package files in 'C:\ProgramData\chocolatey\lib\messenger'
    2023-04-28 09:54:24,057 60248 [DEBUG] - Found 'C:\ProgramData\chocolatey\lib\messenger\messenger.nupkg'
    with checksum 'A83F7C4080B3F8DEA21D4D2BF7C858DC'
    2023-04-28 09:54:24,090 60248 [DEBUG] - Found 'C:\ProgramData\chocolatey\lib\messenger\messenger.nuspec'
    with checksum 'FF770626B93367AA48A2CA1213901F42'
    2023-04-28 09:54:24,125 60248 [DEBUG] - Found 'C:\ProgramData\chocolatey\lib\messenger\tools\chocolateybeforemodify.ps1'
    with checksum 'A2C7D2393AE0205B879A14EBBF5ADAAC'
    2023-04-28 09:54:24,158 60248 [DEBUG] - Found 'C:\ProgramData\chocolatey\lib\messenger\tools\chocolateyinstall.ps1'
    with checksum '2D1B4CC9AFA49246929E48FC741FF1A8'
    2023-04-28 09:54:24,193 60248 [DEBUG] - Found 'C:\ProgramData\chocolatey\lib\messenger\tools\chocolateyuninstall.ps1'
    with checksum '6C5055FEA09E3FE30AA243667B588EBB'
    2023-04-28 09:54:24,251 60248 [DEBUG] - Attempting to delete file "C:\ProgramData\chocolatey.chocolatey\messenger.182.0.455264854.arguments".
    2023-04-28 09:54:24,283 60248 [DEBUG] - Attempting to delete file "C:\ProgramData\chocolatey.chocolatey\messenger.182.0.455264854.extra".
    2023-04-28 09:54:24,314 60248 [DEBUG] - Attempting to delete file "C:\ProgramData\chocolatey.chocolatey\messenger.182.0.455264854.version".
    2023-04-28 09:54:24,346 60248 [DEBUG] - Attempting to delete file "C:\ProgramData\chocolatey.chocolatey\messenger.182.0.455264854.sxs".
    2023-04-28 09:54:24,376 60248 [DEBUG] - Attempting to delete file "C:\ProgramData\chocolatey.chocolatey\messenger.182.0.455264854.pin".
    2023-04-28 09:54:24,409 60248 [DEBUG] - Attempting to delete directory "C:\ProgramData\chocolatey\lib-bad\messenger".
    2023-04-28 09:54:24,445 60248 [DEBUG] - Sending message 'HandlePackageResultCompletedMessage' out if there are subscribers...
    2023-04-28 09:54:24,479 60248 [ERROR] - The install of messenger was NOT successful.
    2023-04-28 09:54:24,517 60248 [ERROR] - Error while running 'C:\ProgramData\chocolatey\lib\messenger\tools\chocolateyinstall.ps1'.
    See log for details.
    2023-04-28 09:54:24,558 60248 [DEBUG] - Moving 'C:\ProgramData\chocolatey\lib\messenger'
    to 'C:\ProgramData\chocolatey\lib-bad\messenger'
    2023-04-28 09:54:26,606 60248 [DEBUG] - Attempting rollback
    2023-04-28 09:54:26,636 60248 [DEBUG] - Moving 'C:\ProgramData\chocolatey\lib-bkp\messenger'
    to 'C:\ProgramData\chocolatey\lib\messenger'
    2023-04-28 09:54:28,685 60248 [DEBUG] - Attempting to delete file "C:\Users\frbc1002\AppData\Local\NuGet\Cache\messenger.182.0.455264854.nupkg".
    2023-04-28 09:54:28,737 60248 [WARN ] -
    Chocolatey installed 0/1 packages. 1 packages failed.
    See the log for details (C:\ProgramData\chocolatey\logs\chocolatey.log).
    2023-04-28 09:54:28,768 60248 [INFO ] -
    2023-04-28 09:54:28,800 60248 [ERROR] - Failures
    2023-04-28 09:54:28,833 60248 [ERROR] - - messenger (exited -1) - Error while running 'C:\ProgramData\chocolatey\lib\messenger\tools\chocolateyinstall.ps1'.
    See log for details.
    2023-04-28 09:54:28,868 60248 [DEBUG] - Sending message 'PostRunMessage' out if there are subscribers...
    2023-04-28 09:54:28,949 60248 [DEBUG] - Exiting with -1

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.