-
-
Notifications
You must be signed in to change notification settings - Fork 189
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #220 from BetterDiscord/development
Merge Development
- Loading branch information
Showing
28 changed files
with
2,622 additions
and
2,158 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,28 @@ | ||
Copyright (c) 2017 - Present BetterDiscord | ||
End-User License Agreement for BetterDiscord | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: | ||
PLEASE READ THIS AGREEMENT CAREFULLY. IT CONTAINS IMPORTANT TERMS THAT AFFECT YOU AND YOUR USE OF THE SOFTWARE. BY INSTALLING, COPYING OR USING THE SOFTWARE, YOU AGREE TO BE BOUND BY THE TERMS OF THIS AGREEMENT. IF YOU DO NOT AGREE TO THESE TERMS, DO NOT INSTALL, COPY, OR USE THE SOFTWARE. | ||
|
||
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. | ||
This End-User License Agreement (EULA) is a legal agreement between you--either an individual or a single entity--and the author(s) of this Software for the product identified above, which includes computer software and may include associated media, and online or electronic documentation ("Software"). | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. | ||
By installing, copying, or otherwise using the Software, you agree to be bounded by the terms of this EULA. | ||
If you do not agree to the terms of this EULA, do not install or use the Software. | ||
|
||
|
||
1. GRANT OF LICENSE. | ||
This EULA grants you a non-exclusive, non-sublicensable, non-transferable license to install and use the Software. You may install and use an unlimited number of copies of the Software. | ||
|
||
You may reproduce and distribute an unlimited number of copies of the Software; provided that each copy shall be a true and complete copy, including all copyright and trademark notices. | ||
|
||
Without prejudice to any other rights, the author(s) of this Software may terminate this EULA if you fail to comply with the terms and conditions of this EULA. In such event, you must destroy all copies of the Software and all of its component parts. | ||
|
||
|
||
2. COPYRIGHT. | ||
All title and copyrights in and to the Software (including but not limited to any images, libraries, and examples incorporated into the Software), the accompanying documentation, and any copies of the Software are owned by the author(s) of this Software. | ||
|
||
|
||
3. NO WARRANTIES. | ||
The author(s) of this Software expressly disclaims any warranty for the Software. The Software and any related documentation is provided "as is" without warranty of any kind, either express or implied, including, without limitation, the implied warranties or merchantability, fitness for a particular purpose, or noninfringement. The entire risk arising out of use or performance of the Software remains with you. | ||
|
||
|
||
4. NO LIABILITY FOR DAMAGES. | ||
In no event shall the author(s) of this Software be liable for any special, consequential, incidental or indirect damages whatsoever (including, without limitation, damages for loss of business profits, business interruption, loss of business information, or any other pecuniary loss) arising out of the use of or inability to use this product, even if the author(s) of this Software is aware of the possibility of such damages and known defects. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
import {dialog, shell} from "electron"; | ||
import phin from "phin"; | ||
const semverGreaterThan = require("semver/functions/gt"); | ||
const {version} = require("../../package.json"); | ||
|
||
const getJSON = phin.defaults({ | ||
method: "GET", | ||
parse: "json", | ||
headers: {"User-Agent": "BetterDiscord Installer"}, | ||
followRedirects: true | ||
}); | ||
|
||
export default async function () { | ||
const downloadUrl = "https://api.github.com/repos/BetterDiscord/Installer/releases"; | ||
console.info(`Better Discord Installer ${version}`); | ||
|
||
try { | ||
const response = await getJSON(downloadUrl); | ||
const latestRelease = response.body[0]; | ||
const latestVersion = latestRelease.tag_name; | ||
|
||
if (semverGreaterThan(latestVersion, version)) { | ||
console.info(`Found new release ${latestVersion}`); | ||
|
||
const result = await dialog.showMessageBox({ | ||
title: "New Installer Version Available", | ||
message: `A new version of the BetterDiscord installer is available. Click "Download" to download the newest version.`, | ||
buttons: ["Download", "Later"], | ||
defaultId: 0, | ||
cancelId: 1 | ||
}); | ||
|
||
if (result.response === 0) { | ||
await shell.openExternal(latestRelease.html_url); | ||
process.exit(0); | ||
} | ||
|
||
} else { | ||
console.info(`The installer is up to date.`); | ||
} | ||
} | ||
catch (err) { | ||
console.error("Failed to check for updates.", err); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.